-
Notifications
You must be signed in to change notification settings - Fork 883
/
RUF028.py
63 lines (51 loc) · 975 Bytes
/
RUF028.py
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
def fmt_off_between_lists():
test_list = [
# fmt: off
1,
2,
3,
]
# note: the second `fmt: skip`` should be OK
def fmt_skip_on_own_line():
# fmt: skip
pass # fmt: skip
@fmt_skip_on_own_line
# fmt: off
@fmt_off_between_lists
def fmt_off_between_decorators():
pass
@fmt_off_between_decorators
# fmt: off
class FmtOffBetweenClassDecorators:
...
def fmt_off_in_else():
x = [1, 2, 3]
for val in x:
print(x)
# fmt: off
else:
print("done")
while False:
print("while")
# fmt: off
# fmt: off
else:
print("done")
if len(x) > 3:
print("huh?")
# fmt: on
# fmt: off
else:
print("expected")
class Test:
@classmethod
# fmt: off
def cls_method_a(
# fmt: off
cls,
) -> None: # noqa: test # fmt: skip
pass
def fmt_on_trailing():
# fmt: off
val = 5 # fmt: on
pass # fmt: on