# HG changeset patch # User Matt Mackall # Date 1266124817 21600 # Node ID 63a9bfad50ff9f6c8e1628d729a97d4be39b206e # Parent b4fd900569b1441c511ed1bffbb56b9ba1a04827 check-code: two more rules - no plain Exceptions - complain about unmarked ui messages diff -r b4fd900569b1 -r 63a9bfad50ff contrib/check-code.py --- a/contrib/check-code.py Sun Feb 14 00:46:13 2010 +0200 +++ b/contrib/check-code.py Sat Feb 13 23:20:17 2010 -0600 @@ -10,7 +10,8 @@ import sys, re, glob def repquote(m): - t = re.sub(r"\S", "x", m.group(2)) + t = re.sub(r"\w", "x", m.group(2)) + t = re.sub(r"[^\sx]", "o", t) return m.group(1) + t + m.group(1) def repcomment(m): @@ -88,6 +89,8 @@ (r'[^>< ](\+=|-=|!=|<>|<=|>=|<<=|>>=)\s', "missing whitespace around operator"), (r'\s(\+=|-=|!=|<>|<=|>=|<<=|>>=)\S', "missing whitespace around operator"), (r'[^+=*!<>&| -](\s=|=\s)[^= ]', "wrong whitespace around ="), + (r'raise Exception', "don't raise generic exceptions"), + (r'ui\.(status|progress|write|note)\([\'\"]x', "unwrapped ui message"), ] pyfilters = [