comparison contrib/check-code.py @ 17424:e7cfe3587ea4

fix trivial spelling errors
author Mads Kiilerich <mads@kiilerich.com>
date Wed, 15 Aug 2012 22:38:42 +0200
parents 2da47de36b6f
children 72803c8edaa4
comparison
equal deleted inserted replaced
17406:fc14953e8e34 17424:e7cfe3587ea4
319 """checks style and portability of a given file 319 """checks style and portability of a given file
320 320
321 :f: filepath 321 :f: filepath
322 :logfunc: function used to report error 322 :logfunc: function used to report error
323 logfunc(filename, linenumber, linecontent, errormessage) 323 logfunc(filename, linenumber, linecontent, errormessage)
324 :maxerr: number of error to display before arborting. 324 :maxerr: number of error to display before aborting.
325 Set to false (default) to report all errors 325 Set to false (default) to report all errors
326 326
327 return True if no error is found, False otherwise. 327 return True if no error is found, False otherwise.
328 """ 328 """
329 blamecache = None 329 blamecache = None
363 p, msg, ignore = pat 363 p, msg, ignore = pat
364 else: 364 else:
365 p, msg = pat 365 p, msg = pat
366 ignore = None 366 ignore = None
367 367
368 # fix-up regexes for multiline searches 368 # fix-up regexes for multi-line searches
369 po = p 369 po = p
370 # \s doesn't match \n 370 # \s doesn't match \n
371 p = re.sub(r'(?<!\\)\\s', r'[ \\t]', p) 371 p = re.sub(r'(?<!\\)\\s', r'[ \\t]', p)
372 # [^...] doesn't match newline 372 # [^...] doesn't match newline
373 p = re.sub(r'(?<!\\)\[\^', r'[^\\n', p) 373 p = re.sub(r'(?<!\\)\[\^', r'[^\\n', p)