# HG changeset patch # User timeless # Date 2011-05-01 14:11:42 # Node ID 83a94c2fe6f47e985e02e5694b1ddbaa33e1778a # Parent eebf196a8bbe91958103d9cf5da978f4635f36b5 check-code: check for repo in revlog and ui in util diff --git a/contrib/check-code.py b/contrib/check-code.py --- a/contrib/check-code.py +++ b/contrib/check-code.py @@ -208,11 +208,31 @@ cfilters = [ (r'(\()([^)]+\))', repcallspaces), ] +inutilpats = [ + [ + (r'\bui\.', "don't use ui in util"), + ], + # warnings + [] +] + +inrevlogpats = [ + [ + (r'\brepo\.', "don't use repo in revlog"), + ], + # warnings + [] +] + checks = [ ('python', r'.*\.(py|cgi)$', pyfilters, pypats), ('test script', r'(.*/)?test-[^.~]*$', testfilters, testpats), ('c', r'.*\.c$', 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), ] class norepeatlogger(object):