# HG changeset patch # User Matt Mackall # Date 1399315079 18000 # Node ID 4840abc83970f8a970b21862cd2dd29dc4c98820 # Parent e3ca21e4d05f2320ba7c1a9bbd170eddba3dc475 check-code: look at shebang to identify Python scripts diff -r e3ca21e4d05f -r 4840abc83970 contrib/check-code.py --- a/contrib/check-code.py Fri May 02 00:23:58 2014 -0500 +++ b/contrib/check-code.py Mon May 05 13:37:59 2014 -0500 @@ -368,15 +368,15 @@ ] checks = [ - ('python', r'.*\.(py|cgi)$', pyfilters, pypats), - ('test script', r'(.*/)?test-[^.~]*$', testfilters, testpats), - ('c', r'.*\.[ch]$', cfilters, cpats), - ('unified test', r'.*\.t$', utestfilters, utestpats), - ('layering violation repo in revlog', r'mercurial/revlog\.py', pyfilters, - inrevlogpats), - ('layering violation ui in util', r'mercurial/util\.py', pyfilters, + ('python', r'.*\.(py|cgi)$', r'^#!.*python', pyfilters, pypats), + ('test script', r'(.*/)?test-[^.~]*$', '', testfilters, testpats), + ('c', r'.*\.[ch]$', '', cfilters, cpats), + ('unified test', r'.*\.t$', '', utestfilters, utestpats), + ('layering violation repo in revlog', r'mercurial/revlog\.py', '', + pyfilters, inrevlogpats), + ('layering violation ui in util', r'mercurial/util\.py', '', pyfilters, inutilpats), - ('txt', r'.*\.txt$', txtfilters, txtpats), + ('txt', r'.*\.txt$', '', txtfilters, txtpats), ] def _preparepats(): @@ -392,7 +392,7 @@ p = re.sub(r'(?