#!/usr/bin/env python
-import os
+import os, sys
from twisted.python import usage
def parseArgs(self, *starting_points):
self.starting_points = starting_points
+found = [False]
+
def check(fn):
f = open(fn, "r")
for i,line in enumerate(f.readlines()):
if line.rstrip() != line:
# the %s:%d:%d: lets emacs' compile-mode jump to those locations
print "%s:%d:%d: trailing whitespace" % (fn, i+1, len(line)+1)
+ found[0] = True
f.close()
o = Options()
else:
for fn in o.starting_points:
check(fn)
+if found[0]:
+ sys.exit(1)
+sys.exit(0)