Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a test for overshadowing redirects #15259

Merged
merged 2 commits into from
Jan 5, 2025

Conversation

InSyncWithFoo
Copy link
Contributor

@InSyncWithFoo InSyncWithFoo commented Jan 4, 2025

Summary

Resolves #15257.

Test Plan

cargo nextest run and cargo insta test.

@InSyncWithFoo
Copy link
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
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
20 checks passed
Copy link
Contributor

github-actions bot commented Jan 5, 2025

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