diff options
author | Florent Xicluna <florent.xicluna@gmail.com> | 2013-06-16 20:09:03 +0200 |
---|---|---|
committer | Florent Xicluna <florent.xicluna@gmail.com> | 2013-06-16 20:09:03 +0200 |
commit | f30786feade0cf3dcbf5d248a3de70ff6bffa5ad (patch) | |
tree | eb81315c2860ee46ff1f77e1d30e6492e52623cd | |
parent | 6a178441b691eeb6bf4179b4253565979f309c79 (diff) | |
download | pep8-f30786feade0cf3dcbf5d248a3de70ff6bffa5ad.tar.gz |
Another E122 not detected
-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', + ]) #: |