-
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
Drop formatting specific rules from the default set #7900
Conversation
const DEFAULT_SELECTORS: &[RuleSelector] = &[ | ||
RuleSelector::Linter(Linter::Pyflakes), | ||
RuleSelector::Linter(Linter::Pycodestyle), | ||
]; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unclear if the flake8 converter needs a different default rule set than Ruff?
CodSpeed Performance ReportMerging #7900 will improve performances by 9.75%Comparing Summary
Benchmarks breakdown
|
The performance win is an exciting upside. |
By default, Ruff enables Flake8's `E` and `F` rules. Ruff supports all rules from the `F` category, | ||
and a [subset](https://docs.astral.sh/ruff/rules/#error-e) of the `E` category, omitting those | ||
stylistic rules made obsolete by the use of an autoformatter, like | ||
stylistic rules made obsolete by the use of a formatter, like |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey we already say we won't include these
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The first and second sentence in the paragraph sound contradictory to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How so?
By default, Ruff enables Flake8's `E` and `F` rules. Ruff supports all rules from the `F` category, | ||
and a [subset](https://docs.astral.sh/ruff/rules/#error-e) of the `E` category, omitting those | ||
stylistic rules made obsolete by the use of an autoformatter, like | ||
stylistic rules made obsolete by the use of a formatter, like |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The first and second sentence in the paragraph sound contradictory to me
Nice. Thank you for landing this change! |
hi there :) I was trying to understand why after v0.1.0 I'm no longer seeing E501 errors on long lines, and based on the description this seems to be why. is the idea not to raise E501 anymore using ruff? or am I missing some extra configuration to bring it back? I've been reading the documentation and couldn't find anything that has changed. I'd expect
to raise E501 |
@g3rv4 -- You can still enable E501! It's just not part of the default rule set. If you're using [tool.ruff]
extend-select = ["E501"] Or, to re-enable all of the [tool.ruff]
extend-select = ["E"] |
@charliermarsh thanks! now I understand the change on the README :) |
Closes #7572
Drops formatting specific rules from the default rule set as they conflict with formatters in general (and in particular, conflict with our formatter). Most of these rules are in preview, but the removal of
line-too-long
andmixed-spaces-and-tabs
is a change to the stable rule set.Example
The following no longer raises
E501