comparison contrib/check-code.py @ 34642:a679aa582d8d

check-code: forbid platform.system() See the previous patches for the reason. Differential Revision: https://phab.mercurial-scm.org/D1021
author Jun Wu <quark@fb.com>
date Wed, 11 Oct 2017 17:42:57 -0700
parents 3e4b7861c1c5
children 4889b84b15f2
comparison
equal deleted inserted replaced
34641:bb6544b1c56e 34642:a679aa582d8d
360 (r'^(from|import) mercurial\.(cext|pure|cffi)', 360 (r'^(from|import) mercurial\.(cext|pure|cffi)',
361 "use mercurial.policy.importmod instead"), 361 "use mercurial.policy.importmod instead"),
362 (r'\.next\(\)', "don't use .next(), use next(...)"), 362 (r'\.next\(\)', "don't use .next(), use next(...)"),
363 (r'([a-z]*).revision\(\1\.node\(', 363 (r'([a-z]*).revision\(\1\.node\(',
364 "don't convert rev to node before passing to revision(nodeorrev)"), 364 "don't convert rev to node before passing to revision(nodeorrev)"),
365 (r'platform\.system\(\)', "don't use platform.system(), use pycompat"),
365 366
366 # rules depending on implementation of repquote() 367 # rules depending on implementation of repquote()
367 (r' x+[xpqo%APM][\'"]\n\s+[\'"]x', 368 (r' x+[xpqo%APM][\'"]\n\s+[\'"]x',
368 'string join across lines with no space'), 369 'string join across lines with no space'),
369 (r'''(?x)ui\.(status|progress|write|note|warn)\( 370 (r'''(?x)ui\.(status|progress|write|note|warn)\(