Skip to content

Add a test for overshadowing redirects - #15259

Merged
MichaReiser merged 2 commits into
astral-sh:mainfrom
InSyncWithFoo:tests-redirects
Jan 5, 2025
Merged

Add a test for overshadowing redirects#15259
MichaReiser merged 2 commits into
astral-sh:mainfrom
InSyncWithFoo:tests-redirects

Conversation

@InSyncWithFoo

@InSyncWithFoo InSyncWithFoo commented Jan 4, 2025

Copy link
Copy Markdown
Contributor

Summary

Resolves #15257.

Test Plan

cargo nextest run and cargo insta test.

@InSyncWithFoo

Copy link
Copy Markdown
Contributor Author

The test added currently does not pass, but it will once #15258 is merged. For the record, here's what the message looks like:

────────────
     Summary [  10.999s] 3795 tests run: 3794 passed, 1 failed, 23 skipped
        FAIL [   0.004s] ruff_linter rule_redirects::tests::overshadowing_redirects
──── STDOUT:             ruff_linter rule_redirects::tests::overshadowing_redirects

running 1 test
test rule_redirects::tests::overshadowing_redirects ... FAILED

failures:

failures:
    rule_redirects::tests::overshadowing_redirects

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 2217 filtered out; finished in 0.00s

──── STDERR:             ruff_linter rule_redirects::tests::overshadowing_redirects
thread 'rule_redirects::tests::overshadowing_redirects' panicked at crates/ruff_linter/src/rule_redirects.rs:155:17:
Rule RUF025 is overshadowed by a redirect, which points to C420.

As for Clippy, I'm not sure why it says the imports are unused.

@MichaReiser MichaReiser added the testing Related to testing Ruff itself label Jan 5, 2025
@MichaReiser

Copy link
Copy Markdown
Member

Thank you so much for fixing this so quickly!

Clippy complaint because the mod test missed the #[cfg(test)] gating.

@MichaReiser
MichaReiser merged commit f144b96 into astral-sh:main Jan 5, 2025
@github-actions

github-actions Bot commented Jan 5, 2025

Copy link
Copy Markdown
Contributor

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@InSyncWithFoo
InSyncWithFoo deleted the tests-redirects branch January 5, 2025 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testing Related to testing Ruff itself

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add test or static assertion to prevent accidental overlap between recoded and regular rules

2 participants