Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fix issue 117 #118

Closed
wants to merge 2 commits into from

2 participants

@JensRantil

Fixing an issue where pep8 identified a single statement ending with a semicolon, as being multiple statements. This fixes issue #117.

JensRantil added some commits
@JensRantil JensRantil Adding test case for issue #117
An `E702` is raised when it should not for statements that end with a
semicolon.

Tests currently fail.

[skip ci]
e38f7c5
@JensRantil JensRantil Fixing failing test for semicolon ended stmts 3abd9e8
@florentx
Owner

This case should still raise an error.

@florentx
Owner

incomplete patch

@florentx florentx closed this
@JensRantil

@florentx Would you accept the patch if I come up with a new error? E703 statement ends with a semicolon?

@florentx
Owner

yes, it could be accepted if this specific case is not lost in the wild

@florentx florentx reopened this
@florentx florentx closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 28, 2012
  1. @JensRantil

    Adding test case for issue #117

    JensRantil authored
    An `E702` is raised when it should not for statements that end with a
    semicolon.
    
    Tests currently fail.
    
    [skip ci]
  2. @JensRantil
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 0 deletions.
  1. +2 −0  pep8.py
View
2  pep8.py
@@ -847,6 +847,7 @@ def compound_statements(logical_line):
Okay: do_one()
Okay: do_two()
Okay: do_three()
+ Okay: do_four();
E701: if foo == 'blah': do_blah_thing()
E701: for x in lst: total += x
@@ -868,6 +869,7 @@ def compound_statements(logical_line):
before.count('(') <= before.count(')') and # (Python 3 annotation)
not LAMBDA_REGEX.search(before)): # lambda x: x
yield found, "E701 multiple statements on one line (colon)"
+ line = line.rstrip(';')
found = line.find(';')
if -1 < found:
yield found, "E702 multiple statements on one line (semicolon)"
Something went wrong with that request. Please try again.