454 ], |
454 ], |
455 # warnings |
455 # warnings |
456 [], |
456 [], |
457 ] |
457 ] |
458 |
458 |
|
459 py3pats = [ |
|
460 [ |
|
461 (r'os\.environ', "use encoding.environ instead (py3)"), |
|
462 (r'os\.name', "use pycompat.osname instead (py3)"), |
|
463 (r'os\.getcwd', "use pycompat.getcwd instead (py3)"), |
|
464 (r'os\.sep', "use pycompat.ossep instead (py3)"), |
|
465 (r'os\.pathsep', "use pycompat.ospathsep instead (py3)"), |
|
466 (r'os\.altsep', "use pycompat.osaltsep instead (py3)"), |
|
467 (r'os\.getenv', "use pycompat.osgetenv instead (py3)"), |
|
468 (r'sys\.platform', "use pycompat.sysplatform instead (py3)"), |
|
469 (r'getopt\.getopt', "use pycompat.getoptb instead (py3)"), |
|
470 ], |
|
471 # warnings |
|
472 [], |
|
473 ] |
|
474 |
459 checks = [ |
475 checks = [ |
460 ('python', r'.*\.(py|cgi)$', r'^#!.*python', pyfilters, pypats), |
476 ('python', r'.*\.(py|cgi)$', r'^#!.*python', pyfilters, pypats), |
|
477 ('python 3', r'.*(hgext|mercurial).*(?<!pycompat)\.py', '', |
|
478 pyfilters, py3pats), |
461 ('test script', r'(.*/)?test-[^.~]*$', '', testfilters, testpats), |
479 ('test script', r'(.*/)?test-[^.~]*$', '', testfilters, testpats), |
462 ('c', r'.*\.[ch]$', '', cfilters, cpats), |
480 ('c', r'.*\.[ch]$', '', cfilters, cpats), |
463 ('unified test', r'.*\.t$', '', utestfilters, utestpats), |
481 ('unified test', r'.*\.t$', '', utestfilters, utestpats), |
464 ('layering violation repo in revlog', r'mercurial/revlog\.py', '', |
482 ('layering violation repo in revlog', r'mercurial/revlog\.py', '', |
465 pyfilters, inrevlogpats), |
483 pyfilters, inrevlogpats), |