##// END OF EJS Templates
check-code: Add a ``checkfile`` function...
Pierre-Yves David -
r10717:b1f4fcef default
parent child Browse files
Show More
@@ -133,14 +133,8 b' checks = ['
133 133 ('test script', r'(.*/)?test-[^.~]*$', testfilters, testpats),
134 134 ('c', r'.*\.c$', cfilters, cpats),
135 135 ]
136
137 if __name__ == "__main__":
138 if len(sys.argv) == 1:
139 check = glob.glob("*")
140 else:
141 check = sys.argv[1:]
142
143 for f in check:
136 def checkfile(f):
137 """checks style and portability of a given file"""
144 138 for name, match, filters, pats in checks:
145 139 fc = 0
146 140 if not re.match(match, f):
@@ -168,3 +162,13 b' if __name__ == "__main__":'
168 162 print " (too many errors, giving up)"
169 163 break
170 164 break
165
166
167 if __name__ == "__main__":
168 if len(sys.argv) == 1:
169 check = glob.glob("*")
170 else:
171 check = sys.argv[1:]
172
173 for f in check:
174 checkfile(f)
General Comments 0
You need to be logged in to leave comments. Login now