Skip to content

feat: record code quality metrics from linters - #14748

Open
wkrozowski wants to merge 2 commits into
leanprover:masterfrom
wkrozowski:wkr/codeQualityLinterEntries
Open

feat: record code quality metrics from linters#14748
wkrozowski wants to merge 2 commits into
leanprover:masterfrom
wkrozowski:wkr/codeQualityLinterEntries

Conversation

@wkrozowski

@wkrozowski wkrozowski commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

This PR adds the infrastructure to collect code quality metrics from linters. Entries logged during elaboration are saved in the .olean file for the module. Build tools can then collect these entries for each module without re-elaborating the code.

A new MessageData.ofCodeQualityEntry constructor carries a Linter.CodeQuality.Entry through the message log. The Lean.Linter.logCodeQualityEntry function logs these messages as silent at information severity. As a result, they never show in CLI or editor output, and they do not interact with warningAsError. However, they still reach Lean.Linter.recordLints, which extracts the entries into the new codeQualityLogExt persistent environment extension.

This extension mirrors lintLogExt. Entries are exported at server visibility only and carry no position information. The Lean.Linter.getAllCodeQualityEntries function exposes the per-module entries to consumers. A follow-up PR will merge these entries into the lake lint code quality mode.

@github-actions github-actions Bot added the toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN label Aug 11, 2026
mathlib-nightly-testing Bot pushed a commit to leanprover-community/batteries that referenced this pull request Aug 11, 2026
@wkrozowski wkrozowski added the changelog-language Language features and metaprograms label Aug 11, 2026
@wkrozowski
wkrozowski marked this pull request as ready for review August 11, 2026 16:46
@wkrozowski
wkrozowski requested a review from Vtec234 as a code owner August 11, 2026 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog-language Language features and metaprograms toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant