[skip changelog] Resolve impossible to satisfy Flake8 configuration #1022
+5
−1
Conversation
Flake8/pycodestyle has a pair of mutually exclusive checks: - W503: line break before binary operator - W504: line break after binary operator Having both these checks enabled results in a failed check when there is a line break at a binary operator that can't be resolved by moving the operator. PEP 8 recommends line break before the binary operator, so the logical choice between the two checks is W504.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Please check if the PR fulfills these requirements
before creating one)
our contributing guidelines
Bug fix.
Flake8/pycodestyle has a pair of mutually exclusive checks:
W503
: line break before binary operatorW504
: line break after binary operatorHaving both these checks enabled results in a failed check when there is a line break at a binary operator, which can't be
resolved by moving the operator.
fails the
W503
check.fails the
W504
check.PEP 8 recommends line break before the binary operator, so the logical choice of which of the two checks to keep is
W504
.Flake8 is now configured to ignore
W503
and it is possible to format the Python code in a way that will pass the check.No