summaryrefslogtreecommitdiff
path: root/igor.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2012-10-30 07:33:38 -0400
committerNed Batchelder <ned@nedbatchelder.com>2012-10-30 07:33:38 -0400
commit9d6abb08c303e6a0cc2c08f71067c0b84977e4e6 (patch)
tree05d38d550b84904b6be4876496ff3b416496cbac /igor.py
parent9790c911ffcd9936f399ea830e669f6241a38fd2 (diff)
downloadpython-coveragepy-git-9d6abb08c303e6a0cc2c08f71067c0b84977e4e6.tar.gz
One more way to be picky: no final blank lines.
Diffstat (limited to 'igor.py')
-rw-r--r--igor.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/igor.py b/igor.py
index e596f873..d0116408 100644
--- a/igor.py
+++ b/igor.py
@@ -64,6 +64,7 @@ def do_check_eol(args):
return
checked.add(fname)
+ line = None
for n, line in enumerate(open(fname, "rb")):
if crlf:
if "\r" in line:
@@ -77,6 +78,9 @@ def do_check_eol(args):
print("%s@%d: trailing whitespace found" % (fname, n+1))
return
+ if line is not None and not line.strip():
+ print("%s: final blank line" % (fname,))
+
def check_files(root, patterns, **kwargs):
for root, dirs, files in os.walk(root):
for f in files: