diff options
author | Florent Xicluna <florent.xicluna@gmail.com> | 2012-06-26 19:08:10 +0200 |
---|---|---|
committer | Florent Xicluna <florent.xicluna@gmail.com> | 2012-06-26 19:08:10 +0200 |
commit | 422ef3195d9d503e4efce1ff455987a345e2caa4 (patch) | |
tree | f6aaea6eeeda9e753392b146c79eecfc0c0f787b | |
parent | e2d1a987f146e000d4964f9df42aaeddd8c5489a (diff) | |
download | pep8-422ef3195d9d503e4efce1ff455987a345e2caa4.tar.gz |
Fix errors on E121 and E124; issue #92.
-rw-r--r-- | CHANGES.txt | 2 | ||||
-rwxr-xr-x | pep8.py | 2 | ||||
-rw-r--r-- | testsuite/E12.py | 15 | ||||
-rw-r--r-- | testsuite/E12not.py | 18 |
4 files changed, 36 insertions, 1 deletions
diff --git a/CHANGES.txt b/CHANGES.txt index f97f86c..ac55e32 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -5,6 +5,8 @@ Changelog 1.x (UNRELEASED) ---------------- +* Fix false positive for E121, and missed E124. (Issue #92) + * Set a sensible default path for config file on Windows. (Issue #95) * Allow ``verbose`` in the configuration file. (Issue #91) @@ -559,7 +559,7 @@ def continuation_line_indentation(logical_line, tokens, indent_level, verbose): (depth, start[1], indent[depth])) elif text in ')]}' and depth > 0: # parent indents should not be more than this one - prev_indent = indent.pop() + prev_indent = indent.pop() or last_indent[1] for d in range(depth): if indent[d] > prev_indent: indent[d] = 0 diff --git a/testsuite/E12.py b/testsuite/E12.py index ffd2dda..b02cea5 100644 --- a/testsuite/E12.py +++ b/testsuite/E12.py @@ -160,6 +160,21 @@ print "hello", ( part = set_mimetype(( a.get('mime_type', 'text')), 'default') +#: E124 +fooff(aaaa, + cca( + vvv, + dadd + ), fff, +) +#: E124 +fooff(aaaa, + ccaaa( + vvv, + dadd + ), + fff, +) #: E126 troublesome_hash = { "hash": "value", diff --git a/testsuite/E12not.py b/testsuite/E12not.py index f32a03e..d8bc030 100644 --- a/testsuite/E12not.py +++ b/testsuite/E12not.py @@ -157,7 +157,25 @@ foo = my.func({ "foo": "bar", }, "baz") + +# + +fooff(aaaa, + cca( + vvv, + dadd + ), fff, + ggg) + +fooff(aaaa, + abbb, + cca( + vvv, + aaa, + dadd), + "visual indentation is not a multiple of four",) # + if bar: return( start, 'E121 lines starting with a ' |