-
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.
- Loading branch information
1 parent
b7b155d
commit dba0f7f
Showing
12 changed files
with
161 additions
and
56 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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import os | ||
# This is a comment in the same section, so we need to add one newline. | ||
import sys | ||
import numpy as np | ||
# This is a comment, but it starts a new section, so we don't need to add a newline | ||
# before it. | ||
import leading_prefix |
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,4 @@ | ||
import a | ||
# Don't take this comment into account when determining whether the next import can fit on one line. | ||
from b import c | ||
from d import e # Do take this comment into account when determining whether the next import can fit on one line. |
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,11 @@ | ||
import io | ||
# Old MacDonald had a farm, | ||
# EIEIO | ||
# And on his farm he had a cow, | ||
# EIEIO | ||
# With a moo-moo here and a moo-moo there | ||
# Here a moo, there a moo, everywhere moo-moo | ||
# Old MacDonald had a farm, | ||
# EIEIO | ||
from errno import EIO | ||
import abc |
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
22 changes: 22 additions & 0 deletions
22
src/isort/snapshots/ruff__isort__tests__add_newline_before_comments.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: src/isort/mod.rs | ||
expression: checks | ||
--- | ||
- kind: UnsortedImports | ||
location: | ||
row: 1 | ||
column: 0 | ||
end_location: | ||
row: 8 | ||
column: 0 | ||
fix: | ||
patch: | ||
content: "import os\n\n# This is a comment in the same section, so we need to add one newline.\nimport sys\n\nimport numpy as np\n\n# This is a comment, but it starts a new section, so we don't need to add a newline\n# before it.\nimport leading_prefix\n" | ||
location: | ||
row: 1 | ||
column: 0 | ||
end_location: | ||
row: 8 | ||
column: 0 | ||
applied: false | ||
|
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
src/isort/snapshots/ruff__isort__tests__fit_line_length_comment.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: src/isort/mod.rs | ||
expression: checks | ||
--- | ||
- kind: UnsortedImports | ||
location: | ||
row: 1 | ||
column: 0 | ||
end_location: | ||
row: 5 | ||
column: 0 | ||
fix: | ||
patch: | ||
content: "import a\n\n# Don't take this comment into account when determining whether the next import can fit on one line.\nfrom b import c\nfrom d import ( # Do take this comment into account when determining whether the next import can fit on one line.\n e,\n)\n" | ||
location: | ||
row: 1 | ||
column: 0 | ||
end_location: | ||
row: 5 | ||
column: 0 | ||
applied: false | ||
|
22 changes: 22 additions & 0 deletions
22
src/isort/snapshots/ruff__isort__tests__preserve_comment_order.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: src/isort/mod.rs | ||
expression: checks | ||
--- | ||
- kind: UnsortedImports | ||
location: | ||
row: 1 | ||
column: 0 | ||
end_location: | ||
row: 12 | ||
column: 0 | ||
fix: | ||
patch: | ||
content: "import abc\nimport io\n\n# Old MacDonald had a farm,\n# EIEIO\n# And on his farm he had a cow,\n# EIEIO\n# With a moo-moo here and a moo-moo there\n# Here a moo, there a moo, everywhere moo-moo\n# Old MacDonald had a farm,\n# EIEIO\nfrom errno import EIO\n" | ||
location: | ||
row: 1 | ||
column: 0 | ||
end_location: | ||
row: 12 | ||
column: 0 | ||
applied: false | ||
|
Oops, something went wrong.