check-code: allow an exception for camelcase where required
authorSiddharth Agarwal <sid0@fb.com>
Mon, 02 Oct 2017 02:34:47 -0700
changeset 34430 b332c01247d8
parent 34429 0ee9cf8d054a
child 34431 80215865d154
check-code: allow an exception for camelcase where required unittest has a `maxDiff` parameter which has to be set to `None` in order for large enough failure diffs to be displayed. Add a comment to disable the camelcase check for `self.maxDiff = None` lines. Differential Revision: https://phab.mercurial-scm.org/D895
contrib/check-code.py
--- a/contrib/check-code.py	Sun Oct 01 12:16:34 2017 -0400
+++ b/contrib/check-code.py	Mon Oct 02 02:34:47 2017 -0700
@@ -273,7 +273,7 @@
 #    (r'^\s+[^_ \n][^_. \n]+_[^_\n]+\s*=',
 #     "don't use underbars in identifiers"),
     (r'^\s+(self\.)?[A-Za-z][a-z0-9]+[A-Z]\w* = ',
-     "don't use camelcase in identifiers"),
+     "don't use camelcase in identifiers", r'#.*camelcase-required'),
     (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)",