-
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
Provide a grouping rule for ruff formatter conflicting rules #8175
Comments
My use case: I currently include This ends up being less maintenance for me to stay up to date with new rules. And it's easier to document with comments what we don't want or agree with. But having a way to configure "ALL but rules obsoleted by formatter" would be nice to simplify configs (and automatically stay up to date with formatter updates!). I don't know if |
#8196 removes the warnings for all but 2 rules, except if you changed the configuration for some of the potentially conflicting rules. |
## Summary Avoid warning about incompatible rules except if their configuration directly conflicts with the formatter. This should reduce the noise and potentially the need for #8175 and #8185 I also extended the rule and option documentation to mention any potential formatter incompatibilities or whether they're redundant when using the formatter. * `LineTooLong`: This is a use case we explicitly want to support. Don't warn about it * `TabIndentation`, `IndentWithSpaces`: Only warn if `indent-style="tab"` * `IndentationWithInvalidMultiple`, `IndentationWithInvalidMultipleComment`: Only warn if `indent-width != 4` * `OverIndented`: Don't warn, but mention that the rule is redundant * `BadQuotesInlineString`: Warn if quote setting is different from `format.quote-style` * `BadQuotesMultilineString`, `BadQuotesDocstring`: Warn if `quote != "double"` ## Test Plan I added a new integration test for the default configuration with `ALL`. `ruff format` now only shows two incompatible rules, which feels more reasonable.
The latest release shipped a few improvements that should drastically reduce the warnings. Please take a look and comment on this issue if you think that a dedicated grouping for conflicting rules would still be valuable and we'll reopen the issue. |
As long as the number is greater than one, I think it would still be helpful. So I'm asking to reopen this. |
Ruff warns these rules conflict with the formatter, would be nice if we could disable these in a single line then need to disable one by one:
perhaps we could have rule FORM1 that would be an alias to all the rules conflicting with ruff formatter?
The text was updated successfully, but these errors were encountered: