-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
…9518) ## Summary Add autofix for `multiple_imports_on_one_line`, `E401` ## Test Plan `cargo test`
- Loading branch information
1 parent
b64aa1e
commit 8379841
Showing
6 changed files
with
407 additions
and
23 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
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
60 changes: 44 additions & 16 deletions
60
.../src/rules/pycodestyle/snapshots/ruff_linter__rules__pycodestyle__tests__E402_E40.py.snap
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 |
---|---|---|
@@ -1,32 +1,60 @@ | ||
--- | ||
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs | ||
--- | ||
E40.py:55:1: E402 Module level import not at top of file | ||
E40.py:56:1: E402 Module level import not at top of file | ||
| | ||
53 | VERSION = '1.2.3' | ||
54 | | ||
55 | import foo | ||
54 | VERSION = '1.2.3' | ||
55 | | ||
56 | import foo | ||
| ^^^^^^^^^^ E402 | ||
56 | #: E402 | ||
57 | import foo | ||
57 | #: E402 | ||
58 | import foo | ||
| | ||
|
||
E40.py:57:1: E402 Module level import not at top of file | ||
E40.py:58:1: E402 Module level import not at top of file | ||
| | ||
55 | import foo | ||
56 | #: E402 | ||
57 | import foo | ||
56 | import foo | ||
57 | #: E402 | ||
58 | import foo | ||
| ^^^^^^^^^^ E402 | ||
58 | | ||
59 | a = 1 | ||
59 | | ||
60 | a = 1 | ||
| | ||
|
||
E40.py:61:1: E402 Module level import not at top of file | ||
E40.py:62:1: E402 Module level import not at top of file | ||
| | ||
59 | a = 1 | ||
60 | | ||
61 | import bar | ||
60 | a = 1 | ||
61 | | ||
62 | import bar | ||
| ^^^^^^^^^^ E402 | ||
63 | | ||
64 | #: E401 | ||
| | ||
|
||
E40.py:65:1: E402 Module level import not at top of file | ||
| | ||
64 | #: E401 | ||
65 | import re as regex, string # also with a comment! | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ E402 | ||
66 | import re as regex, string; x = 1 | ||
| | ||
|
||
E40.py:66:1: E402 Module level import not at top of file | ||
| | ||
64 | #: E401 | ||
65 | import re as regex, string # also with a comment! | ||
66 | import re as regex, string; x = 1 | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ E402 | ||
67 | | ||
68 | x = 1; import re as regex, string | ||
| | ||
|
||
E40.py:68:8: E402 Module level import not at top of file | ||
| | ||
66 | import re as regex, string; x = 1 | ||
67 | | ||
68 | x = 1; import re as regex, string | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ E402 | ||
| | ||
|
||
|
Oops, something went wrong.