# HG changeset patch # User Idan Kamara # Date 1303509141 -10800 # Node ID bb391e0515ba7de5e49cdd77e95633cb5abbe5b7 # Parent 97ed99d1f419246c630139b501d4a9bc8d660d53 check-code: warn about naked except clauses diff -r 97ed99d1f419 -r bb391e0515ba contrib/check-code.py --- a/contrib/check-code.py Sat Apr 23 00:51:25 2011 +0300 +++ b/contrib/check-code.py Sat Apr 23 00:52:21 2011 +0300 @@ -150,6 +150,7 @@ (r'[^+=*!<>&| -](\s=|=\s)[^= ]', "wrong whitespace around ="), (r'raise Exception', "don't raise generic exceptions"), + (r'^\s*except:$', "warning: naked except clause"), (r'ui\.(status|progress|write|note|warn)\([\'\"]x', "warning: unwrapped ui message"), (r' is\s+(not\s+)?["\'0-9-]', "object comparison with literal"),