summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorent Xicluna <florent.xicluna@gmail.com>2014-04-04 00:22:38 +0200
committerFlorent Xicluna <florent.xicluna@gmail.com>2014-04-04 00:22:38 +0200
commit0a10f3ce45a25bbec3c64ec1eb46c13ed1386cf5 (patch)
treec49384d9a2c56538cf7807d7e271d673c1eb0722
parent9283cce1b5b2756d8f17784931fae4612c12b29b (diff)
downloadpep8-0a10f3ce45a25bbec3c64ec1eb46c13ed1386cf5.tar.gz
Do not allow newline after parameter equal; issue #252
-rw-r--r--CHANGES.txt2
-rwxr-xr-xpep8.py2
-rw-r--r--testsuite/E25.py7
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:
diff --git a/pep8.py b/pep8.py
index ba08b89..679eb8a 100755
--- a/pep8.py
+++ b/pep8.py
@@ -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))