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
commit33022cba9ed2d8efe8245e4a7d9aba66075d6811 (patch)
tree5e494b2122eb3d1c52b5b9d2bf9db05283692156 /igor.py
parent30f035760bd34dc45c0303affa55820540c40c5a (diff)
downloadpython-coveragepy-33022cba9ed2d8efe8245e4a7d9aba66075d6811.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 e596f87..d011640 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: