Show More
@@ -166,7 +166,10 b' def checkfile(f, logfunc=_defaultlogger.' | |||
|
166 | 166 | logfunc(filename, linenumber, linecontent, errormessage) |
|
167 | 167 | :maxerr: number of error to display before arborting. |
|
168 | 168 | Set to None (default) to report all errors |
|
169 | ||
|
170 | return True if no error is found, False otherwise. | |
|
169 | 171 | """ |
|
172 | result = True | |
|
170 | 173 | for name, match, filters, pats in checks: |
|
171 | 174 | fc = 0 |
|
172 | 175 | if not re.match(match, f): |
@@ -185,10 +188,12 b' def checkfile(f, logfunc=_defaultlogger.' | |||
|
185 | 188 | if re.search(p, l[1]): |
|
186 | 189 | logfunc(f, n+1, l[0], msg) |
|
187 | 190 | fc += 1 |
|
191 | result = False | |
|
188 | 192 | if maxerr is not None and fc >= maxerr: |
|
189 | 193 | print " (too many errors, giving up)" |
|
190 | 194 | break |
|
191 | 195 | break |
|
196 | return result | |
|
192 | 197 | |
|
193 | 198 | |
|
194 | 199 | if __name__ == "__main__": |
General Comments 0
You need to be logged in to leave comments.
Login now