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
--- 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)",