-
Notifications
You must be signed in to change notification settings - Fork 883
/
ruff_linter__rules__ruff__tests__RUF028_RUF028.py.snap
214 lines (191 loc) · 5.08 KB
/
ruff_linter__rules__ruff__tests__RUF028_RUF028.py.snap
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
---
source: crates/ruff_linter/src/rules/ruff/mod.rs
---
RUF028.py:3:9: RUF028 [*] This suppression comment is invalid because it cannot be in an expression, pattern, argument list, or other non-statement
|
1 | def fmt_off_between_lists():
2 | test_list = [
3 | # fmt: off
| ^^^^^^^^^^ RUF028
4 | 1,
5 | 2,
|
= help: Remove this comment
ℹ Unsafe fix
1 1 | def fmt_off_between_lists():
2 2 | test_list = [
3 |- # fmt: off
4 3 | 1,
5 4 | 2,
6 5 | 3,
RUF028.py:12:5: RUF028 [*] This suppression comment is invalid because it cannot be on its own line
|
10 | # note: the second `fmt: skip`` should be OK
11 | def fmt_skip_on_own_line():
12 | # fmt: skip
| ^^^^^^^^^^^ RUF028
13 | pass # fmt: skip
|
= help: Remove this comment
ℹ Unsafe fix
9 9 |
10 10 | # note: the second `fmt: skip`` should be OK
11 11 | def fmt_skip_on_own_line():
12 |- # fmt: skip
13 12 | pass # fmt: skip
14 13 |
15 14 |
RUF028.py:17:1: RUF028 [*] This suppression comment is invalid because it cannot be after a decorator
|
16 | @fmt_skip_on_own_line
17 | # fmt: off
| ^^^^^^^^^^ RUF028
18 | @fmt_off_between_lists
19 | def fmt_off_between_decorators():
|
= help: Remove this comment
ℹ Unsafe fix
14 14 |
15 15 |
16 16 | @fmt_skip_on_own_line
17 |-# fmt: off
18 17 | @fmt_off_between_lists
19 18 | def fmt_off_between_decorators():
20 19 | pass
RUF028.py:24:1: RUF028 [*] This suppression comment is invalid because it cannot be after a decorator
|
23 | @fmt_off_between_decorators
24 | # fmt: off
| ^^^^^^^^^^ RUF028
25 | class FmtOffBetweenClassDecorators:
26 | ...
|
= help: Remove this comment
ℹ Unsafe fix
21 21 |
22 22 |
23 23 | @fmt_off_between_decorators
24 |-# fmt: off
25 24 | class FmtOffBetweenClassDecorators:
26 25 | ...
27 26 |
RUF028.py:33:5: RUF028 [*] This suppression comment is invalid because it cannot be directly above an alternate body
|
31 | for val in x:
32 | print(x)
33 | # fmt: off
| ^^^^^^^^^^ RUF028
34 | else:
35 | print("done")
|
= help: Remove this comment
ℹ Unsafe fix
30 30 | x = [1, 2, 3]
31 31 | for val in x:
32 32 | print(x)
33 |- # fmt: off
34 33 | else:
35 34 | print("done")
36 35 | while False:
RUF028.py:39:5: RUF028 [*] This suppression comment is invalid because it cannot be directly above an alternate body
|
37 | print("while")
38 | # fmt: off
39 | # fmt: off
| ^^^^^^^^^^ RUF028
40 | else:
41 | print("done")
|
= help: Remove this comment
ℹ Unsafe fix
36 36 | while False:
37 37 | print("while")
38 38 | # fmt: off
39 |- # fmt: off
40 39 | else:
41 40 | print("done")
42 41 | if len(x) > 3:
RUF028.py:45:5: RUF028 [*] This suppression comment is invalid because it cannot be directly above an alternate body
|
43 | print("huh?")
44 | # fmt: on
45 | # fmt: off
| ^^^^^^^^^^ RUF028
46 | else:
47 | print("expected")
|
= help: Remove this comment
ℹ Unsafe fix
42 42 | if len(x) > 3:
43 43 | print("huh?")
44 44 | # fmt: on
45 |- # fmt: off
46 45 | else:
47 46 | print("expected")
48 47 |
RUF028.py:52:5: RUF028 [*] This suppression comment is invalid because it cannot be after a decorator
|
50 | class Test:
51 | @classmethod
52 | # fmt: off
| ^^^^^^^^^^ RUF028
53 | def cls_method_a(
54 | # fmt: off
|
= help: Remove this comment
ℹ Unsafe fix
49 49 |
50 50 | class Test:
51 51 | @classmethod
52 |- # fmt: off
53 52 | def cls_method_a(
54 53 | # fmt: off
55 54 | cls,
RUF028.py:54:9: RUF028 [*] This suppression comment is invalid because it cannot be in an expression, pattern, argument list, or other non-statement
|
52 | # fmt: off
53 | def cls_method_a(
54 | # fmt: off
| ^^^^^^^^^^ RUF028
55 | cls,
56 | ) -> None: # noqa: test # fmt: skip
|
= help: Remove this comment
ℹ Unsafe fix
51 51 | @classmethod
52 52 | # fmt: off
53 53 | def cls_method_a(
54 |- # fmt: off
55 54 | cls,
56 55 | ) -> None: # noqa: test # fmt: skip
57 56 | pass
RUF028.py:62:13: RUF028 [*] This suppression comment is invalid because it cannot be at the end of a line
|
60 | def fmt_on_trailing():
61 | # fmt: off
62 | val = 5 # fmt: on
| ^^^^^^^^^ RUF028
63 | pass # fmt: on
|
= help: Remove this comment
ℹ Unsafe fix
59 59 |
60 60 | def fmt_on_trailing():
61 61 | # fmt: off
62 |- val = 5 # fmt: on
62 |+ val = 5
63 63 | pass # fmt: on
RUF028.py:63:10: RUF028 [*] This suppression comment is invalid because it cannot be at the end of a line
|
61 | # fmt: off
62 | val = 5 # fmt: on
63 | pass # fmt: on
| ^^^^^^^^^ RUF028
|
= help: Remove this comment
ℹ Unsafe fix
60 60 | def fmt_on_trailing():
61 61 | # fmt: off
62 62 | val = 5 # fmt: on
63 |- pass # fmt: on
63 |+ pass