[Request] [- ] D11309: check-code: drop the camelcase checks

marmoute (Pierre-Yves David) phabricator at mercurial-scm.org
Thu Aug 19 18:12:23 UTC 2021


marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  Fro about 2 years we have been using CamelCase is class names. That rules gets
  in the way of assigning class or exception in compatibility layers.
  
  I think it is safe to drop it now that we started using CamelCase for some case.
  
  My motivation for this is the need to assign `FileNotFoundError` in `pycompat`.

REPOSITORY
  rHG Mercurial

BRANCH
  stable

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

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
@@ -340,11 +340,6 @@
         (r'[^\n]\Z', "no trailing newline"),
         (r'(\S[ \t]+|^[ \t]+)\n', "trailing whitespace"),
         (
-            r'^\s+(self\.)?[A-Za-z][a-z0-9]+[A-Z]\w* = ',
-            "don't use camelcase in identifiers",
-            r'#.*camelcase-required',
-        ),
-        (
             r'^\s*(if|while|def|class|except|try)\s[^[\n]*:\s*[^\\n]#\s]+',
             "linebreak after :",
         ),



To: marmoute, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mercurial-scm.org/pipermail/mercurial-patches/attachments/20210819/8f53570e/attachment.html>


More information about the Mercurial-patches mailing list