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.
144144RERAISE_COMMA_REGEX = re .compile (r'raise\s+\w+\s*,.*,\s*\w+\s*$' )
145145ERRORCODE_REGEX = re .compile (r'\b[A-Z]\d{3}\b' )
146146DOCSTRING_REGEX = re .compile (r'u?r?["\']' )
147- EXTRANEOUS_WHITESPACE_REGEX = re .compile (r'[\[({] | [\]}),;]| : (?!=)' )
147+ EXTRANEOUS_WHITESPACE_REGEX = re .compile (r'[\[({][ \t]|[ \t] [\]}),;:] (?!=)' )
148148WHITESPACE_AFTER_COMMA_REGEX = re .compile (r'[,;:]\s*(?: |\t)' )
149149COMPARE_SINGLETON_REGEX = re .compile (r'(\bNone|\bFalse|\bTrue)?\s*([=!]=)'
150150 r'\s*(?(1)|(None|False|True))\b' )
@@ -471,7 +471,7 @@ def extraneous_whitespace(logical_line):
471471 text = match .group ()
472472 char = text .strip ()
473473 found = match .start ()
474- if text == char + ' ' :
474+ if text [ - 1 ]. isspace () :
475475 # assert char in '([{'
476476 yield found + 1 , "E201 whitespace after '%s'" % char
477477 elif line [found - 1 ] != ',' :
Original file line number Diff line number Diff line change 44spam (ham [ 1 ], {eggs : 2 })
55#: E201:1:15
66spam (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 })
713#: Okay
814spam (ham [1 ], {eggs : 2 })
915#:
1521spam (ham [1 ], {eggs : 2 })
1622#: E202:1:11
1723spam (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 })
1830#: Okay
1931spam (ham [1 ], {eggs : 2 })
2032
3951if x == 4 :
4052 print x , y
4153 x , y = y , x
54+ #: E203:1:10
55+ if x == 4 :
56+ print x , y
57+ x , y = y , x
4258#: E203:2:15 E702:2:16
4359if x == 4 :
4460 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
4564#: E203:3:13
4665if x == 4 :
4766 print x , y
4867 x , y = y , x
68+ #: E203:3:13
69+ if x == 4 :
70+ print x , y
71+ x , y = y , x
4972#: Okay
5073if x == 4 :
5174 print x , y
You can’t perform that action at this time.
0 commit comments