Skip to content

Commit 1a26f6f

Browse files
committed
Merge pull request #353 from jcrocholl/issue319
Merged. Going to close the alternate PR, #333.
2 parents e73ce7d + 497f1db commit 1a26f6f

File tree

4 files changed

+22
-8
lines changed

4 files changed

+22
-8
lines changed

CHANGES.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ Bug fixes:
4343

4444
* Fix false positive E711/E712/E713. (Issues #330 and #336)
4545

46+
* Do not skip physical checks if the newline is escaped. (Issue #319)
47+
4648

4749
1.5.7 (2014-05-29)
4850
------------------

pep8.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1238,14 +1238,12 @@ def filename_match(filename, patterns, default=True):
12381238
return any(fnmatch(filename, pattern) for pattern in patterns)
12391239

12401240

1241+
def _is_eol_token(token):
1242+
return token[0] in NEWLINE or token[4][token[3][1]:].lstrip() == '\\\n'
12411243
if COMMENT_WITH_NL:
1242-
def _is_eol_token(token):
1243-
return (token[0] in NEWLINE or
1244-
(token[0] == tokenize.COMMENT and token[1] == token[4]))
1245-
else:
1246-
def _is_eol_token(token):
1247-
return token[0] in NEWLINE
1248-
1244+
def _is_eol_token(token, _eol_token=_is_eol_token):
1245+
return _eol_token(token) or (token[0] == tokenize.COMMENT and
1246+
token[1] == token[4])
12491247

12501248
##############################################################################
12511249
# Framework to run all checks

testsuite/E50.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
#: E501
22
a = '12345678901234567890123456789012345678901234567890123456789012345678901234567890'
3+
#: E501
4+
a = '1234567890123456789012345678901234567890123456789012345678901234567890' or \
5+
6
6+
#: E501
7+
a = 7 or \
8+
'1234567890123456789012345678901234567890123456789012345678901234567890' or \
9+
6
10+
#: E501 E501
11+
a = 7 or \
12+
'1234567890123456789012345678901234567890123456789012345678901234567890' or \
13+
'1234567890123456789012345678901234567890123456789012345678901234567890' or \
14+
6
15+
#: E501
16+
a = '1234567890123456789012345678901234567890123456789012345678901234567890' # \
317
#: E502
418
a = ('123456789012345678901234567890123456789012345678901234567890123456789' \
519
'01234567890')

testsuite/W19.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def long_function_name(
8686
b == """abc def ghi
8787
jkl mno"""):
8888
return True
89-
#: E101 W191
89+
#: W191:2:1 W191:3:1 E101:3:2
9090
if length > options.max_line_length:
9191
return options.max_line_length, \
9292
"E501 line too long (%d characters)" % length

0 commit comments

Comments
 (0)