-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rule E203
conflicts with formatter
#8642
Comments
I will add it to that list, though there's an open issue to fix the rule to allow this: #7259. |
I decided to just fix it instead. |
Oh nice that's much better, thanks! |
…ation` (`E203`) (#8654) ## Summary This PR makes `whitespace-before-punctuation` (`E203`) compatible with the formatter by relaxing the rule a bit, as compared to the pycodestyle implementation. It's also more consistent with PEP 8, which says: > However, in a slice the colon acts like a binary operator, and should have equal amounts on either side (treating it as the operator with the lowest priority). Closes #7259. Closes #8642. ## Test Plan `cargo test`
I am still getting this unwanted behaviour with ruff-0.9.3:
|
@JohannesBuchner That's an expected behavior. What the original issue was pointing out is that |
@dhruvmanila Thanks for the quick response. flake8 gives the error "E203 whitespace before ':'" with the reformatted output. I see from psf/black#315 that they claim that this is an issue of pep8. There is help at https://ichard26-testblackdocs.readthedocs.io/en/refactor_docs/compatible_configs.html for configuring flake8. Thanks. |
Running the formatter on
produces
which then fails the rule
Is the fix simply to document that here? https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules
The text was updated successfully, but these errors were encountered: