comparison contrib/check-code.py @ 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 b52f22d9afa5
children b521b3a79afd
comparison
equal deleted inserted replaced
34428:0ee9cf8d054a 34429:b332c01247d8
271 (r'[^\n]\Z', "no trailing newline"), 271 (r'[^\n]\Z', "no trailing newline"),
272 (r'(\S[ \t]+|^[ \t]+)\n', "trailing whitespace"), 272 (r'(\S[ \t]+|^[ \t]+)\n', "trailing whitespace"),
273 # (r'^\s+[^_ \n][^_. \n]+_[^_\n]+\s*=', 273 # (r'^\s+[^_ \n][^_. \n]+_[^_\n]+\s*=',
274 # "don't use underbars in identifiers"), 274 # "don't use underbars in identifiers"),
275 (r'^\s+(self\.)?[A-Za-z][a-z0-9]+[A-Z]\w* = ', 275 (r'^\s+(self\.)?[A-Za-z][a-z0-9]+[A-Z]\w* = ',
276 "don't use camelcase in identifiers"), 276 "don't use camelcase in identifiers", r'#.*camelcase-required'),
277 (r'^\s*(if|while|def|class|except|try)\s[^[\n]*:\s*[^\\n]#\s]+', 277 (r'^\s*(if|while|def|class|except|try)\s[^[\n]*:\s*[^\\n]#\s]+',
278 "linebreak after :"), 278 "linebreak after :"),
279 (r'class\s[^( \n]+:', "old-style class, use class foo(object)", 279 (r'class\s[^( \n]+:', "old-style class, use class foo(object)",
280 r'#.*old-style'), 280 r'#.*old-style'),
281 (r'class\s[^( \n]+\(\):', 281 (r'class\s[^( \n]+\(\):',