-
Notifications
You must be signed in to change notification settings - Fork 943
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
40c75fb
commit 784eb52
Showing
4 changed files
with
176 additions
and
172 deletions.
There are no files selected for viewing
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
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
168 changes: 84 additions & 84 deletions
168
...c/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI062_PYI062.py.snap
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,138 +1,138 @@ | ||
--- | ||
source: crates/ruff_linter/src/rules/flake8_pyi/mod.rs | ||
--- | ||
PYI062.py:3:25: PYI062 Duplicate literal member `True` | ||
PYI062.py:5:25: PYI062 Duplicate literal member `True` | ||
| | ||
1 | from typing import Literal | ||
2 | | ||
3 | x: Literal[True, False, True, False] # PYI062 twice here | ||
| ^^^^ PYI062 | ||
4 | | ||
5 | y: Literal[1, print("hello"), 3, Literal[4, 1]] # PYI062 on the last 1 | ||
| | ||
|
||
PYI062.py:3:31: PYI062 Duplicate literal member `False` | ||
| | ||
1 | from typing import Literal | ||
2 | | ||
3 | x: Literal[True, False, True, False] # PYI062 twice here | ||
| ^^^^^ PYI062 | ||
3 | import typing_extensions | ||
4 | | ||
5 | y: Literal[1, print("hello"), 3, Literal[4, 1]] # PYI062 on the last 1 | ||
5 | x: Literal[True, False, True, False] # PYI062 twice here | ||
| ^^^^ PYI062 | ||
6 | | ||
7 | y: Literal[1, print("hello"), 3, Literal[4, 1]] # PYI062 on the last 1 | ||
| | ||
|
||
PYI062.py:5:45: PYI062 Duplicate literal member `1` | ||
PYI062.py:5:31: PYI062 Duplicate literal member `False` | ||
| | ||
3 | x: Literal[True, False, True, False] # PYI062 twice here | ||
3 | import typing_extensions | ||
4 | | ||
5 | y: Literal[1, print("hello"), 3, Literal[4, 1]] # PYI062 on the last 1 | ||
| ^ PYI062 | ||
5 | x: Literal[True, False, True, False] # PYI062 twice here | ||
| ^^^^^ PYI062 | ||
6 | | ||
7 | z: Literal[{1, 3, 5}, "foobar", {1,3,5}] # PYI062 on the set literal | ||
7 | y: Literal[1, print("hello"), 3, Literal[4, 1]] # PYI062 on the last 1 | ||
| | ||
|
||
PYI062.py:7:33: PYI062 Duplicate literal member `{1, 3, 5}` | ||
PYI062.py:7:45: PYI062 Duplicate literal member `1` | ||
| | ||
5 | y: Literal[1, print("hello"), 3, Literal[4, 1]] # PYI062 on the last 1 | ||
5 | x: Literal[True, False, True, False] # PYI062 twice here | ||
6 | | ||
7 | z: Literal[{1, 3, 5}, "foobar", {1,3,5}] # PYI062 on the set literal | ||
| ^^^^^^^ PYI062 | ||
7 | y: Literal[1, print("hello"), 3, Literal[4, 1]] # PYI062 on the last 1 | ||
| ^ PYI062 | ||
8 | | ||
9 | Literal[1, Literal[1]] # once | ||
9 | z: Literal[{1, 3, 5}, "foobar", {1,3,5}] # PYI062 on the set literal | ||
| | ||
|
||
PYI062.py:9:20: PYI062 Duplicate literal member `1` | ||
PYI062.py:9:33: PYI062 Duplicate literal member `{1, 3, 5}` | ||
| | ||
7 | z: Literal[{1, 3, 5}, "foobar", {1,3,5}] # PYI062 on the set literal | ||
7 | y: Literal[1, print("hello"), 3, Literal[4, 1]] # PYI062 on the last 1 | ||
8 | | ||
9 | Literal[1, Literal[1]] # once | ||
9 | z: Literal[{1, 3, 5}, "foobar", {1,3,5}] # PYI062 on the set literal | ||
| ^^^^^^^ PYI062 | ||
10 | | ||
11 | Literal[1, Literal[1]] # once | ||
| | ||
|
||
PYI062.py:11:20: PYI062 Duplicate literal member `1` | ||
| | ||
9 | z: Literal[{1, 3, 5}, "foobar", {1,3,5}] # PYI062 on the set literal | ||
10 | | ||
11 | Literal[1, Literal[1]] # once | ||
| ^ PYI062 | ||
10 | Literal[1, 2, Literal[1, 2]] # twice | ||
11 | Literal[1, Literal[1], Literal[1]] # twice | ||
12 | Literal[1, 2, Literal[1, 2]] # twice | ||
13 | Literal[1, Literal[1], Literal[1]] # twice | ||
| | ||
|
||
PYI062.py:10:23: PYI062 Duplicate literal member `1` | ||
PYI062.py:12:23: PYI062 Duplicate literal member `1` | ||
| | ||
9 | Literal[1, Literal[1]] # once | ||
10 | Literal[1, 2, Literal[1, 2]] # twice | ||
11 | Literal[1, Literal[1]] # once | ||
12 | Literal[1, 2, Literal[1, 2]] # twice | ||
| ^ PYI062 | ||
11 | Literal[1, Literal[1], Literal[1]] # twice | ||
12 | Literal[1, Literal[2], Literal[2]] # once | ||
13 | Literal[1, Literal[1], Literal[1]] # twice | ||
14 | Literal[1, Literal[2], Literal[2]] # once | ||
| | ||
|
||
PYI062.py:10:26: PYI062 Duplicate literal member `2` | ||
PYI062.py:12:26: PYI062 Duplicate literal member `2` | ||
| | ||
9 | Literal[1, Literal[1]] # once | ||
10 | Literal[1, 2, Literal[1, 2]] # twice | ||
11 | Literal[1, Literal[1]] # once | ||
12 | Literal[1, 2, Literal[1, 2]] # twice | ||
| ^ PYI062 | ||
11 | Literal[1, Literal[1], Literal[1]] # twice | ||
12 | Literal[1, Literal[2], Literal[2]] # once | ||
13 | Literal[1, Literal[1], Literal[1]] # twice | ||
14 | Literal[1, Literal[2], Literal[2]] # once | ||
| | ||
|
||
PYI062.py:11:20: PYI062 Duplicate literal member `1` | ||
PYI062.py:13:20: PYI062 Duplicate literal member `1` | ||
| | ||
9 | Literal[1, Literal[1]] # once | ||
10 | Literal[1, 2, Literal[1, 2]] # twice | ||
11 | Literal[1, Literal[1], Literal[1]] # twice | ||
11 | Literal[1, Literal[1]] # once | ||
12 | Literal[1, 2, Literal[1, 2]] # twice | ||
13 | Literal[1, Literal[1], Literal[1]] # twice | ||
| ^ PYI062 | ||
12 | Literal[1, Literal[2], Literal[2]] # once | ||
13 | Literal[1, Literal[2, Literal[1]]] # once | ||
14 | Literal[1, Literal[2], Literal[2]] # once | ||
15 | t.Literal[1, t.Literal[2, t.Literal[1]]] # once | ||
| | ||
|
||
PYI062.py:11:32: PYI062 Duplicate literal member `1` | ||
PYI062.py:13:32: PYI062 Duplicate literal member `1` | ||
| | ||
9 | Literal[1, Literal[1]] # once | ||
10 | Literal[1, 2, Literal[1, 2]] # twice | ||
11 | Literal[1, Literal[1], Literal[1]] # twice | ||
11 | Literal[1, Literal[1]] # once | ||
12 | Literal[1, 2, Literal[1, 2]] # twice | ||
13 | Literal[1, Literal[1], Literal[1]] # twice | ||
| ^ PYI062 | ||
12 | Literal[1, Literal[2], Literal[2]] # once | ||
13 | Literal[1, Literal[2, Literal[1]]] # once | ||
14 | Literal[1, Literal[2], Literal[2]] # once | ||
15 | t.Literal[1, t.Literal[2, t.Literal[1]]] # once | ||
| | ||
|
||
PYI062.py:12:32: PYI062 Duplicate literal member `2` | ||
PYI062.py:14:32: PYI062 Duplicate literal member `2` | ||
| | ||
10 | Literal[1, 2, Literal[1, 2]] # twice | ||
11 | Literal[1, Literal[1], Literal[1]] # twice | ||
12 | Literal[1, Literal[2], Literal[2]] # once | ||
12 | Literal[1, 2, Literal[1, 2]] # twice | ||
13 | Literal[1, Literal[1], Literal[1]] # twice | ||
14 | Literal[1, Literal[2], Literal[2]] # once | ||
| ^ PYI062 | ||
13 | Literal[1, Literal[2, Literal[1]]] # once | ||
14 | Literal[1, 1, 1] # twice | ||
15 | t.Literal[1, t.Literal[2, t.Literal[1]]] # once | ||
16 | typing_extensions.Literal[1, 1, 1] # twice | ||
| | ||
|
||
PYI062.py:13:31: PYI062 Duplicate literal member `1` | ||
PYI062.py:15:37: PYI062 Duplicate literal member `1` | ||
| | ||
11 | Literal[1, Literal[1], Literal[1]] # twice | ||
12 | Literal[1, Literal[2], Literal[2]] # once | ||
13 | Literal[1, Literal[2, Literal[1]]] # once | ||
| ^ PYI062 | ||
14 | Literal[1, 1, 1] # twice | ||
13 | Literal[1, Literal[1], Literal[1]] # twice | ||
14 | Literal[1, Literal[2], Literal[2]] # once | ||
15 | t.Literal[1, t.Literal[2, t.Literal[1]]] # once | ||
| ^ PYI062 | ||
16 | typing_extensions.Literal[1, 1, 1] # twice | ||
| | ||
|
||
PYI062.py:14:12: PYI062 Duplicate literal member `1` | ||
PYI062.py:16:30: PYI062 Duplicate literal member `1` | ||
| | ||
12 | Literal[1, Literal[2], Literal[2]] # once | ||
13 | Literal[1, Literal[2, Literal[1]]] # once | ||
14 | Literal[1, 1, 1] # twice | ||
| ^ PYI062 | ||
15 | | ||
16 | # Ensure issue is only raised once, even on nested literals | ||
14 | Literal[1, Literal[2], Literal[2]] # once | ||
15 | t.Literal[1, t.Literal[2, t.Literal[1]]] # once | ||
16 | typing_extensions.Literal[1, 1, 1] # twice | ||
| ^ PYI062 | ||
17 | | ||
18 | # Ensure issue is only raised once, even on nested literals | ||
| | ||
|
||
PYI062.py:14:15: PYI062 Duplicate literal member `1` | ||
PYI062.py:16:33: PYI062 Duplicate literal member `1` | ||
| | ||
12 | Literal[1, Literal[2], Literal[2]] # once | ||
13 | Literal[1, Literal[2, Literal[1]]] # once | ||
14 | Literal[1, 1, 1] # twice | ||
| ^ PYI062 | ||
15 | | ||
16 | # Ensure issue is only raised once, even on nested literals | ||
14 | Literal[1, Literal[2], Literal[2]] # once | ||
15 | t.Literal[1, t.Literal[2, t.Literal[1]]] # once | ||
16 | typing_extensions.Literal[1, 1, 1] # twice | ||
| ^ PYI062 | ||
17 | | ||
18 | # Ensure issue is only raised once, even on nested literals | ||
| | ||
|
||
PYI062.py:17:46: PYI062 Duplicate literal member `True` | ||
PYI062.py:19:46: PYI062 Duplicate literal member `True` | ||
| | ||
16 | # Ensure issue is only raised once, even on nested literals | ||
17 | MyType = Literal["foo", Literal[True, False, True], "bar"] # PYI062 | ||
18 | # Ensure issue is only raised once, even on nested literals | ||
19 | MyType = Literal["foo", Literal[True, False, True], "bar"] # PYI062 | ||
| ^^^^ PYI062 | ||
18 | | ||
19 | n: Literal["No", "duplicates", "here", 1, "1"] | ||
20 | | ||
21 | n: Literal["No", "duplicates", "here", 1, "1"] | ||
| |
Oops, something went wrong.