mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-02 14:52:01 +00:00
25 lines
No EOL
611 B
Markdown
25 lines
No EOL
611 B
Markdown
# unconventional-import-alias (ICN001)
|
|
|
|
Derived from the **flake8-import-conventions** linter.
|
|
|
|
### What it does
|
|
Checks for imports that are typically imported using a common convention,
|
|
like `import pandas as pd`, and enforces that convention.
|
|
|
|
### Why is this bad?
|
|
Consistency is good. Use a common convention for imports to make your code
|
|
more readable and idiomatic.
|
|
|
|
For example, `import pandas as pd` is a common
|
|
convention for importing the `pandas` library, and users typically expect
|
|
Pandas to be aliased as `pd`.
|
|
|
|
### Example
|
|
```python
|
|
import pandas
|
|
```
|
|
|
|
Use instead:
|
|
```python
|
|
import pandas as pd
|
|
``` |