-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
ruleImplementing or modifying a lint ruleImplementing or modifying a lint rule
Description
Summary
unconventional-import-alias (ICN001) and possibly banned-import-alias (ICN002) are missing some conventions enforced by the upstream flake8-import-conventions.
For ICN001, plotly.graph_objects should be imported as go and statsmodels.api should be imported as sm.
For ICN002, geopandas should not be imported as gpd. Actually, flake8-import-conventions enforces that it not be aliased at all, but Ruff doesn’t support that. The specific alias that prompted the upstream rule is gpd, banning which is the closest Ruff can get.
$ cat >icn.py <<'# EOF'
import geopandas as gpd
import plotly.graph_objects
import statsmodels.api
# EOF
$ ruff --isolated check icn.py --select ICN001,ICN002
All checks passed!
$ flake8 --select IC icn.py
icn.py:1:1: IC002 geopandas should be imported as `import geopandas`
icn.py:2:1: IC008 plotly.graph_objects should be imported as `import plotly.graph_objects as go`
icn.py:3:1: IC010 statsmodels.api should be imported as `import statsmodels.api as sm`Version
ruff 0.14.3 (8737a2d 2025-10-30)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
ruleImplementing or modifying a lint ruleImplementing or modifying a lint rule