-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ERA001): detect commented out
case
statements, add more one-lin…
…e support (#10055) ## Summary Closes #10031 - Detect commented out `case` statements. Playground repro: https://play.ruff.rs/5a305aa9-6e5c-4fa4-999a-8fc427ab9a23 - Add more support for one-line commented out code. ## Test Plan Unit tested and tested with ```sh cargo run -p ruff -- check crates/ruff_linter/resources/test/fixtures/eradicate/ERA001.py --no-cache --preview --select ERA001 ``` TODO: - [x] `cargo insta test`
- Loading branch information
1 parent
68b8abf
commit 0d363ab
Showing
4 changed files
with
21 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,3 +28,5 @@ class A(): | |
} | ||
|
||
#import os # noqa | ||
|
||
# case 1: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters