diff options
author | Florent Xicluna <florent.xicluna@gmail.com> | 2013-06-15 16:57:26 +0200 |
---|---|---|
committer | Florent Xicluna <florent.xicluna@gmail.com> | 2013-06-15 16:57:26 +0200 |
commit | e0d2d95291b46ddde20dc3658ad6d11b76a43f6f (patch) | |
tree | 2fe55531d45ac406953863d4402f3112bc12c890 | |
parent | 03242a7e8d1a59a2431fa5577481cd4cfebfe4bd (diff) | |
download | pep8-e0d2d95291b46ddde20dc3658ad6d11b76a43f6f.tar.gz |
Fix false positive E121 with multiple brackets; issue #203
-rw-r--r-- | CHANGES.txt | 2 | ||||
-rwxr-xr-x | pep8.py | 3 | ||||
-rw-r--r-- | testsuite/E12not.py | 14 |
3 files changed, 18 insertions, 1 deletions
diff --git a/CHANGES.txt b/CHANGES.txt index 6e467d3..0600040 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -26,6 +26,8 @@ Changelog * Fix E122 not detected in some cases. (Issue #201) +* Fix false positive E121 with multiple brackets. (Issue #203) + 1.4.5 (2013-03-06) ------------------ @@ -535,6 +535,7 @@ def continued_indentation(logical_line, tokens, indent_level, noqa, verbose): for idx in range(row, -1, -1): if parens[idx]: parens[idx] -= 1 + rel_indent[row] = rel_indent[idx] break assert len(indent) == depth + 1 if start[1] not in indent_chances: @@ -543,7 +544,7 @@ def continued_indentation(logical_line, tokens, indent_level, noqa, verbose): last_token_multiline = (start[0] != end[0]) - if indent_next and rel_indent[-1] == 4: + if indent_next and expand_indent(line) == indent_level + 4: yield (last_indent, "E125 continuation line does not distinguish " "itself from next logical line") diff --git a/testsuite/E12not.py b/testsuite/E12not.py index 7095744..c50f27f 100644 --- a/testsuite/E12not.py +++ b/testsuite/E12not.py @@ -564,4 +564,18 @@ result = some_function_that_takes_arguments('a', 'b', 'c', 'd', 'e', 'f', ) +# issue 203 +dica = { + ('abc' + 'def'): ( + 'abc'), +} + +(abcdef[0] + [1]) = ( + 'abc') + +('abc' + 'def') == ( + 'abc') # |