diff options
-rw-r--r-- | CHANGES.txt | 2 | ||||
-rwxr-xr-x | pep8.py | 5 | ||||
-rw-r--r-- | testsuite/E12.py | 8 |
3 files changed, 12 insertions, 3 deletions
diff --git a/CHANGES.txt b/CHANGES.txt index 2b55609..795c289 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -31,7 +31,7 @@ Changelog * Fix E701, E702 and E703 not detected sometimes. (Issue #196) -* Fix E122 not detected in some cases. (Issue #201) +* Fix E122 not detected in some cases. (Issue #201 and #208) * Fix false positive E121 with multiple brackets. (Issue #203) @@ -459,7 +459,8 @@ def continued_indentation(logical_line, tokens, indent_level, hang_closing, open_row = 0 hang = rel_indent[row] - rel_indent[open_row] close_bracket = (token_type == tokenize.OP and text in ']})') - visual_indent = not close_bracket and indent_chances.get(start[1]) + visual_indent = (not close_bracket and hang > 0 and + indent_chances.get(start[1])) if close_bracket and indent[depth]: # closing bracket for visual indent @@ -474,7 +475,7 @@ def continued_indentation(logical_line, tokens, indent_level, hang_closing, # visual indent is verified if not indent[depth]: indent[depth] = start[1] - elif hang > 0 and visual_indent in (text, str): + elif visual_indent in (text, str): # ignore token lined up with matching one from a previous line pass elif indent[depth] and start[1] < indent[depth]: diff --git a/testsuite/E12.py b/testsuite/E12.py index ba12381..e49dd7a 100644 --- a/testsuite/E12.py +++ b/testsuite/E12.py @@ -105,6 +105,14 @@ dictionary = [ "nested": yes(), }, ] +#: E122 +setup('', + scripts=[''], + classifiers=[ + 'Development Status :: 4 - Beta', + 'Environment :: Console', + 'Intended Audience :: Developers', + ]) #: |