##// END OF EJS Templates
check-code: suggest pycompat.is(posix|windows|darwin)...
Jun Wu -
r34649:4889b84b default
parent child Browse files
Show More
@@ -397,6 +397,18 b' pyfilters = ['
397 (?P=quote))""", reppython),
397 (?P=quote))""", reppython),
398 ]
398 ]
399
399
400 # non-filter patterns
401 pynfpats = [
402 [
403 (r'pycompat\.osname\s*[=!]=\s*[\'"]nt[\'"]', "use pycompat.iswindows"),
404 (r'pycompat\.osname\s*[=!]=\s*[\'"]posix[\'"]', "use pycompat.isposix"),
405 (r'pycompat\.sysplatform\s*[!=]=\s*[\'"]darwin[\'"]',
406 "use pycompat.isdarwin"),
407 ],
408 # warnings
409 [],
410 ]
411
400 # extension non-filter patterns
412 # extension non-filter patterns
401 pyextnfpats = [
413 pyextnfpats = [
402 [(r'^"""\n?[A-Z]', "don't capitalize docstring title")],
414 [(r'^"""\n?[A-Z]', "don't capitalize docstring title")],
@@ -513,6 +525,7 b' py3pats = ['
513
525
514 checks = [
526 checks = [
515 ('python', r'.*\.(py|cgi)$', r'^#!.*python', pyfilters, pypats),
527 ('python', r'.*\.(py|cgi)$', r'^#!.*python', pyfilters, pypats),
528 ('python', r'.*\.(py|cgi)$', r'^#!.*python', [], pynfpats),
516 ('python', r'.*hgext.*\.py$', '', [], pyextnfpats),
529 ('python', r'.*hgext.*\.py$', '', [], pyextnfpats),
517 ('python 3', r'.*(hgext|mercurial)/(?!demandimport|policy|pycompat).*\.py',
530 ('python 3', r'.*(hgext|mercurial)/(?!demandimport|policy|pycompat).*\.py',
518 '', pyfilters, py3pats),
531 '', pyfilters, py3pats),
General Comments 0
You need to be logged in to leave comments. Login now