From patchwork Sat Mar 9 21:22:37 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [2,of,2] check-code: do not prepend "warning" to a failure message From: Simon Heimberg X-Patchwork-Id: 1097 Message-Id: <50700cc91109eb190e2f.1362864157@lapsi.heimberg.home> To: Mercurial-devel Date: Sat, 09 Mar 2013 22:22:37 +0100 # HG changeset patch # User Simon Heimberg # Date 1362863686 -3600 # Sat Mar 09 22:14:46 2013 +0100 # Node ID 50700cc91109eb190e2f63a7e47dec4a158a9369 # Parent 4b86d47751be828d3f2f3b2a1f30b92340517b35 check-code: do not prepend "warning" to a failure message The prefix has not been removed when this check changed from a warning to a failure. diff -r 4b86d47751be -r 50700cc91109 contrib/check-code.py --- a/contrib/check-code.py Sat Mar 09 21:26:33 2013 +0100 +++ b/contrib/check-code.py Sat Mar 09 22:14:46 2013 +0100 @@ -216,7 +216,7 @@ (r'(?i)descendent', "the proper spelling is descendAnt"), (r'\.debug\(\_', "don't mark debug messages for translation"), (r'\.strip\(\)\.split\(\)', "no need to strip before splitting"), - (r'^\s*except\s*:', "warning: naked except clause", r'#.*re-raises'), + (r'^\s*except\s*:', "naked except clause", r'#.*re-raises'), (r':\n( )*( ){1,3}[^ ]', "must indent 4 spaces"), (r'ui\.(status|progress|write|note|warn)\([\'\"]x', "missing _() in ui message (use () to hide false-positives)"), diff -r 4b86d47751be -r 50700cc91109 tests/test-check-code.t --- a/tests/test-check-code.t Sat Mar 09 21:26:33 2013 +0100 +++ b/tests/test-check-code.t Sat Mar 09 22:14:46 2013 +0100 @@ -163,13 +163,13 @@ object comparison with literal [1] - $ cat > warning.py < for-nolineno.py < except: > EOF - $ "$check_code" warning.py --warning --nolineno - warning.py:0: + $ "$check_code" for-nolineno.py --nolineno + for-nolineno.py:0: > except: - warning: naked except clause + naked except clause [1] $ cat > raise-format.py <