[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:
Alex Waygood 2025-12-19 19:11:05 +00:00 committed by GitHub
parent b342f60b40
commit dde0d0af68
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 455 additions and 460 deletions

View File

@ -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());

908
crates/ty/docs/rules.md generated

File diff suppressed because it is too large Load Diff