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

Fix RUF028 not allowing # fmt: skip on match cases #10178

Merged
merged 1 commit into from
Mar 1, 2024

Conversation

snowsignal
Copy link
Contributor

Summary

Fixes #10174 by allowing match cases to be enclosing nodes for suppression comments. else/elif clauses are now also allowed to be enclosing nodes.

Test Plan

I've added the offending code from the original issue to the RUF028 snapshot test, and I've also expanded it to test the allowed else/elif clause.

@snowsignal snowsignal added the bug Something isn't working label Mar 1, 2024
@snowsignal snowsignal requested a review from MichaReiser March 1, 2024 05:56
Copy link
Contributor

github-actions bot commented Mar 1, 2024

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@snowsignal snowsignal merged commit 8ecdf53 into main Mar 1, 2024
17 checks passed
@snowsignal snowsignal deleted the jane/linter/ruf028/match-case-header branch March 1, 2024 08:36
nkxxll pushed a commit to nkxxll/ruff that referenced this pull request Mar 10, 2024
## Summary

Fixes astral-sh#10174 by allowing match cases to be enclosing nodes for
suppression comments. `else/elif` clauses are now also allowed to be
enclosing nodes.

## Test Plan
I've added the offending code from the original issue to the `RUF028`
snapshot test, and I've also expanded it to test the allowed `else/elif`
clause.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Invalid RUF028 for match case header
2 participants