-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
07e0d31
commit 2f5c77c
Showing
3 changed files
with
139 additions
and
8 deletions.
There are no files selected for viewing
18 changes: 10 additions & 8 deletions
18
crates/ruff_linter/resources/test/fixtures/pylint/import_private_name.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 |
---|---|---|
@@ -1,8 +1,10 @@ | ||
import _private | ||
import _private as _p | ||
from _private import _private | ||
from lib import _private | ||
from lib import _private as _p | ||
from lib._private import _private | ||
from lib._private import _private as _p | ||
from lib._private import _private, _private as _p | ||
from __future__ import annotations # Ok | ||
|
||
import _private # PLC2701 | ||
import _private as _p # PLC2701 | ||
from _private import _private # PLC2701 | ||
from lib import _private # PLC2701 | ||
from lib import _private as _p # PLC2701 | ||
from lib._private import _private # PLC2701 | ||
from lib._private import _private as _p # PLC2701 | ||
from lib._private import _private, _private as _p # PLC2701 |
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
126 changes: 126 additions & 0 deletions
126
...lint/snapshots/ruff_linter__rules__pylint__tests__PLC2701_import_private_name.py.snap.new
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,126 @@ | ||
--- | ||
source: crates/ruff_linter/src/rules/pylint/mod.rs | ||
assertion_line: 172 | ||
--- | ||
import_private_name.py:3:8: PLC2701 Imported private module | ||
| | ||
1 | from __future__ import annotations # Ok | ||
2 | | ||
3 | import _private # PLC2701 | ||
| ^^^^^^^^ PLC2701 | ||
4 | import _private as _p # PLC2701 | ||
5 | from _private import _private # PLC2701 | ||
| | ||
|
||
import_private_name.py:4:8: PLC2701 Imported private module | ||
| | ||
3 | import _private # PLC2701 | ||
4 | import _private as _p # PLC2701 | ||
| ^^^^^^^^ PLC2701 | ||
5 | from _private import _private # PLC2701 | ||
6 | from lib import _private # PLC2701 | ||
| | ||
|
||
import_private_name.py:5:6: PLC2701 Imported private module | ||
| | ||
3 | import _private # PLC2701 | ||
4 | import _private as _p # PLC2701 | ||
5 | from _private import _private # PLC2701 | ||
| ^^^^^^^^ PLC2701 | ||
6 | from lib import _private # PLC2701 | ||
7 | from lib import _private as _p # PLC2701 | ||
| | ||
|
||
import_private_name.py:5:22: PLC2701 Imported private object | ||
| | ||
3 | import _private # PLC2701 | ||
4 | import _private as _p # PLC2701 | ||
5 | from _private import _private # PLC2701 | ||
| ^^^^^^^^ PLC2701 | ||
6 | from lib import _private # PLC2701 | ||
7 | from lib import _private as _p # PLC2701 | ||
| | ||
|
||
import_private_name.py:6:17: PLC2701 Imported private object | ||
| | ||
4 | import _private as _p # PLC2701 | ||
5 | from _private import _private # PLC2701 | ||
6 | from lib import _private # PLC2701 | ||
| ^^^^^^^^ PLC2701 | ||
7 | from lib import _private as _p # PLC2701 | ||
8 | from lib._private import _private # PLC2701 | ||
| | ||
|
||
import_private_name.py:7:17: PLC2701 Imported private object | ||
| | ||
5 | from _private import _private # PLC2701 | ||
6 | from lib import _private # PLC2701 | ||
7 | from lib import _private as _p # PLC2701 | ||
| ^^^^^^^^ PLC2701 | ||
8 | from lib._private import _private # PLC2701 | ||
9 | from lib._private import _private as _p # PLC2701 | ||
| | ||
|
||
import_private_name.py:8:6: PLC2701 Imported from private module | ||
| | ||
6 | from lib import _private # PLC2701 | ||
7 | from lib import _private as _p # PLC2701 | ||
8 | from lib._private import _private # PLC2701 | ||
| ^^^^^^^^^^^^ PLC2701 | ||
9 | from lib._private import _private as _p # PLC2701 | ||
10 | from lib._private import _private, _private as _p # PLC2701 | ||
| | ||
|
||
import_private_name.py:8:26: PLC2701 Imported private object | ||
| | ||
6 | from lib import _private # PLC2701 | ||
7 | from lib import _private as _p # PLC2701 | ||
8 | from lib._private import _private # PLC2701 | ||
| ^^^^^^^^ PLC2701 | ||
9 | from lib._private import _private as _p # PLC2701 | ||
10 | from lib._private import _private, _private as _p # PLC2701 | ||
| | ||
|
||
import_private_name.py:9:6: PLC2701 Imported from private module | ||
| | ||
7 | from lib import _private as _p # PLC2701 | ||
8 | from lib._private import _private # PLC2701 | ||
9 | from lib._private import _private as _p # PLC2701 | ||
| ^^^^^^^^^^^^ PLC2701 | ||
10 | from lib._private import _private, _private as _p # PLC2701 | ||
| | ||
|
||
import_private_name.py:9:26: PLC2701 Imported private object | ||
| | ||
7 | from lib import _private as _p # PLC2701 | ||
8 | from lib._private import _private # PLC2701 | ||
9 | from lib._private import _private as _p # PLC2701 | ||
| ^^^^^^^^ PLC2701 | ||
10 | from lib._private import _private, _private as _p # PLC2701 | ||
| | ||
|
||
import_private_name.py:10:6: PLC2701 Imported from private module | ||
| | ||
8 | from lib._private import _private # PLC2701 | ||
9 | from lib._private import _private as _p # PLC2701 | ||
10 | from lib._private import _private, _private as _p # PLC2701 | ||
| ^^^^^^^^^^^^ PLC2701 | ||
| | ||
|
||
import_private_name.py:10:26: PLC2701 Imported private object | ||
| | ||
8 | from lib._private import _private # PLC2701 | ||
9 | from lib._private import _private as _p # PLC2701 | ||
10 | from lib._private import _private, _private as _p # PLC2701 | ||
| ^^^^^^^^ PLC2701 | ||
| | ||
|
||
import_private_name.py:10:36: PLC2701 Imported private object | ||
| | ||
8 | from lib._private import _private # PLC2701 | ||
9 | from lib._private import _private as _p # PLC2701 | ||
10 | from lib._private import _private, _private as _p # PLC2701 | ||
| ^^^^^^^^ PLC2701 | ||
| | ||
|
||
|