diff options
-rw-r--r-- | CHANGES.txt | 2 | ||||
-rwxr-xr-x | pep8.py | 2 | ||||
-rw-r--r-- | testsuite/E12not.py | 12 | ||||
-rw-r--r-- | testsuite/test_shell.py | 8 |
4 files changed, 20 insertions, 4 deletions
diff --git a/CHANGES.txt b/CHANGES.txt index 528cf0d..d710adf 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -5,7 +5,7 @@ Changelog 1.5.x (unreleased) ------------------ - +* Fix false positive E121/E126 with multi-line strings. (Issue #265) 1.5.1 (2014-03-27) @@ -556,6 +556,8 @@ def continued_indentation(logical_line, tokens, indent_level, hang_closing, indent_chances[start[1]] = text last_token_multiline = (start[0] != end[0]) + if last_token_multiline: + rel_indent[end[0] - first_row] = rel_indent[row] if indent_next and expand_indent(line) == indent_level + 4: if visual_indent: diff --git a/testsuite/E12not.py b/testsuite/E12not.py index 733b424..a53d9a4 100644 --- a/testsuite/E12not.py +++ b/testsuite/E12not.py @@ -632,3 +632,15 @@ some_hash = { else 0, } # +from textwrap import dedent + + +print dedent( + ''' + mkdir -p ./{build}/ + mv ./build/ ./{build}/%(revision)s/ + '''.format( + build='build', + # more stuff + ) +) diff --git a/testsuite/test_shell.py b/testsuite/test_shell.py index 0313c0c..66d4174 100644 --- a/testsuite/test_shell.py +++ b/testsuite/test_shell.py @@ -82,9 +82,11 @@ class ShellTestCase(unittest.TestCase): self.assertEqual(x, str(num)) self.assertEqual(y, str(col)) self.assertTrue(msg.startswith(' E11')) - # Config file read from the pep8's tox.ini - (config_filename,) = self._config_filenames - self.assertTrue(config_filename.endswith('tox.ini')) + # Config file read from the pep8's setup.cfg or tox.ini + config_filenames = self._config_filenames + self.assertEqual(len(config_filenames), 2) + self.assertTrue(config_filenames[0].endswith('setup.cfg')) + self.assertTrue(config_filenames[1].endswith('tox.ini')) def test_check_stdin(self): pep8.PROJECT_CONFIG = () |