mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-27 12:29:28 +00:00
Add rule and autofix to sort the contents of __all__
(#9474)
## Summary This implements the rule proposed in #1198 (though it doesn't close the issue, as there are some open questions about configuration that might merit some further discussion). ## Test Plan `cargo test` / `cargo insta review`. I also ran this PR branch on the CPython codebase with `--fix --select=RUF022 --preview `, and the results looked pretty good to me. --------- Co-authored-by: Micha Reiser <micha@reiser.io> Co-authored-by: Andrew Gallant <andrew@astral.sh>
This commit is contained in:
parent
3064312818
commit
3aae16f1bd
9 changed files with 2248 additions and 1 deletions
|
@ -923,6 +923,7 @@ pub fn code_to_rule(linter: Linter, code: &str) -> Option<(RuleGroup, Rule)> {
|
|||
(Ruff, "019") => (RuleGroup::Preview, rules::ruff::rules::UnnecessaryKeyCheck),
|
||||
(Ruff, "020") => (RuleGroup::Preview, rules::ruff::rules::NeverUnion),
|
||||
(Ruff, "021") => (RuleGroup::Preview, rules::ruff::rules::ParenthesizeChainedOperators),
|
||||
(Ruff, "022") => (RuleGroup::Preview, rules::ruff::rules::UnsortedDunderAll),
|
||||
(Ruff, "100") => (RuleGroup::Stable, rules::ruff::rules::UnusedNOQA),
|
||||
(Ruff, "200") => (RuleGroup::Stable, rules::ruff::rules::InvalidPyprojectToml),
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue