-
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.
isort: Add support for the
from-first
setting (#8663)
# Summary This setting behaves similarly to the ``from_first`` setting in isort upstream, and sorts "from X import Y" type imports before straight imports. Like the other PR I added, happy to refactor if this is better in another form. Fixes #8662 # Test plan I've added a unit test, and ran this on a large codebase that relies on this setting in isort to verify it doesn't have unexpected side effects.
- Loading branch information
Showing
7 changed files
with
113 additions
and
11 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
crates/ruff_linter/resources/test/fixtures/isort/from_first.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,5 @@ | ||
from __future__ import blah | ||
|
||
from os import path | ||
|
||
import os |
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
4 changes: 4 additions & 0 deletions
4
...src/rules/isort/snapshots/ruff_linter__rules__isort__tests__from_first_from_first.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,4 @@ | ||
--- | ||
source: crates/ruff_linter/src/rules/isort/mod.rs | ||
--- | ||
|
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.