mirror of https://github.com/astral-sh/ruff
[ty] List rules in alphabetical order in the reference docs (#22097)
## Summary Fixes https://github.com/astral-sh/ty/issues/1885. It wasn't obvious to me that there was a deliberate order to the way these rules were listed in our reference docs -- it looked like it was _nearly_ alphabetical, but not quite. I think it's simpler if we just list them in alphabetical order. ## Test Plan The output from running `cargo dev generate-all` (committed as part of this PR) looks correct!
This commit is contained in:
parent
b342f60b40
commit
dde0d0af68
|
|
@ -63,12 +63,7 @@ fn generate_markdown() -> String {
|
|||
let _ = writeln!(&mut output, "# Rules\n");
|
||||
|
||||
let mut lints: Vec<_> = registry.lints().iter().collect();
|
||||
lints.sort_by(|a, b| {
|
||||
a.default_level()
|
||||
.cmp(&b.default_level())
|
||||
.reverse()
|
||||
.then_with(|| a.name().cmp(&b.name()))
|
||||
});
|
||||
lints.sort_by_key(|a| a.name());
|
||||
|
||||
for lint in lints {
|
||||
let _ = writeln!(&mut output, "## `{rule_name}`\n", rule_name = lint.name());
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue