1
1
-- -
2
2
source : crates / ruff_linter / src / rules / flake8_pyi / mod .rs
3
- snapshot_kind : text
4
3
-- -
5
4
PYI033 .pyi :6 :22 : PYI033 Don ' t use type comments in stub file
6
5
|
7
- 4 | from typing import TypeAlias
8
- 5 |
9
- 6 | A : TypeAlias = None # type : int # Y033 Do not use type comments in stubs (e .g . use " x: int" instead of " x = ... # type: int" )
10
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PYI033
11
- 7 | B : TypeAlias = None # type : str # And here ' s an extra comment about why it' s that type # Y033 Do not use type comments in stubs (e .g . use " x: int " instead of " x = ... # type: int " )
12
- 8 | C : TypeAlias = None #type : int # Y033 Do not use type comments in stubs (e .g . use " x: int" instead of " x = ... # type: int" )
6
+ 4 | ... mport TypeAlias
7
+ 5 | ...
8
+ 6 | ... = None # type : int # Y033 Do not use type comments in stubs (e .g . use " x: int" instead of " x = ... # type: int" )
9
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PYI033
10
+ 7 | ... = None # type : str # And here ' s an extra comment about why it' s that type # Y033 Do not use type comments in stubs (e .g . use " x...
11
+ 8 | ... = None #type : int # Y033 Do not use type comments in stubs (e .g . use " x: int" instead of " x = ... # type: int" )
13
12
|
14
13
15
14
PYI033 .pyi :7 :22 : PYI033 Don ' t use type comments in stub file
16
15
|
17
- 6 | A : TypeAlias = None # type : int # Y033 Do not use type comments in stubs (e .g . use " x: int" instead of " x = ... # type: int" )
18
- 7 | B : TypeAlias = None # type : str # And here ' s an extra comment about why it' s that type # Y033 Do not use type comments in stubs (e .g . use " x: int" instead of " x = ... # type: int" )
19
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PYI033
20
- 8 | C : TypeAlias = None #type : int # Y033 Do not use type comments in stubs (e .g . use " x: int" instead of " x = ... # type: int" )
21
- 9 | D : TypeAlias = None # type : int # Y033 Do not use type comments in stubs (e .g . use " x: int" instead of " x = ... # type: int" )
16
+ 6 | ... e # type : int # Y033 Do not use type comments in stubs (e .g . use " x: int" instead of " x = ... # type: int" )
17
+ 7 | ... e # type : str # And here ' s an extra comment about why it' s that type # Y033 Do not use type comments in stubs (e .g . use " x: int" instead of " x = ... # type: int" )
18
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PYI033
19
+ 8 | ... e #type : int # Y033 Do not use type comments in stubs (e .g . use " x: int" instead of " x = ... # type: int" )
20
+ 9 | ... e # type : int # Y033 Do not use type comments in stubs (e .g . use " x: int" instead of " x = ... # type: int" )
22
21
|
23
22
24
23
PYI033 .pyi :8 :22 : PYI033 Don ' t use type comments in stub file
25
24
|
26
- 6 | A : TypeAlias = None # type : int # Y033 Do not use type comments in stubs (e .g . use " x: int" instead of " x = ... # type: int" )
27
- 7 | B : TypeAlias = None # type : str # And here ' s an extra comment about why it' s that type # Y033 Do not use type comments in stubs (e .g . use " x: int " instead of " x = ... # type: int " )
28
- 8 | C : TypeAlias = None #type : int # Y033 Do not use type comments in stubs (e .g . use " x: int" instead of " x = ... # type: int" )
29
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PYI033
30
- 9 | D : TypeAlias = None # type : int # Y033 Do not use type comments in stubs (e .g . use " x: int" instead of " x = ... # type: int" )
31
- 10 | E : TypeAlias = None # type : int # Y033 Do not use type comments in stubs (e .g . use " x: int" instead of " x = ... # type: int" )
25
+ 6 | ... = None # type : int # Y033 Do not use type comments in stubs (e .g . use " x: int" instead of " x = ... # type: int" )
26
+ 7 | ... = None # type : str # And here ' s an extra comment about why it' s that type # Y033 Do not use type comments in stubs (e .g . use " ...
27
+ 8 | ... = None #type : int # Y033 Do not use type comments in stubs (e .g . use " x: int" instead of " x = ... # type: int" )
28
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PYI033
29
+ 9 | ... = None # type : int # Y033 Do not use type comments in stubs (e .g . use " x: int" instead of " x = ... # type: int" )
30
+ 10 | ... = None # type : int # Y033 Do not use type comments in stubs (e .g . use " x: int" instead of " x = ... # type: int" )
32
31
|
33
32
34
33
PYI033 .pyi :9 :22 : PYI033 Don ' t use type comments in stub file
35
34
|
36
- 7 | B : TypeAlias = None # type : str # And here ' s an extra comment about why it' s that type # Y033 Do not use type comments in stubs (e .g . use " x: int " instead of " x = ... # type: int " )
37
- 8 | C : TypeAlias = None #type : int # Y033 Do not use type comments in stubs (e .g . use " x: int" instead of " x = ... # type: int" )
38
- 9 | D : TypeAlias = None # type : int # Y033 Do not use type comments in stubs (e .g . use " x: int" instead of " x = ... # type: int" )
39
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PYI033
40
- 10 | E : TypeAlias = None # type : int # Y033 Do not use type comments in stubs (e .g . use " x: int" instead of " x = ... # type: int" )
41
- 11 | F : TypeAlias = None #type :int # Y033 Do not use type comments in stubs (e .g . use " x: int" instead of " x = ... # type: int" )
35
+ 7 | ... one # type : str # And here ' s an extra comment about why it' s that type # Y033 Do not use type comments in stubs (e .g . use " x: ...
36
+ 8 | ... one #type : int # Y033 Do not use type comments in stubs (e .g . use " x: int" instead of " x = ... # type: int" )
37
+ 9 | ... one # type : int # Y033 Do not use type comments in stubs (e .g . use " x: int" instead of " x = ... # type: int" )
38
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PYI033
39
+ 10 | ... one # type : int # Y033 Do not use type comments in stubs (e .g . use " x: int" instead of " x = ... # type: int" )
40
+ 11 | ... one #type :int # Y033 Do not use type comments in stubs (e .g . use " x: int" instead of " x = ... # type: int" )
42
41
|
43
42
44
43
PYI033 .pyi :10 :20 : PYI033 Don ' t use type comments in stub file
@@ -56,43 +55,43 @@ PYI033.pyi:11:20: PYI033 Don't use type comments in stub file
56
55
10 | E : TypeAlias = None # type : int # Y033 Do not use type comments in stubs (e .g . use " x: int" instead of " x = ... # type: int" )
57
56
11 | F : TypeAlias = None #type :int # Y033 Do not use type comments in stubs (e .g . use " x: int" instead of " x = ... # type: int" )
58
57
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PYI033
59
- 12 |
58
+ 12 |
60
59
13 | def func (
61
60
|
62
61
63
62
PYI033 .pyi :14 :12 : PYI033 Don ' t use type comments in stub file
64
63
|
65
- 13 | def func (
66
- 14 | arg1 , # type : dict [str , int ] # Y033 Do not use type comments in stubs (e .g . use " x: int" instead of " x = ... # type: int" )
67
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PYI033
68
- 15 | arg2 # type : Sequence [bytes ] # And here ' s some more info about this arg # Y033 Do not use type comments in stubs (e.g. use "x: int" instead of "x = ... # type: int" )
69
- 16 | ): ...
64
+ 13 | ... nc (
65
+ 14 | ... g1 , # type : dict [str , int ] # Y033 Do not use type comments in stubs (e .g . use " x: int" instead of " x = ... # type: int" )
66
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PYI033
67
+ 15 | ... g2 # type : Sequence [bytes ] # And here ' s some more info about this arg # Y033 Do not use type comments in stubs (e.g. use "x: i ...
68
+ 16 | ...
70
69
|
71
70
72
71
PYI033 .pyi :15 :11 : PYI033 Don ' t use type comments in stub file
73
72
|
74
- 13 | def func (
75
- 14 | arg1 , # type : dict [str , int ] # Y033 Do not use type comments in stubs (e .g . use " x: int" instead of " x = ... # type: int" )
76
- 15 | arg2 # type : Sequence [bytes ] # And here ' s some more info about this arg # Y033 Do not use type comments in stubs (e.g. use "x: int" instead of "x = ... # type: int")
77
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PYI033
78
- 16 | ): ...
73
+ 13 | ... c (
74
+ 14 | .. .1 , # type : dict [str , int ] # Y033 Do not use type comments in stubs (e .g . use " x: int" instead of " x = ... # type: int" )
75
+ 15 | .. .2 # type : Sequence [bytes ] # And here ' s some more info about this arg # Y033 Do not use type comments in stubs (e.g. use "x: int" instead of "x = ... # type: int")
76
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PYI033
77
+ 16 | ...
79
78
|
80
79
81
80
PYI033 .pyi :19 :29 : PYI033 Don ' t use type comments in stub file
82
81
|
83
- 18 | class Foo :
84
- 19 | Attr : TypeAlias = None # type : set [str ] # Y033 Do not use type comments in stubs (e .g . use " x: int" instead of " x = ... # type: int" )
85
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PYI033
86
- 20 |
87
- 21 | G : TypeAlias = None # type : ignore
82
+ 18 | ...
83
+ 19 | ... one # type : set [str ] # Y033 Do not use type comments in stubs (e .g . use " x: int" instead of " x = ... # type: int" )
84
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PYI033
85
+ 20 | ...
86
+ 21 | ... type : ignore
88
87
|
89
88
90
89
PYI033 .pyi :29 :22 : PYI033 Don ' t use type comments in stub file
91
90
|
92
91
28 | # Whole line commented out # type : int
93
92
29 | M : TypeAlias = None # type : can ' t parse me!
94
93
| ^^^^^^^^^^^^^^^^^^^^^^^ PYI033
95
- 30 |
94
+ 30 |
96
95
31 | class Bar :
97
96
|
98
97
0 commit comments