Mercurial > public > mercurial-scm > hg
comparison contrib/check-code.py @ 47856:142a76127e3a stable
check-code: drop the camelcase checks
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`.
Differential Revision: https://phab.mercurial-scm.org/D11309
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Thu, 19 Aug 2021 18:04:14 +0200 |
parents | 752109dc2fb7 |
children | b84fe613de33 |
comparison
equal
deleted
inserted
replaced
47855:254833bde23b | 47856:142a76127e3a |
---|---|
337 ), | 337 ), |
338 'omit superfluous pass', | 338 'omit superfluous pass', |
339 ), | 339 ), |
340 (r'[^\n]\Z', "no trailing newline"), | 340 (r'[^\n]\Z', "no trailing newline"), |
341 (r'(\S[ \t]+|^[ \t]+)\n', "trailing whitespace"), | 341 (r'(\S[ \t]+|^[ \t]+)\n', "trailing whitespace"), |
342 ( | |
343 r'^\s+(self\.)?[A-Za-z][a-z0-9]+[A-Z]\w* = ', | |
344 "don't use camelcase in identifiers", | |
345 r'#.*camelcase-required', | |
346 ), | |
347 ( | 342 ( |
348 r'^\s*(if|while|def|class|except|try)\s[^[\n]*:\s*[^\\n]#\s]+', | 343 r'^\s*(if|while|def|class|except|try)\s[^[\n]*:\s*[^\\n]#\s]+', |
349 "linebreak after :", | 344 "linebreak after :", |
350 ), | 345 ), |
351 ( | 346 ( |