contrib/check-code.py
changeset 14137 83a94c2fe6f4
parent 14136 eebf196a8bbe
child 14169 1b4b82063ce2
equal deleted inserted replaced
14136:eebf196a8bbe 14137:83a94c2fe6f4
   206     (r'''(?P<quote>(?<!")")(?P<text>([^"]|\\")+)"(?!")''', repquote),
   206     (r'''(?P<quote>(?<!")")(?P<text>([^"]|\\")+)"(?!")''', repquote),
   207     (r'''(#\s*include\s+<)([^>]+)>''', repinclude),
   207     (r'''(#\s*include\s+<)([^>]+)>''', repinclude),
   208     (r'(\()([^)]+\))', repcallspaces),
   208     (r'(\()([^)]+\))', repcallspaces),
   209 ]
   209 ]
   210 
   210 
       
   211 inutilpats = [
       
   212   [
       
   213     (r'\bui\.', "don't use ui in util"),
       
   214   ],
       
   215   # warnings
       
   216   []
       
   217 ]
       
   218 
       
   219 inrevlogpats = [
       
   220   [
       
   221     (r'\brepo\.', "don't use repo in revlog"),
       
   222   ],
       
   223   # warnings
       
   224   []
       
   225 ]
       
   226 
   211 checks = [
   227 checks = [
   212     ('python', r'.*\.(py|cgi)$', pyfilters, pypats),
   228     ('python', r'.*\.(py|cgi)$', pyfilters, pypats),
   213     ('test script', r'(.*/)?test-[^.~]*$', testfilters, testpats),
   229     ('test script', r'(.*/)?test-[^.~]*$', testfilters, testpats),
   214     ('c', r'.*\.c$', cfilters, cpats),
   230     ('c', r'.*\.c$', cfilters, cpats),
   215     ('unified test', r'.*\.t$', utestfilters, utestpats),
   231     ('unified test', r'.*\.t$', utestfilters, utestpats),
       
   232     ('layering violation repo in revlog', r'mercurial/revlog\.py', pyfilters,
       
   233      inrevlogpats),
       
   234     ('layering violation ui in util', r'mercurial/util\.py', pyfilters,
       
   235      inutilpats),
   216 ]
   236 ]
   217 
   237 
   218 class norepeatlogger(object):
   238 class norepeatlogger(object):
   219     def __init__(self):
   239     def __init__(self):
   220         self._lastseen = None
   240         self._lastseen = None