diff options
author | Florent Xicluna <florent.xicluna@gmail.com> | 2014-04-04 00:22:38 +0200 |
---|---|---|
committer | Florent Xicluna <florent.xicluna@gmail.com> | 2014-04-04 00:22:38 +0200 |
commit | 0a10f3ce45a25bbec3c64ec1eb46c13ed1386cf5 (patch) | |
tree | c49384d9a2c56538cf7807d7e271d673c1eb0722 | |
parent | 9283cce1b5b2756d8f17784931fae4612c12b29b (diff) | |
download | pep8-0a10f3ce45a25bbec3c64ec1eb46c13ed1386cf5.tar.gz |
Do not allow newline after parameter equal; issue #252
-rw-r--r-- | CHANGES.txt | 2 | ||||
-rwxr-xr-x | pep8.py | 2 | ||||
-rw-r--r-- | testsuite/E25.py | 7 |
3 files changed, 11 insertions, 0 deletions
diff --git a/CHANGES.txt b/CHANGES.txt index 5457e26..7202819 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -7,6 +7,8 @@ Changelog Changes: +* Do not allow newline after parameter equal. (Issue #252) + * Distribute a universal wheel file. Bug fixes: @@ -761,6 +761,8 @@ def whitespace_around_named_parameter_equals(logical_line, tokens): prev_end = None message = "E251 unexpected spaces around keyword / parameter equals" for token_type, text, start, end, line in tokens: + if token_type == tokenize.NL: + continue if no_space: no_space = False if start != prev_end: diff --git a/testsuite/E25.py b/testsuite/E25.py index b8031ec..37d0d42 100644 --- a/testsuite/E25.py +++ b/testsuite/E25.py @@ -10,6 +10,13 @@ foo(bar =True) foo(bar = True) #: E251 y = bar(root= "sdasd") +#: E251:2:29 +parser.add_argument('--long-option', + default= + "/rather/long/filesystem/path/here/blah/blah/blah") +#: E251:1:45 +parser.add_argument('--long-option', default + ="/rather/long/filesystem/path/here/blah/blah/blah") #: Okay foo(bar=(1 == 1)) foo(bar=(1 != 1)) |