Skip to content

Commit

Permalink
Update snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrugman committed Nov 10, 2024
1 parent 6d9d971 commit fdb876e
Show file tree
Hide file tree
Showing 4 changed files with 238 additions and 110 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ PYI016.py:57:5: PYI016 [*] Duplicate union member `set[int]`
|
= help: Remove duplicate union member `set[int]`

Safe fix
Unsafe fix
50 50 | field17: dict[int, int] # OK
51 51 |
52 52 | # Should emit in cases with newlines
Expand All @@ -407,7 +407,7 @@ PYI016.py:57:5: PYI016 [*] Duplicate union member `set[int]`
58 |- int # bar
59 |- ],
60 |-] # Error, newline and comment will not be emitted in message
53 |+field18: typing.Union[set[int]] # Error, newline and comment will not be emitted in message
53 |+field18: set[int] # Error, newline and comment will not be emitted in message
61 54 |
62 55 | # Should emit in cases with `typing.Union` instead of `|`
63 56 | field19: typing.Union[int, int] # Error
Expand All @@ -427,7 +427,7 @@ PYI016.py:63:28: PYI016 [*] Duplicate union member `int`
61 61 |
62 62 | # Should emit in cases with `typing.Union` instead of `|`
63 |-field19: typing.Union[int, int] # Error
63 |+field19: typing.Union[int] # Error
63 |+field19: int # Error
64 64 |
65 65 | # Should emit in cases with nested `typing.Union`
66 66 | field20: typing.Union[int, typing.Union[int, str]] # Error
Expand Down Expand Up @@ -487,7 +487,7 @@ PYI016.py:72:41: PYI016 [*] Duplicate union member `int`
70 70 |
71 71 | # Should emit only once in cases with multiple nested `typing.Union`
72 |-field22: typing.Union[int, typing.Union[int, typing.Union[int, int]]] # Error
72 |+field22: typing.Union[int] # Error
72 |+field22: int # Error
73 73 |
74 74 | # Should emit in cases with newlines
75 75 | field23: set[ # foo
Expand All @@ -507,7 +507,7 @@ PYI016.py:72:59: PYI016 [*] Duplicate union member `int`
70 70 |
71 71 | # Should emit only once in cases with multiple nested `typing.Union`
72 |-field22: typing.Union[int, typing.Union[int, typing.Union[int, int]]] # Error
72 |+field22: typing.Union[int] # Error
72 |+field22: int # Error
73 73 |
74 74 | # Should emit in cases with newlines
75 75 | field23: set[ # foo
Expand All @@ -527,7 +527,7 @@ PYI016.py:72:64: PYI016 [*] Duplicate union member `int`
70 70 |
71 71 | # Should emit only once in cases with multiple nested `typing.Union`
72 |-field22: typing.Union[int, typing.Union[int, typing.Union[int, int]]] # Error
72 |+field22: typing.Union[int] # Error
72 |+field22: int # Error
73 73 |
74 74 | # Should emit in cases with newlines
75 75 | field23: set[ # foo
Expand Down Expand Up @@ -569,7 +569,7 @@ PYI016.py:81:41: PYI016 [*] Duplicate union member `int`
79 79 | # duplicates of the outer `int`), but not three times (which would indicate that
80 80 | # we incorrectly re-checked the nested union).
81 |-field24: typing.Union[int, typing.Union[int, int]] # PYI016: Duplicate union member `int`
81 |+field24: typing.Union[int] # PYI016: Duplicate union member `int`
81 |+field24: int # PYI016: Duplicate union member `int`
82 82 |
83 83 | # Should emit twice (once for each `int` in the nested union, both of which are
84 84 | # duplicates of the outer `int`), but not three times (which would indicate that
Expand All @@ -590,7 +590,7 @@ PYI016.py:81:46: PYI016 [*] Duplicate union member `int`
79 79 | # duplicates of the outer `int`), but not three times (which would indicate that
80 80 | # we incorrectly re-checked the nested union).
81 |-field24: typing.Union[int, typing.Union[int, int]] # PYI016: Duplicate union member `int`
81 |+field24: typing.Union[int] # PYI016: Duplicate union member `int`
81 |+field24: int # PYI016: Duplicate union member `int`
82 82 |
83 83 | # Should emit twice (once for each `int` in the nested union, both of which are
84 84 | # duplicates of the outer `int`), but not three times (which would indicate that
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ PYI016.pyi:57:5: PYI016 [*] Duplicate union member `set[int]`
|
= help: Remove duplicate union member `set[int]`

Safe fix
Unsafe fix
50 50 | field17: dict[int, int] # OK
51 51 |
52 52 | # Should emit in cases with newlines
Expand All @@ -407,7 +407,7 @@ PYI016.pyi:57:5: PYI016 [*] Duplicate union member `set[int]`
58 |- int # bar
59 |- ],
60 |-] # Error, newline and comment will not be emitted in message
53 |+field18: typing.Union[set[int]] # Error, newline and comment will not be emitted in message
53 |+field18: set[int] # Error, newline and comment will not be emitted in message
61 54 |
62 55 | # Should emit in cases with `typing.Union` instead of `|`
63 56 | field19: typing.Union[int, int] # Error
Expand All @@ -427,7 +427,7 @@ PYI016.pyi:63:28: PYI016 [*] Duplicate union member `int`
61 61 |
62 62 | # Should emit in cases with `typing.Union` instead of `|`
63 |-field19: typing.Union[int, int] # Error
63 |+field19: typing.Union[int] # Error
63 |+field19: int # Error
64 64 |
65 65 | # Should emit in cases with nested `typing.Union`
66 66 | field20: typing.Union[int, typing.Union[int, str]] # Error
Expand Down Expand Up @@ -487,7 +487,7 @@ PYI016.pyi:72:41: PYI016 [*] Duplicate union member `int`
70 70 |
71 71 | # Should emit only once in cases with multiple nested `typing.Union`
72 |-field22: typing.Union[int, typing.Union[int, typing.Union[int, int]]] # Error
72 |+field22: typing.Union[int] # Error
72 |+field22: int # Error
73 73 |
74 74 | # Should emit in cases with newlines
75 75 | field23: set[ # foo
Expand All @@ -507,7 +507,7 @@ PYI016.pyi:72:59: PYI016 [*] Duplicate union member `int`
70 70 |
71 71 | # Should emit only once in cases with multiple nested `typing.Union`
72 |-field22: typing.Union[int, typing.Union[int, typing.Union[int, int]]] # Error
72 |+field22: typing.Union[int] # Error
72 |+field22: int # Error
73 73 |
74 74 | # Should emit in cases with newlines
75 75 | field23: set[ # foo
Expand All @@ -527,7 +527,7 @@ PYI016.pyi:72:64: PYI016 [*] Duplicate union member `int`
70 70 |
71 71 | # Should emit only once in cases with multiple nested `typing.Union`
72 |-field22: typing.Union[int, typing.Union[int, typing.Union[int, int]]] # Error
72 |+field22: typing.Union[int] # Error
72 |+field22: int # Error
73 73 |
74 74 | # Should emit in cases with newlines
75 75 | field23: set[ # foo
Expand Down Expand Up @@ -569,7 +569,7 @@ PYI016.pyi:81:41: PYI016 [*] Duplicate union member `int`
79 79 | # duplicates of the outer `int`), but not three times (which would indicate that
80 80 | # we incorrectly re-checked the nested union).
81 |-field24: typing.Union[int, typing.Union[int, int]] # PYI016: Duplicate union member `int`
81 |+field24: typing.Union[int] # PYI016: Duplicate union member `int`
81 |+field24: int # PYI016: Duplicate union member `int`
82 82 |
83 83 | # Should emit twice (once for each `int` in the nested union, both of which are
84 84 | # duplicates of the outer `int`), but not three times (which would indicate that
Expand All @@ -590,7 +590,7 @@ PYI016.pyi:81:46: PYI016 [*] Duplicate union member `int`
79 79 | # duplicates of the outer `int`), but not three times (which would indicate that
80 80 | # we incorrectly re-checked the nested union).
81 |-field24: typing.Union[int, typing.Union[int, int]] # PYI016: Duplicate union member `int`
81 |+field24: typing.Union[int] # PYI016: Duplicate union member `int`
81 |+field24: int # PYI016: Duplicate union member `int`
82 82 |
83 83 | # Should emit twice (once for each `int` in the nested union, both of which are
84 84 | # duplicates of the outer `int`), but not three times (which would indicate that
Expand Down Expand Up @@ -652,7 +652,7 @@ PYI016.pyi:89:41: PYI016 [*] Duplicate union member `int`
87 87 |
88 88 | # Should emit in cases with nested `typing.Union`
89 |-field26: typing.Union[typing.Union[int, int]] # PYI016: Duplicate union member `int`
89 |+field26: typing.Union[int] # PYI016: Duplicate union member `int`
89 |+field26: int # PYI016: Duplicate union member `int`
90 90 |
91 91 | # Should emit in cases with nested `typing.Union`
92 92 | field27: typing.Union[typing.Union[typing.Union[int, int]]] # PYI016: Duplicate union member `int`
Expand All @@ -672,7 +672,7 @@ PYI016.pyi:92:54: PYI016 [*] Duplicate union member `int`
90 90 |
91 91 | # Should emit in cases with nested `typing.Union`
92 |-field27: typing.Union[typing.Union[typing.Union[int, int]]] # PYI016: Duplicate union member `int`
92 |+field27: typing.Union[int] # PYI016: Duplicate union member `int`
92 |+field27: int # PYI016: Duplicate union member `int`
93 93 |
94 94 | # Should emit in cases with mixed `typing.Union` and `|`
95 95 | field28: typing.Union[int | int] # Error
Expand Down Expand Up @@ -712,7 +712,7 @@ PYI016.pyi:98:54: PYI016 [*] Duplicate union member `int`
96 96 |
97 97 | # Should emit twice in cases with multiple nested `typing.Union`
98 |-field29: typing.Union[int, typing.Union[typing.Union[int, int]]] # Error
98 |+field29: typing.Union[int] # Error
98 |+field29: int # Error
99 99 |
100 100 | # Should emit once in cases with multiple nested `typing.Union`
101 101 | field30: typing.Union[int, typing.Union[typing.Union[int, str]]] # Error
Expand All @@ -732,7 +732,7 @@ PYI016.pyi:98:59: PYI016 [*] Duplicate union member `int`
96 96 |
97 97 | # Should emit twice in cases with multiple nested `typing.Union`
98 |-field29: typing.Union[int, typing.Union[typing.Union[int, int]]] # Error
98 |+field29: typing.Union[int] # Error
98 |+field29: int # Error
99 99 |
100 100 | # Should emit once in cases with multiple nested `typing.Union`
101 101 | field30: typing.Union[int, typing.Union[typing.Union[int, str]]] # Error
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,103 +152,151 @@ PYI041.pyi:45:26: PYI041 [*] Use `float` instead of `int | float`
45 |+def f7(arg1: int, *args: float) -> None: ... # PYI041
46 46 |
47 47 |
48 48 | class Foo:
48 48 | def f8(

PYI041.pyi:51:24: PYI041 [*] Use `complex` instead of `int | float | complex`
PYI041.pyi:49:10: PYI041 [*] Use `complex` instead of `int | float | complex`
|
49 | def good(self, arg: int) -> None: ...
50 |
51 | def bad(self, arg: int | float | complex) -> None: ... # PYI041
48 | def f8(
49 | arg: Union[ # comment
| __________^
50 | | float, # another
51 | | complex, int]
| |_____________________^ PYI041
52 | ) -> None: ... # PYI041
|
= help: Remove duplicates

Safe fix
46 46 |
47 47 |
48 48 | def f8(
49 |- arg: Union[ # comment
50 |- float, # another
51 |- complex, int]
49 |+ arg: complex
52 50 | ) -> None: ... # PYI041
53 51 |
54 52 | def f9(

PYI041.pyi:56:9: PYI041 [*] Use `complex` instead of `int | float | complex`
|
54 | def f9(
55 | arg: (
56 | int | # comment
| _________^
57 | | float | # another
58 | | complex
| |_______________^ PYI041
59 | )
60 | ) -> None: ... # PYI041
|
= help: Remove duplicates

Safe fix
53 53 |
54 54 | def f9(
55 55 | arg: (
56 |- int | # comment
57 |- float | # another
58 56 | complex
59 57 | )
60 58 | ) -> None: ... # PYI041

PYI041.pyi:65:24: PYI041 [*] Use `complex` instead of `int | float | complex`
|
63 | def good(self, arg: int) -> None: ...
64 |
65 | def bad(self, arg: int | float | complex) -> None: ... # PYI041
| ^^^^^^^^^^^^^^^^^^^^^ PYI041
52 |
53 | def bad2(self, arg: int | Union[float, complex]) -> None: ... # PYI041
66 |
67 | def bad2(self, arg: int | Union[float, complex]) -> None: ... # PYI041
|
= help: Remove duplicates

Safe fix
48 48 | class Foo:
49 49 | def good(self, arg: int) -> None: ...
50 50 |
51 |- def bad(self, arg: int | float | complex) -> None: ... # PYI041
51 |+ def bad(self, arg: complex) -> None: ... # PYI041
52 52 |
53 53 | def bad2(self, arg: int | Union[float, complex]) -> None: ... # PYI041
54 54 |
62 62 | class Foo:
63 63 | def good(self, arg: int) -> None: ...
64 64 |
65 |- def bad(self, arg: int | float | complex) -> None: ... # PYI041
65 |+ def bad(self, arg: complex) -> None: ... # PYI041
66 66 |
67 67 | def bad2(self, arg: int | Union[float, complex]) -> None: ... # PYI041
68 68 |

PYI041.pyi:53:25: PYI041 [*] Use `complex` instead of `int | float | complex`
PYI041.pyi:67:25: PYI041 [*] Use `complex` instead of `int | float | complex`
|
51 | def bad(self, arg: int | float | complex) -> None: ... # PYI041
52 |
53 | def bad2(self, arg: int | Union[float, complex]) -> None: ... # PYI041
65 | def bad(self, arg: int | float | complex) -> None: ... # PYI041
66 |
67 | def bad2(self, arg: int | Union[float, complex]) -> None: ... # PYI041
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ PYI041
54 |
55 | def bad3(self, arg: Union[Union[float, complex], int]) -> None: ... # PYI041
68 |
69 | def bad3(self, arg: Union[Union[float, complex], int]) -> None: ... # PYI041
|
= help: Remove duplicates

Safe fix
50 50 |
51 51 | def bad(self, arg: int | float | complex) -> None: ... # PYI041
52 52 |
53 |- def bad2(self, arg: int | Union[float, complex]) -> None: ... # PYI041
53 |+ def bad2(self, arg: complex) -> None: ... # PYI041
54 54 |
55 55 | def bad3(self, arg: Union[Union[float, complex], int]) -> None: ... # PYI041
56 56 |
64 64 |
65 65 | def bad(self, arg: int | float | complex) -> None: ... # PYI041
66 66 |
67 |- def bad2(self, arg: int | Union[float, complex]) -> None: ... # PYI041
67 |+ def bad2(self, arg: complex) -> None: ... # PYI041
68 68 |
69 69 | def bad3(self, arg: Union[Union[float, complex], int]) -> None: ... # PYI041
70 70 |

PYI041.pyi:55:25: PYI041 [*] Use `complex` instead of `int | float | complex`
PYI041.pyi:69:25: PYI041 [*] Use `complex` instead of `int | float | complex`
|
53 | def bad2(self, arg: int | Union[float, complex]) -> None: ... # PYI041
54 |
55 | def bad3(self, arg: Union[Union[float, complex], int]) -> None: ... # PYI041
67 | def bad2(self, arg: int | Union[float, complex]) -> None: ... # PYI041
68 |
69 | def bad3(self, arg: Union[Union[float, complex], int]) -> None: ... # PYI041
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PYI041
56 |
57 | def bad4(self, arg: Union[float | complex, int]) -> None: ... # PYI041
70 |
71 | def bad4(self, arg: Union[float | complex, int]) -> None: ... # PYI041
|
= help: Remove duplicates

Safe fix
52 52 |
53 53 | def bad2(self, arg: int | Union[float, complex]) -> None: ... # PYI041
54 54 |
55 |- def bad3(self, arg: Union[Union[float, complex], int]) -> None: ... # PYI041
55 |+ def bad3(self, arg: complex) -> None: ... # PYI041
56 56 |
57 57 | def bad4(self, arg: Union[float | complex, int]) -> None: ... # PYI041
58 58 |
66 66 |
67 67 | def bad2(self, arg: int | Union[float, complex]) -> None: ... # PYI041
68 68 |
69 |- def bad3(self, arg: Union[Union[float, complex], int]) -> None: ... # PYI041
69 |+ def bad3(self, arg: complex) -> None: ... # PYI041
70 70 |
71 71 | def bad4(self, arg: Union[float | complex, int]) -> None: ... # PYI041
72 72 |

PYI041.pyi:57:25: PYI041 [*] Use `complex` instead of `int | float | complex`
PYI041.pyi:71:25: PYI041 [*] Use `complex` instead of `int | float | complex`
|
55 | def bad3(self, arg: Union[Union[float, complex], int]) -> None: ... # PYI041
56 |
57 | def bad4(self, arg: Union[float | complex, int]) -> None: ... # PYI041
69 | def bad3(self, arg: Union[Union[float, complex], int]) -> None: ... # PYI041
70 |
71 | def bad4(self, arg: Union[float | complex, int]) -> None: ... # PYI041
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ PYI041
58 |
59 | def bad5(self, arg: int | (float | complex)) -> None: ... # PYI041
72 |
73 | def bad5(self, arg: int | (float | complex)) -> None: ... # PYI041
|
= help: Remove duplicates

Safe fix
54 54 |
55 55 | def bad3(self, arg: Union[Union[float, complex], int]) -> None: ... # PYI041
56 56 |
57 |- def bad4(self, arg: Union[float | complex, int]) -> None: ... # PYI041
57 |+ def bad4(self, arg: complex) -> None: ... # PYI041
58 58 |
59 59 | def bad5(self, arg: int | (float | complex)) -> None: ... # PYI041
68 68 |
69 69 | def bad3(self, arg: Union[Union[float, complex], int]) -> None: ... # PYI041
70 70 |
71 |- def bad4(self, arg: Union[float | complex, int]) -> None: ... # PYI041
71 |+ def bad4(self, arg: complex) -> None: ... # PYI041
72 72 |
73 73 | def bad5(self, arg: int | (float | complex)) -> None: ... # PYI041

PYI041.pyi:59:25: PYI041 [*] Use `complex` instead of `int | float | complex`
PYI041.pyi:73:25: PYI041 [*] Use `complex` instead of `int | float | complex`
|
57 | def bad4(self, arg: Union[float | complex, int]) -> None: ... # PYI041
58 |
59 | def bad5(self, arg: int | (float | complex)) -> None: ... # PYI041
71 | def bad4(self, arg: Union[float | complex, int]) -> None: ... # PYI041
72 |
73 | def bad5(self, arg: int | (float | complex)) -> None: ... # PYI041
| ^^^^^^^^^^^^^^^^^^^^^^^ PYI041
|
= help: Remove duplicates

Safe fix
56 56 |
57 57 | def bad4(self, arg: Union[float | complex, int]) -> None: ... # PYI041
58 58 |
59 |- def bad5(self, arg: int | (float | complex)) -> None: ... # PYI041
59 |+ def bad5(self, arg: complex) -> None: ... # PYI041
70 70 |
71 71 | def bad4(self, arg: Union[float | complex, int]) -> None: ... # PYI041
72 72 |
73 |- def bad5(self, arg: int | (float | complex)) -> None: ... # PYI041
73 |+ def bad5(self, arg: complex) -> None: ... # PYI041
Loading

0 comments on commit fdb876e

Please sign in to comment.