File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,6 +22,8 @@ Changelog
2222
2323* Fix false positive E261/E262 when the file contains a BOM. (Issue #193)
2424
25+ * Fix E701, E702 and E703 not detected sometimes. (Issue #196)
26+
2527
26281.4.5 (2013-03-06)
2729------------------
Original file line number Diff line number Diff line change @@ -842,19 +842,21 @@ def compound_statements(logical_line):
842842 line = logical_line
843843 last_char = len (line ) - 1
844844 found = line .find (':' )
845- if - 1 < found < last_char :
845+ while - 1 < found < last_char :
846846 before = line [:found ]
847847 if (before .count ('{' ) <= before .count ('}' ) and # {'a': 1} (dict)
848848 before .count ('[' ) <= before .count (']' ) and # [1:2] (slice)
849849 before .count ('(' ) <= before .count (')' ) and # (Python 3 annotation)
850850 not LAMBDA_REGEX .search (before )): # lambda x: x
851851 yield found , "E701 multiple statements on one line (colon)"
852+ found = line .find (':' , found + 1 )
852853 found = line .find (';' )
853- if - 1 < found :
854+ while - 1 < found :
854855 if found < last_char :
855856 yield found , "E702 multiple statements on one line (semicolon)"
856857 else :
857858 yield found , "E703 statement ends with a semicolon"
859+ found = line .find (';' , found + 1 )
858860
859861
860862def explicit_line_join (logical_line , tokens ):
Original file line number Diff line number Diff line change 11#: E701
22if a : a = False
3+ #: E701
4+ if not header or header [:6 ] != 'bytes=' : return
35#: E702
46a = False ; b = True
57#: E702
68import bdist_egg ; bdist_egg .write_safety_flag (cmd .egg_info , safe )
79#: E703
810import shlex ;
11+ #: E702 E703
12+ del a [:]; a .append (42 );
913#:
You can’t perform that action at this time.
0 commit comments