Show More
@@ -133,7 +133,7 b' checks = [' | |||||
133 | ('test script', r'(.*/)?test-[^.~]*$', testfilters, testpats), |
|
133 | ('test script', r'(.*/)?test-[^.~]*$', testfilters, testpats), | |
134 | ('c', r'.*\.c$', cfilters, cpats), |
|
134 | ('c', r'.*\.c$', cfilters, cpats), | |
135 | ] |
|
135 | ] | |
136 | def checkfile(f): |
|
136 | def checkfile(f, maxerr=None): | |
137 | """checks style and portability of a given file""" |
|
137 | """checks style and portability of a given file""" | |
138 | for name, match, filters, pats in checks: |
|
138 | for name, match, filters, pats in checks: | |
139 | fc = 0 |
|
139 | fc = 0 | |
@@ -158,7 +158,7 b' def checkfile(f):' | |||||
158 | print " %s" % msg |
|
158 | print " %s" % msg | |
159 | lc += 1 |
|
159 | lc += 1 | |
160 | fc += 1 |
|
160 | fc += 1 | |
161 | if fc == 15: |
|
161 | if maxerr is not None and fc >= maxerr: | |
162 | print " (too many errors, giving up)" |
|
162 | print " (too many errors, giving up)" | |
163 | break |
|
163 | break | |
164 | break |
|
164 | break | |
@@ -171,4 +171,4 b' if __name__ == "__main__":' | |||||
171 | check = sys.argv[1:] |
|
171 | check = sys.argv[1:] | |
172 |
|
172 | |||
173 | for f in check: |
|
173 | for f in check: | |
174 | checkfile(f) |
|
174 | checkfile(f, maxerr=15) |
General Comments 0
You need to be logged in to leave comments.
Login now