check-code: check for % inside _()
authorMatt Mackall <mpm@selenic.com>
Thu, 08 Mar 2012 15:59:44 -0600
changeset 16234 a6941d7033fa
parent 16233 3f79b110c4f0
child 16235 eb39bbda167b
check-code: check for % inside _()
contrib/check-code.py
--- a/contrib/check-code.py	Thu Mar 08 15:59:41 2012 -0600
+++ b/contrib/check-code.py	Thu Mar 08 15:59:44 2012 -0600
@@ -122,6 +122,8 @@
     (r'\.has_key\b', "dict.has_key is not available in Python 3+"),
     (r'^\s*\t', "don't use tabs"),
     (r'\S;\s*\n', "semicolon"),
+    (r'[^_]_\("[^"]+"\s*%', "don't use % inside _()"),
+    (r"[^_]_\('[^']+'\s*%", "don't use % inside _()"),
     (r'\w,\w', "missing whitespace after ,"),
     (r'\w[+/*\-<>]\w', "missing whitespace in expression"),
     (r'^\s+\w+=\w+[^,)\n]$', "missing whitespace in assignment"),