Skip to content

Commit 0a10f3c

Browse files
committed
Do not allow newline after parameter equal; issue #252
1 parent 9283cce commit 0a10f3c

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

CHANGES.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ Changelog
77

88
Changes:
99

10+
* Do not allow newline after parameter equal. (Issue #252)
11+
1012
* Distribute a universal wheel file.
1113

1214
Bug fixes:

pep8.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -761,6 +761,8 @@ def whitespace_around_named_parameter_equals(logical_line, tokens):
761761
prev_end = None
762762
message = "E251 unexpected spaces around keyword / parameter equals"
763763
for token_type, text, start, end, line in tokens:
764+
if token_type == tokenize.NL:
765+
continue
764766
if no_space:
765767
no_space = False
766768
if start != prev_end:

testsuite/E25.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ def foo(bar = False):
1010
foo(bar = True)
1111
#: E251
1212
y = bar(root= "sdasd")
13+
#: E251:2:29
14+
parser.add_argument('--long-option',
15+
default=
16+
"/rather/long/filesystem/path/here/blah/blah/blah")
17+
#: E251:1:45
18+
parser.add_argument('--long-option', default
19+
="/rather/long/filesystem/path/here/blah/blah/blah")
1320
#: Okay
1421
foo(bar=(1 == 1))
1522
foo(bar=(1 != 1))

0 commit comments

Comments
 (0)