-
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.
Fix isort
no-lines-before
preceded by an empty section (#3139)
Fix isort no-lines-before preceded by an empty section Fix #3138.
- Loading branch information
Showing
4 changed files
with
68 additions
and
4 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
crates/ruff/resources/test/fixtures/isort/no_lines_before_with_empty_sections.py
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from __future__ import annotations | ||
from typing import Any | ||
from . import my_local_folder_object |
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
22 changes: 22 additions & 0 deletions
22
...tests__no_lines_before_with_empty_sections.py_no_lines_before_with_empty_sections.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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
source: crates/ruff/src/rules/isort/mod.rs | ||
expression: diagnostics | ||
--- | ||
- kind: | ||
UnsortedImports: ~ | ||
location: | ||
row: 1 | ||
column: 0 | ||
end_location: | ||
row: 4 | ||
column: 0 | ||
fix: | ||
content: "from __future__ import annotations\nfrom typing import Any\n\nfrom . import my_local_folder_object\n" | ||
location: | ||
row: 1 | ||
column: 0 | ||
end_location: | ||
row: 4 | ||
column: 0 | ||
parent: ~ | ||
|