-
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.
…13601) ## Summary Resolves #9962 by allowing a configuration setting `allowed-unused-imports` TODO: - [x] Figure out the correct name and place for the setting; currently, I have added it top level. - [x] The comparison is pretty naive. I tried using `glob::Pattern` but couldn't get it to work in the configuration. - [x] Add tests - [x] Update documentations ## Test Plan `cargo test`
- Loading branch information
Showing
9 changed files
with
132 additions
and
4 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
12 changes: 12 additions & 0 deletions
12
crates/ruff_linter/resources/test/fixtures/pyflakes/F401_31.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,12 @@ | ||
""" | ||
Test: allowed-unused-imports | ||
""" | ||
|
||
# OK | ||
import hvplot.pandas | ||
import hvplot.pandas.plots | ||
from hvplot.pandas import scatter_matrix | ||
from hvplot.pandas.plots import scatter_matrix | ||
|
||
# Errors | ||
from hvplot.pandas_alias import scatter_matrix |
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
16 changes: 16 additions & 0 deletions
16
...es/snapshots/ruff_linter__rules__pyflakes__tests__f401_allowed_unused_imports_option.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,16 @@ | ||
--- | ||
source: crates/ruff_linter/src/rules/pyflakes/mod.rs | ||
--- | ||
F401_31.py:12:33: F401 [*] `hvplot.pandas_alias.scatter_matrix` imported but unused | ||
| | ||
11 | # Errors | ||
12 | from hvplot.pandas_alias import scatter_matrix | ||
| ^^^^^^^^^^^^^^ F401 | ||
| | ||
= help: Remove unused import: `hvplot.pandas_alias.scatter_matrix` | ||
|
||
ℹ Safe fix | ||
9 9 | from hvplot.pandas.plots import scatter_matrix | ||
10 10 | | ||
11 11 | # Errors | ||
12 |-from hvplot.pandas_alias import scatter_matrix |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.