-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
flake8's (W503
and) W504
#4125
Comments
I think we're unlikely to implement W503 and W504, since we're likely not going to implement the pycodestyle rules that are ignored-by-default (due to being non-unanimously accepted, and non-violations of PEP8, per the pycodestyle docs). W503 is a little more problematic, since it conflicts with Black. W504 might not conflict with Black, but I'm still hesitant to support it given that it's disabled-by-default in pycodestyle and Flake8. |
(As always, totally open to further discussion -- I just tend to close issues by-default when answering a question, to try and manage the issue queue responsibly.) |
Oh sure, this conclusion is fine with me, thanks! I realize I have been making a lot of issues here, but it's okay to close them. For me to remove
|
@charliermarsh I'd like to propose this be re-opened. Black does take the stance of W504 against line breaks after binary operators, which also aligns with the PEP-8 recommendation. To keep my code in check with PEP-8, I have to use ruff with |
FWIW, this would also bring Ruff autofixes closer to parity with autopep8, even if ignored/disabled by default #9057 (comment) |
ruff doesn’t read `setup.cfg` so the rules defined there are redundant. This is a hangover from when we used to use `flake8` directly. I’ve copied some of the rules into pyproject.toml Selected rules: - B902 and implemented in ruff as N804 and N805. Only copying N804 because N805 gets tripped up by sqlalchemy/sqlalchemy#9213 - E203 still in preview in ruff, add a note to include it later Ignored rules: - W503 and W504 aren’t likely to be implemented in ruff astral-sh/ruff#4125 - E203 is still in preview https://docs.astral.sh/ruff/rules/whitespace-before-punctuation/ so we don’t need to worry about ignoring it (and maybe it will be fit for purpose once it’s out of preview) Cyclomatic complexity: - this repo has it set to 8, but everywhere else we use the default (10) so let’s not copy that into `pyproject.toml`
ruff doesn’t read `setup.cfg` so the rules defined there are redundant. This is a hangover from when we used to use `flake8` directly. I’ve copied some of the rules into pyproject.toml Selected rules: - B902 and implemented in ruff as N804 and N805. Only copying N804 because N805 gets tripped up by sqlalchemy/sqlalchemy#9213 - E203 still in preview in ruff, add a note to include it later Ignored rules: - W503 and W504 aren’t likely to be implemented in ruff astral-sh/ruff#4125 - E203 is still in preview https://docs.astral.sh/ruff/rules/whitespace-before-punctuation/ so we don’t need to worry about ignoring it (and maybe it will be fit for purpose once it’s out of preview) Cyclomatic complexity: - this repo has it set to 8, but everywhere else we use the default (10) so let’s not copy that into `pyproject.toml`
ruff doesn’t read `setup.cfg` so the rules defined there are redundant. This is a hangover from when we used to use `flake8` directly. I’ve copied some of the rules into pyproject.toml Selected rules: - B902 and implemented in ruff as N804 and N805. Only copying N804 because N805 gets tripped up by sqlalchemy/sqlalchemy#9213 - E203 still in preview in ruff, add a note to include it later Ignored rules: - W503 and W504 aren’t likely to be implemented in ruff astral-sh/ruff#4125 - E203 is still in preview https://docs.astral.sh/ruff/rules/whitespace-before-punctuation/ so we don’t need to worry about ignoring it (and maybe it will be fit for purpose once it’s out of preview) Cyclomatic complexity: - this repo has it set to 8, but everywhere else we use the default (10) so let’s not copy that into `pyproject.toml`
ruff doesn’t read `setup.cfg` so the rules defined there are redundant. This is a hangover from when we used to use `flake8` directly. I’ve copied some of the rules into pyproject.toml Selected rules: - B902 and implemented in ruff as N804 and N805. Only copying N804 because N805 gets tripped up by sqlalchemy/sqlalchemy#9213 - E203 still in preview in ruff, add a note to include it later Ignored rules: - W503 and W504 aren’t likely to be implemented in ruff astral-sh/ruff#4125 - E203 is still in preview https://docs.astral.sh/ruff/rules/whitespace-before-punctuation/ so we don’t need to worry about ignoring it (and maybe it will be fit for purpose once it’s out of preview) Cyclomatic complexity: - this repo has it set to 8, but everywhere else we use the default (10) so let’s not copy that into `pyproject.toml`
flake8
has two rulesW503
andW504
that don't seem to be inruff==0.0.263
.W503
shouldn't existW503
andW504
Any thoughts on
ruff
implementingW504
with autofix?The text was updated successfully, but these errors were encountered: