changeset 10451:63a9bfad50ff

check-code: two more rules - no plain Exceptions - complain about unmarked ui messages
author Matt Mackall <mpm@selenic.com>
date Sat, 13 Feb 2010 23:20:17 -0600
parents b4fd900569b1
children 59f8fff4f887
files contrib/check-code.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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 = [