-
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.
Avoid adding required imports to stub files (#3940)
- Loading branch information
1 parent
61200d2
commit eb0dd74
Showing
10 changed files
with
83 additions
and
10 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
crates/ruff/resources/test/fixtures/isort/required_imports/docstring.pyi
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 @@ | ||
"""Hello, world!""" | ||
|
||
x = 1 |
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
...s/isort/snapshots/ruff__rules__isort__tests__combined_required_imports_docstring.pyi.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/src/rules/isort/mod.rs | ||
--- | ||
|
4 changes: 4 additions & 0 deletions
4
...f/src/rules/isort/snapshots/ruff__rules__isort__tests__required_import_docstring.pyi.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/src/rules/isort/mod.rs | ||
--- | ||
|
4 changes: 4 additions & 0 deletions
4
.../src/rules/isort/snapshots/ruff__rules__isort__tests__required_imports_docstring.pyi.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/src/rules/isort/mod.rs | ||
--- | ||
|
19 changes: 19 additions & 0 deletions
19
...es/isort/snapshots/ruff__rules__isort__tests__straight_required_import_docstring.pyi.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,19 @@ | ||
--- | ||
source: crates/ruff/src/rules/isort/mod.rs | ||
--- | ||
docstring.pyi:1:1: I002 [*] Missing required import: `import os` | ||
| | ||
1 | """Hello, world!""" | ||
| I002 | ||
2 | | ||
3 | x = 1 | ||
| | ||
= help: Insert required import: `import os` | ||
|
||
ℹ Suggested fix | ||
1 1 | """Hello, world!""" | ||
2 |+import os | ||
2 3 | | ||
3 4 | x = 1 | ||
|
||
|
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