D895: check-code: allow an exception for camelcase where required

sid0 (Siddharth Agarwal) phabricator at mercurial-scm.org
Mon Oct 2 09:35:21 UTC 2017


sid0 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  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.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D895

AFFECTED FILES
  contrib/check-code.py

CHANGE DETAILS

diff --git a/contrib/check-code.py b/contrib/check-code.py
--- a/contrib/check-code.py
+++ b/contrib/check-code.py
@@ -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)",



To: sid0, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list