ruff/crates/ruff_linter/resources/test/fixtures/pyflakes/F401_31.py
Simon Høxbro Hansen 7ad07c2c5d
Add allow-unused-imports setting for unused-import rule (F401) (#13601)
## Summary
Resolves https://github.com/astral-sh/ruff/issues/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`
2024-10-03 19:44:44 +00:00

12 lines
236 B
Python

"""
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