diff options
author | Alicia Boya García <ntrrgc@gmail.com> | 2019-01-14 22:55:35 +0100 |
---|---|---|
committer | Alicia Boya García <ntrrgc@gmail.com> | 2019-01-15 18:57:02 +0100 |
commit | 438393293e58f84a80527240cfd9a30af073ec94 (patch) | |
tree | 6e39dcd10ec12d8720340d22031d9bef536d4b52 /hooks | |
parent | 92483ae21060e79c69b5c568660b0ef4e1b17ab4 (diff) |
pre-commit-python: Allow line breaks between binary operators
pre-commit-python overrides the list of ignored Python style errors.
Unfortunately, before this patch the list did not exclude W503 and
W504 (which are otherwise ignored by default).
The consequence of having those two warnings enabled at the same time is
that it's not possible to break lines on binary operators, which is an
unreasonable unintentional restriction:
'validateflow': "validateflow, expectations-dir=\"" +
expectations_dir + "\", actual-results-dir=\"" +
actual_results_dir + "\"",
W504 line break after binary operator
'validateflow': "validateflow, expectations-dir=\""
+ expectations_dir + "\", actual-results-dir=\""
+ actual_results_dir + "\"",
W503 line break before binary operator
This patch excludes W503 so that there is a valid style for breaking
lines on binary operators.
Diffstat (limited to 'hooks')
-rwxr-xr-x | hooks/pre-commit-python.hook | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/hooks/pre-commit-python.hook b/hooks/pre-commit-python.hook index ba33113..818baea 100755 --- a/hooks/pre-commit-python.hook +++ b/hooks/pre-commit-python.hook @@ -56,7 +56,7 @@ def main(): try: if not modified_file.endswith(".py"): continue - pycodestyle_errors = system('pycodestyle', '--repeat', '--ignore', 'E501,E128,W605', modified_file) + pycodestyle_errors = system('pycodestyle', '--repeat', '--ignore', 'E501,E128,W605,W503', modified_file) if pycodestyle_errors: if output_message is None: output_message = NOT_PYCODESTYLE_COMPLIANT_MESSAGE_PRE |