summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Vilain <svilain@saymedia.com>2012-06-06 13:53:57 -0700
committerSam Vilain <svilain@saymedia.com>2012-06-06 14:22:02 -0700
commit484d7150ccd4d8b835619c17460fe07c30719ba8 (patch)
tree54f48dbaac0f64570c5ddc0c5fb393a694efc1e5
parentaff0ab72c7d0541339c3a880cd26d0ae7897bc0d (diff)
downloadpep8-484d7150ccd4d8b835619c17460fe07c30719ba8.tar.gz
make multi-line STRING % (foo, bar) work
There was existing support for placing a single format parameter on the next line, aligned with the start of the string. This extends this support to include multiple format parameters.
-rwxr-xr-xpep8.py5
-rw-r--r--testsuite/E12not.py12
2 files changed, 15 insertions, 2 deletions
diff --git a/pep8.py b/pep8.py
index b26b7da..ec6631a 100755
--- a/pep8.py
+++ b/pep8.py
@@ -525,8 +525,9 @@ def continuation_line_indentation(logical_line, tokens, indent_level):
is_not_hanging = not (hang == 4 or
(indent_next and rel_indent[row] == 8))
- if token_type != tokenize.OP and start[1] == indent_string:
- # Indented string with implicit concatenation
+ if ((token_type == tokenize.OP and text == '(') or
+ token_type != tokenize.OP) and start[1] == indent_string:
+ # Indented string with implicit concatenation. OK
pass
elif token_type == tokenize.OP and text in ']})':
# This line starts with a closing bracket
diff --git a/testsuite/E12not.py b/testsuite/E12not.py
index 73f5009..036438f 100644
--- a/testsuite/E12not.py
+++ b/testsuite/E12not.py
@@ -402,6 +402,18 @@ d = dict('foo',
"comma separated patterns (default: %s)" %
DEFAULT_EXCLUDE)
+d = dict('foo',
+ help="exclude files or directories which match these "
+ "comma separated patterns (default: %s, %s)" %
+ (DEFAULT_EXCLUDE, DEFAULT_IGNORE)
+ )
+
+d = dict('foo',
+ help="exclude files or directories which match these "
+ "comma separated patterns (default: %s, %s)" %
+ # who knows what might happen here?
+ (DEFAULT_EXCLUDE, DEFAULT_IGNORE)
+ )
# parens used to allow the indenting.
troublefree_hash = {