You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Browse filesBrowse the repository at this point in the historyBrowse files
Wojciech Różowski
authored
feat: introduce findMatchingDecl? for code quality checks in Lean.Linter (#14880)
This PR adds `Lean.Linter.findMatchingDecl?`, which finds the
declaration a piece of syntax belongs to by searching the current
command's info trees for declarations whose declaration range contains
it, together with `Lean.Linter.findCodeQualitySource?` and
`Lean.Linter.findCodeQualitySource`, which turn that declaration into a
code-quality `Source` (the latter falling back to the current module
when no declaration matches). This gives linters a way to attribute
diagnostics and code-quality entries to the declaration being
elaborated.
The helpers are exercised by a new package test,
`tests/pkg/find_matching_decl`, which registers a linter reporting the
matched declaration and derived source for each command. It covers plain
definitions, inductives, mutual blocks, classes, instances, and commands
with no associated declaration.
0 commit comments