-
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.
implemented option lines-between-types for isort (#2762)
Fixes #2585 Add support for the isort option [lines_between_types](https://pycqa.github.io/isort/docs/configuration/options.html#lines-between-types)
- Loading branch information
Showing
8 changed files
with
140 additions
and
8 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
16 changes: 16 additions & 0 deletions
16
crates/ruff/resources/test/fixtures/isort/lines_between_types.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,16 @@ | ||
from __future__ import annotations | ||
|
||
import datetime | ||
import json | ||
|
||
|
||
from binascii import hexlify | ||
|
||
import requests | ||
|
||
|
||
from sanic import Sanic | ||
from loguru import Logger | ||
|
||
from . import config | ||
from .data import Data |
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 |
---|---|---|
|
@@ -3,4 +3,5 @@ line-length = 88 | |
|
||
[tool.ruff.isort] | ||
lines-after-imports = 3 | ||
lines-between-types = 2 | ||
known-local-folder = ["ruff"] |
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
39 changes: 39 additions & 0 deletions
39
...isort/snapshots/ruff__rules__isort__tests__lines_between_typeslines_between_types.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,39 @@ | ||
--- | ||
source: crates/ruff/src/rules/isort/mod.rs | ||
expression: diagnostics | ||
--- | ||
- kind: | ||
UnsortedImports: ~ | ||
location: | ||
row: 1 | ||
column: 0 | ||
end_location: | ||
row: 17 | ||
column: 0 | ||
fix: | ||
content: | ||
- from __future__ import annotations | ||
- "" | ||
- import datetime | ||
- import json | ||
- "" | ||
- "" | ||
- from binascii import hexlify | ||
- "" | ||
- import requests | ||
- "" | ||
- "" | ||
- from loguru import Logger | ||
- from sanic import Sanic | ||
- "" | ||
- from . import config | ||
- from .data import Data | ||
- "" | ||
location: | ||
row: 1 | ||
column: 0 | ||
end_location: | ||
row: 17 | ||
column: 0 | ||
parent: ~ | ||
|
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