Mercurial > hg
changeset 14137:83a94c2fe6f4
check-code: check for repo in revlog and ui in util
author | timeless <timeless@mozdev.org> |
---|---|
date | Sun, 01 May 2011 16:11:42 +0200 |
parents | eebf196a8bbe |
children | c18204fd35b0 |
files | contrib/check-code.py |
diffstat | 1 files changed, 20 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/contrib/check-code.py Sun May 01 16:10:51 2011 +0200 +++ b/contrib/check-code.py Sun May 01 16:11:42 2011 +0200 @@ -208,11 +208,31 @@ (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):