Mercurial > public > mercurial-scm > hg-stable
comparison contrib/check-code.py @ 43112:24a07347aa60
check-commit: allow foo_bar naming in functions
nameswithallthewordssmashedtogetherarehardtoread.
especiallyifenglishisnotyourprimarylanguage.
Let's align with the rest of the programming universe and
allow_the_use_of_underscores_in_names.
We took a hand poll at the 5.2 sprint regarding this change and
all but 1 person supported it. The person who didn't expressed
concerns around excessive API breakage if we mass renamed things.
But we're not planning to mass rename things for the sake of
renaming, so all should be well.
Differential Revision: https://phab.mercurial-scm.org/D2010
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Fri, 02 Feb 2018 10:13:42 -0800 |
parents | e65e7290041e |
children | 313e3a279828 |
comparison
equal
deleted
inserted
replaced
43111:e5d535621ee1 | 43112:24a07347aa60 |
---|---|
338 ), | 338 ), |
339 'omit superfluous pass', | 339 'omit superfluous pass', |
340 ), | 340 ), |
341 (r'[^\n]\Z', "no trailing newline"), | 341 (r'[^\n]\Z', "no trailing newline"), |
342 (r'(\S[ \t]+|^[ \t]+)\n', "trailing whitespace"), | 342 (r'(\S[ \t]+|^[ \t]+)\n', "trailing whitespace"), |
343 # (r'^\s+[^_ \n][^_. \n]+_[^_\n]+\s*=', | |
344 # "don't use underbars in identifiers"), | |
345 ( | 343 ( |
346 r'^\s+(self\.)?[A-Za-z][a-z0-9]+[A-Z]\w* = ', | 344 r'^\s+(self\.)?[A-Za-z][a-z0-9]+[A-Z]\w* = ', |
347 "don't use camelcase in identifiers", | 345 "don't use camelcase in identifiers", |
348 r'#.*camelcase-required', | 346 r'#.*camelcase-required', |
349 ), | 347 ), |