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
This commit is contained in:
Siddharth Agarwal 2017-10-02 02:34:47 -07:00
parent 5912fbc099
commit 3a77727405

View File

@ -273,7 +273,7 @@ pypats = [
# (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)",