changeset 34429:b332c01247d8

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
author Siddharth Agarwal <sid0@fb.com>
date Mon, 02 Oct 2017 02:34:47 -0700
parents 0ee9cf8d054a
children 80215865d154
files contrib/check-code.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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)",