diff contrib/check-code.py @ 15457:1470f8b00694

check-code: enable camelcase check, fix up problems
author Matt Mackall <mpm@selenic.com>
date Wed, 09 Nov 2011 16:36:54 -0600
parents 3bece03bf3c6
children 7917a104a285
line wrap: on
line diff
--- a/contrib/check-code.py	Mon Nov 07 13:20:22 2011 +0100
+++ b/contrib/check-code.py	Wed Nov 09 16:36:54 2011 -0600
@@ -131,7 +131,8 @@
     (r'[^\n]\Z', "no trailing newline"),
     (r'(\S[ \t]+|^[ \t]+)\n', "trailing whitespace"),
 #    (r'^\s+[^_ \n][^_. \n]+_[^_\n]+\s*=', "don't use underbars in identifiers"),
-#    (r'\w*[a-z][A-Z]\w*\s*=', "don't use camelcase in identifiers"),
+    (r'^\s+(self\.)?[A-za-z][a-z0-9]+[A-Z]\w* = ',
+     "don't use camelcase in identifiers"),
     (r'^\s*(if|while|def|class|except|try)\s[^[\n]*:\s*[^\\n]#\s]+',
      "linebreak after :"),
     (r'class\s[^( \n]+:', "old-style class, use class foo(object)"),