Repository navigation
feat(Linter): suggested capitalisation according to the naming convention - #45783
Draft
joneugster wants to merge 6 commits into
Draft
joneugster wants to merge 6 commits into
joneugster wants to merge 6 commits into
Conversation
joneugster
force-pushed
the
feat/decap-names-linter
branch
from
November 7, 2026 20:27
af12116 to
93d89a2
Compare
PR summary 236d27e69dImport changes exceeding 2%
|
| File | Base Count | Head Count | Change |
|---|---|---|---|
| Mathlib.Tactic | 3110 | 3117 | +7 (+0.23%) |
Import changes for all files
| Files | Import difference |
|---|---|
| ../mathlib-ci/scripts/pr_summary/import_trans_difference.sh all | |
| There are 8649 files with changed transitive imports taking up over 378082 characters: this is too many to display! | |
You can run this locally from your mathlib4 directory: |
git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci
Declarations diff (regex)
+ Lean.Name.lastComponentAsString
+ Lean.Name.recommendedSpellings
+ Lean.Name.suggestTheoremName
+ List.getSingleton?
+ _root_.String.lowerStart
+ suggestedNameLinter
You can run this locally as follows
## from your `mathlib4` directory:
git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci
## summary with just the declaration names:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh <optional_commit>
## more verbose report:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh long <optional_commit>The doc-module for scripts/pr_summary/declarations_diff.sh in the mathlib-ci repository contains some details about this script.
Declarations diff (Lean -- pending)
Computed after the build finishes.
No changes to strong technical debt.
No changes to weak technical debt.
Current commit 236d27e69d
Reference commit 59c7f902e2
This script lives in the mathlib-ci repository. To run it locally, from your mathlib4 directory:
git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci
../mathlib-ci/scripts/reporting/technical-debt-metrics.py pr_summary
- The
relativevalue is the weighted sum of the differences with weight given by the inverse of the current value of the statistic. - The
absolutevalue is therelativevalue divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).
joneugster
force-pushed
the
feat/decap-names-linter
branch
from
November 8, 2026 00:20
0fb85c5 to
236d27e
Compare
Contributor
This branch has not been deployed
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 environment linter checks that all parts of theorem (and lemma) names are capitalised correctly, following the mathlib naming convention.
It aims to be the source of truth for the capitalisation rule of the naming convention, so the manually written rules there can be simplified.
The linter can be called locally by running
lake lint.This has been worked out after it has been pointed out that the naming convention leaves room for interpretation whether the lower-cased version of e.g.
NNRealshould bennRealornnreal.Zulip: a draft of this has been worked out in #mathlib reviewers > Lowercasing the initial sequence of caps