mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-27 04:19:18 +00:00
Turn Linters', etc. implicit into_iter()
s into explicit rules()
(#5436)
## Summary As discussed on ~IRC~ Discord, this will make it easier for e.g. the docs generation stuff to get all rules for a linter (using `all_rules()`) instead of just non-nursery ones, and it also makes it more Explicit Is Better Than Implicit to iterate over linter rules. Grepping for `Item = Rule` reveals some remaining implicit `IntoIterator`s that I didn't feel were necessarily in scope for this (and honestly, iterating over a `RuleSet` makes sense).
This commit is contained in:
parent
a647f31600
commit
6acc316d19
8 changed files with 50 additions and 52 deletions
|
@ -102,10 +102,10 @@ pub(crate) fn generate() -> String {
|
|||
));
|
||||
table_out.push('\n');
|
||||
table_out.push('\n');
|
||||
generate_table(&mut table_out, prefix, &linter);
|
||||
generate_table(&mut table_out, prefix.clone().rules(), &linter);
|
||||
}
|
||||
} else {
|
||||
generate_table(&mut table_out, &linter, &linter);
|
||||
generate_table(&mut table_out, linter.rules(), &linter);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue