summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony Sottile <asottile@umich.edu>2020-03-23 09:11:43 -0700
committerGitHub <noreply@github.com>2020-03-23 09:11:43 -0700
commit19a3925a89c71d422b98363d9ccfa8903a65b707 (patch)
tree59e058561e613f08f5358737fd1305506a051eba
parent686c84b44029bee9bb5ccb6002990e758834b311 (diff)
parent9184238b5668829759babcef61a70b2a6d433162 (diff)
downloadpep8-19a3925a89c71d422b98363d9ccfa8903a65b707.tar.gz
Merge pull request #913 from anntzer/afteronelinerblock
Correctly allow *two* blank lines after a block of one-liners.
-rwxr-xr-xpycodestyle.py1
-rw-r--r--testsuite/E30not.py4
2 files changed, 5 insertions, 0 deletions
diff --git a/pycodestyle.py b/pycodestyle.py
index b9a37f0..235532c 100755
--- a/pycodestyle.py
+++ b/pycodestyle.py
@@ -1797,6 +1797,7 @@ def expand_indent(line):
>>> expand_indent(' \t')
16
"""
+ line = line.rstrip('\n\r')
if '\t' not in line:
return len(line) - len(line.lstrip())
result = 0
diff --git a/testsuite/E30not.py b/testsuite/E30not.py
index ef795a8..ba0f742 100644
--- a/testsuite/E30not.py
+++ b/testsuite/E30not.py
@@ -167,6 +167,10 @@ def foo(x):
# for no E30x being emitted.
def bar(): pass
def baz(): pass
+
+
+def main():
+ pass
#: E704:4:5 E704:5:5
def foo():
# This emits the (ignored-by-default) E704, but here we're testing