---
source: crates/ruff_linter/src/rules/pylint/mod.rs
---
PLR0402 [*] Use `from os import path` in lieu of alias
  --> import_aliasing.py:9:8
   |
 7 | from collections import OrderedDict as OrderedDict  # [useless-import-alias]
 8 | from collections import OrderedDict as o_dict
 9 | import os.path as path  # [consider-using-from-import]
   |        ^^^^^^^^^^^^^^^
10 | import os.path as p
11 | import foo.bar.foobar as foobar  # [consider-using-from-import]
   |
help: Replace with `from os import path`
   |
8  | from collections import OrderedDict as o_dict
   - import os.path as path  # [consider-using-from-import]
9  + from os import path  # [consider-using-from-import]
10 | import os.path as p
   |

PLR0402 [*] Use `from foo.bar import foobar` in lieu of alias
  --> import_aliasing.py:11:8
   |
 9 | import os.path as path  # [consider-using-from-import]
10 | import os.path as p
11 | import foo.bar.foobar as foobar  # [consider-using-from-import]
   |        ^^^^^^^^^^^^^^^^^^^^^^^^
12 | import foo.bar.foobar as foobar, sys  # [consider-using-from-import]
13 | import os
   |
help: Replace with `from foo.bar import foobar`
   |
10 | import os.path as p
   - import foo.bar.foobar as foobar  # [consider-using-from-import]
11 + from foo.bar import foobar  # [consider-using-from-import]
12 | import foo.bar.foobar as foobar, sys  # [consider-using-from-import]
   |

PLR0402 Use `from foo.bar import foobar` in lieu of alias
  --> import_aliasing.py:12:8
   |
10 | import os.path as p
11 | import foo.bar.foobar as foobar  # [consider-using-from-import]
12 | import foo.bar.foobar as foobar, sys  # [consider-using-from-import]
   |        ^^^^^^^^^^^^^^^^^^^^^^^^
13 | import os
14 | import os as OS
   |
help: Replace with `from foo.bar import foobar`
