File tree Expand file tree Collapse file tree 2 files changed +25
-2
lines changed Expand file tree Collapse file tree 2 files changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -144,7 +144,7 @@ def lru_cache(maxsize=128): # noqa as it's a fake implementation.
144
144
RERAISE_COMMA_REGEX = re .compile (r'raise\s+\w+\s*,.*,\s*\w+\s*$' )
145
145
ERRORCODE_REGEX = re .compile (r'\b[A-Z]\d{3}\b' )
146
146
DOCSTRING_REGEX = re .compile (r'u?r?["\']' )
147
- EXTRANEOUS_WHITESPACE_REGEX = re .compile (r'[\[({] | [\]}),;]| : (?!=)' )
147
+ EXTRANEOUS_WHITESPACE_REGEX = re .compile (r'[\[({][ \t]|[ \t] [\]}),;:] (?!=)' )
148
148
WHITESPACE_AFTER_COMMA_REGEX = re .compile (r'[,;:]\s*(?: |\t)' )
149
149
COMPARE_SINGLETON_REGEX = re .compile (r'(\bNone|\bFalse|\bTrue)?\s*([=!]=)'
150
150
r'\s*(?(1)|(None|False|True))\b' )
@@ -471,7 +471,7 @@ def extraneous_whitespace(logical_line):
471
471
text = match .group ()
472
472
char = text .strip ()
473
473
found = match .start ()
474
- if text == char + ' ' :
474
+ if text [ - 1 ]. isspace () :
475
475
# assert char in '([{'
476
476
yield found + 1 , "E201 whitespace after '%s'" % char
477
477
elif line [found - 1 ] != ',' :
Original file line number Diff line number Diff line change 4
4
spam (ham [ 1 ], {eggs : 2 })
5
5
#: E201:1:15
6
6
spam (ham [1 ], { eggs : 2 })
7
+ #: E201:1:6
8
+ spam ( ham [1 ], {eggs : 2 })
9
+ #: E201:1:10
10
+ spam (ham [ 1 ], {eggs : 2 })
11
+ #: E201:1:15
12
+ spam (ham [1 ], { eggs : 2 })
7
13
#: Okay
8
14
spam (ham [1 ], {eggs : 2 })
9
15
#:
15
21
spam (ham [1 ], {eggs : 2 })
16
22
#: E202:1:11
17
23
spam (ham [1 ], {eggs : 2 })
24
+ #: E202:1:23
25
+ spam (ham [1 ], {eggs : 2 } )
26
+ #: E202:1:22
27
+ spam (ham [1 ], {eggs : 2 })
28
+ #: E202:1:11
29
+ spam (ham [1 ], {eggs : 2 })
18
30
#: Okay
19
31
spam (ham [1 ], {eggs : 2 })
20
32
39
51
if x == 4 :
40
52
print x , y
41
53
x , y = y , x
54
+ #: E203:1:10
55
+ if x == 4 :
56
+ print x , y
57
+ x , y = y , x
42
58
#: E203:2:15 E702:2:16
43
59
if x == 4 :
44
60
print x , y ; x , y = y , x
61
+ #: E203:2:15 E702:2:16
62
+ if x == 4 :
63
+ print x , y ; x , y = y , x
45
64
#: E203:3:13
46
65
if x == 4 :
47
66
print x , y
48
67
x , y = y , x
68
+ #: E203:3:13
69
+ if x == 4 :
70
+ print x , y
71
+ x , y = y , x
49
72
#: Okay
50
73
if x == 4 :
51
74
print x , y
You can’t perform that action at this time.
0 commit comments