Debian Codegraph @

tests/data/cases/fmtskip_in_clause.py

raw
1 # Single fmt: skip in multi-part if-clause
2 class ClassWithALongName:
3 Constant1 = 1
4 Constant2 = 2
5 Constant3 = 3
6
7
8 def test():
9 if (
10 "cond1" == "cond1"
11 and "cond2" == "cond2"
12 and 1 in ( # fmt: skip
13 ClassWithALongName.Constant1,
14 ClassWithALongName.Constant2,
15 ClassWithALongName.Constant3,
16 )
17 ):
18 return True
19 return False
20
21
22 # output
23
24
25 # Single fmt: skip in multi-part if-clause
26 class ClassWithALongName:
27 Constant1 = 1
28 Constant2 = 2
29 Constant3 = 3
30
31
32 def test():
33 if (
34 "cond1" == "cond1"
35 and "cond2" == "cond2"
36 and 1 in ( # fmt: skip
37 ClassWithALongName.Constant1,
38 ClassWithALongName.Constant2,
39 ClassWithALongName.Constant3,
40 )
41 ):
42 return True
43 return False