-
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
Formatter: single_line_format_skip_with_multiple_comments
preview style
#8892
Comments
single_line_format_skip_with_multiple_comments
Support using noqa: E501
and fmt:skip
on the same statement.single_line_format_skip_with_multiple_comments
preview style
I don't mind requiring a |
I like the |
I find |
:D Are you suggesting that we should not support using |
I don't feel strongly about supporting it but I probably wouldn't recommend it. We have to use something here that all tools adhere to, and |
for me, the big addition is I can explain in the same comment I am skipping the formatting what led me to this also, I am against the |
## Summary This is similar to #8876, but more limited in scope: 1. It only applies to `# fmt: skip` (like Black). Like `# isort: on`, `# fmt: on` needs to be on its own line (still). 2. It only delimits on `#`, so you can do `# fmt: skip # noqa`, but not `# fmt: skip - some other content` or `# fmt: skip; noqa`. If we want to support the `;`-delimited version, we should revisit later, since we don't support that in the linter (so `# fmt: skip; noqa` wouldn't register a `noqa`). Closes #8892.
Thanks @charliermarsh for implementing this. Allowing I recommend deferring this until we look into suppression comments holistically. |
Implement Black's
single_line_format_skip_with_multiple_comments
style in Ruff.I don't think it's necessary to gate this change as a preview style. We should also allow the same for
fmt:off
andfmt:on
.The text was updated successfully, but these errors were encountered: