comparison contrib/check-code.py @ 25659:d60678a567a9

check-code: detect legacy octal syntax Now that we have mass rewriting all files to use the modern octal syntax, detect and ban the legacy syntax, which is no longer supported in Python 3.
author Gregory Szorc <gregory.szorc@gmail.com>
date Tue, 23 Jun 2015 22:38:21 -0700
parents b40071379c5b
children 328739ea70c3
comparison
equal deleted inserted replaced
25658:e93036747902 25659:d60678a567a9
286 "missing _() in ui message (use () to hide false-positives)"), 286 "missing _() in ui message (use () to hide false-positives)"),
287 (r'release\(.*wlock, .*lock\)', "wrong lock release order"), 287 (r'release\(.*wlock, .*lock\)', "wrong lock release order"),
288 (r'\b__bool__\b', "__bool__ should be __nonzero__ in Python 2"), 288 (r'\b__bool__\b', "__bool__ should be __nonzero__ in Python 2"),
289 (r'os\.path\.join\(.*, *(""|\'\')\)', 289 (r'os\.path\.join\(.*, *(""|\'\')\)',
290 "use pathutil.normasprefix(path) instead of os.path.join(path, '')"), 290 "use pathutil.normasprefix(path) instead of os.path.join(path, '')"),
291 (r'\s0[0-7]+\b', 'legacy octal syntax; use "0o" prefix instead of "0"'),
291 ], 292 ],
292 # warnings 293 # warnings
293 [ 294 [
294 (r'(^| )pp +xxxxqq[ \n][^\n]', "add two newlines after '.. note::'"), 295 (r'(^| )pp +xxxxqq[ \n][^\n]', "add two newlines after '.. note::'"),
295 ] 296 ]