Commit 2026-11-07 17:31 ddaac225
View on Github →perf(Linter): combine multiple syntax-based linters (#44496)
This PR combines various syntax based linters into a single linter, so that they only need to do one loop through the syntax. This loop though the syntax is designed to be efficient for nodes on which none of the linters are applicable. This is done by using a single match on the syntax node kind.
- The loop itself is done in the
CommandElabMmonad, so that messages can be logged directly. It would be marginally faster to do the loop inStateRefT _ BaseIO, keeping track of all warnings in some state, and then logging them afterwards. But that is significantly more inconvenient to write. - There are some more syntax based linters in
Mathlib.Tactic.Linter.DeprecatedSyntaxandMathlib.Tactic.Linter.DocString, but those are left out of this PR for convenience, and can be done in follow-up PRs.