Mercurial > public > mercurial-scm > hg-stable
diff contrib/check-code.py @ 41770:e2472b12c842
contrib: enforce wrapping too-long lines with () instead of \
This is the style I prefer, and an anecdotal exploration of styles
recommended in style guides etc. Further, to quote pep8:
> The preferred way of wrapping long lines is by using Python's implied
> line continuation inside parentheses, brackets and braces. Long lines
> can be broken over multiple lines by wrapping expressions in
> parentheses. These should be used in preference to using a backslash
> for line continuation.
So I think this is a virtuous change.
Differential Revision: https://phab.mercurial-scm.org/D5995
author | Augie Fackler <augie@google.com> |
---|---|
date | Sun, 13 Jan 2019 20:27:00 -0500 |
parents | 7d1798ec92a3 |
children | 14e8d042993a |
line wrap: on
line diff
--- a/contrib/check-code.py Wed Feb 20 18:02:28 2019 -0500 +++ b/contrib/check-code.py Sun Jan 13 20:27:00 2019 -0500 @@ -233,6 +233,7 @@ pypats = [ [ + (r'\\$', 'Use () to wrap long lines in Python, not \\'), (r'^\s*def\s*\w+\s*\(.*,\s*\(', "tuple parameter unpacking not available in Python 3+"), (r'lambda\s*\(.*,.*\)',