diff options
author | Florent Xicluna <florent.xicluna@gmail.com> | 2012-12-09 22:42:12 +0100 |
---|---|---|
committer | Florent Xicluna <florent.xicluna@gmail.com> | 2012-12-09 22:42:12 +0100 |
commit | 46018e052ee8f2512370dbe22f153c0873a2325e (patch) | |
tree | 45767e9f55eb71b738b058aad1f1e630376c2b7a | |
parent | d825250fe45c0d2f48ada14e70b0f838c7b91ee0 (diff) | |
download | pep8-46018e052ee8f2512370dbe22f153c0873a2325e.tar.gz |
Fix E225 when operator is preceded by a comma; issue #135
-rw-r--r-- | CHANGES.txt | 4 | ||||
-rwxr-xr-x | pep8.py | 2 | ||||
-rw-r--r-- | testsuite/E12not.py | 2 | ||||
-rw-r--r-- | testsuite/E24.py | 5 |
4 files changed, 10 insertions, 3 deletions
diff --git a/CHANGES.txt b/CHANGES.txt index ed2af48..7f491c8 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -15,7 +15,9 @@ Changelog * Catch E271 at the beginning of the line. (Issue #133) -* Fix false positive E126. (Issue #138) +* Fix false positive E126 for multi-line comments. (Issue #138) + +* Fix false positive E221 when operator is preceded by a comma. (Issue #135) * Fix ``--diff`` failing on one-line hunk. (Issue #137) @@ -150,7 +150,7 @@ COMPARE_TYPE_REGEX = re.compile(r'([=!]=|is|is\s+not)\s*type(?:s\.(\w+)Type' r'|\(\s*(\(\s*\)|[^)]*[^ )])\s*\))') KEYWORD_REGEX = re.compile(r'(?:[^\s]|\b)(\s*)\b(?:%s)\b(\s*)' % r'|'.join(KEYWORDS)) -OPERATOR_REGEX = re.compile(r'(?:[^\s])(\s*)(?:[-+*/|!<=>%&^]+)(\s*)') +OPERATOR_REGEX = re.compile(r'(?:[^,\s])(\s*)(?:[-+*/|!<=>%&^]+)(\s*)') LAMBDA_REGEX = re.compile(r'\blambda\b') HUNK_REGEX = re.compile(r'^@@ -\d+(?:,\d+)? \+(\d+)(?:,(\d+))? @@.*$') diff --git a/testsuite/E12not.py b/testsuite/E12not.py index 9f9bef2..8802872 100644 --- a/testsuite/E12not.py +++ b/testsuite/E12not.py @@ -536,7 +536,7 @@ d = { # comment 1: 2 } -# issue #138 +# issue 138 [ 12, # this is a multi-line inline # comment diff --git a/testsuite/E24.py b/testsuite/E24.py index a93222c..9ca8e2b 100644 --- a/testsuite/E24.py +++ b/testsuite/E24.py @@ -6,3 +6,8 @@ b = (1, 20) a = (1, 2) # tab before 2 #: Okay b = (1, 20) # space before 20 +#: E241 +# issue 135 +more_spaces = [a, b, + ef, +h, + c, -d] |