Commit 43839329 authored by Alicia Boya García's avatar Alicia Boya García

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.
parent 92483ae2
Pipeline #15038 passed with stages
in 15 minutes and 50 seconds
......@@ -56,7 +56,7 @@ def main():
if not modified_file.endswith(".py"):
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:
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment