feat: record code quality metrics from linters - #14748
Open
wkrozowski wants to merge 2 commits into
Open
Conversation
mathlib-nightly-testing Bot
pushed a commit
to leanprover-community/batteries
that referenced
this pull request
Aug 11, 2026
wkrozowski
marked this pull request as ready for review
August 11, 2026 16:46
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds the infrastructure to collect code quality metrics from linters. Entries logged during elaboration are saved in the
.oleanfile for the module. Build tools can then collect these entries for each module without re-elaborating the code.A new
MessageData.ofCodeQualityEntryconstructor carries aLinter.CodeQuality.Entrythrough the message log. TheLean.Linter.logCodeQualityEntryfunction logs these messages as silent at information severity. As a result, they never show in CLI or editor output, and they do not interact withwarningAsError. However, they still reachLean.Linter.recordLints, which extracts the entries into the newcodeQualityLogExtpersistent environment extension.This extension mirrors
lintLogExt. Entries are exported at server visibility only and carry no position information. TheLean.Linter.getAllCodeQualityEntriesfunction exposes the per-module entries to consumers. A follow-up PR will merge these entries into thelake lintcode quality mode.