Skip to content

feat: linter for name components in uppercase - #34440

Open
grunweg wants to merge 52 commits into
leanprover-community:masterfrom
grunweg:checknames-casing-harder
Open

grunweg wants to merge 52 commits into
leanprover-community:masterfrom
grunweg:checknames-casing-harder

Conversation

@grunweg

@grunweg grunweg commented Jan 26, 2026 •

Copy link
Copy Markdown
Contributor

Per the naming convention, these are errors --- with the exception of abbreviations and names like Icc.

Mathlib has many violations at the moment: for this reason, we add this as an environment linter
and automatically add all current exceptions. Once these have been fixed, converting to a syntax linter
is desirable.
Until then, track the number of such exceptions as technical debt.


Zulip discussion

Open in Gitpod

…ppercase

Unless these are an abbreviation, that is usually an error.
@grunweg grunweg added awaiting-CI This PR does not pass CI yet. This label is automatically removed once it does. t-linter Linter labels Jan 26, 2026
@github-actions

github-actions Bot commented Jan 26, 2026 •

Copy link
Copy Markdown

PR summary c8b3c1773a

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff (regex)

+ Foo.My_lemma_name
+ Foo.my_lemma_name
+ MyConcept_some_lemma
+ Nat.Ioc_something
+ allowed
+ badNamingUppercaseComponent
+ isAcronymLike
+ isWronglyCased
+ isWronglyCasedName

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)

✅ Lean-aware diff — post-build, computed from the Lean environment (commit c8b3c17).

  • +1 new declarations
  • −0 removed declarations
+Mathlib.Linter.Style.nameCheck.badNamingUppercaseComponent

No changes to strong technical debt.
No changes to weak technical debt.

Current commit c8b3c1773a
Reference commit ec653f3c4e

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 relative value is the weighted sum of the differences with weight given by the inverse of the current value of the statistic.
  • The absolute value is the relative value divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).

@grunweg
grunweg force-pushed the checknames-casing-harder branch from f7186b0 to 54c9f67 Compare January 26, 2026 11:30
@github-actions github-actions Bot added the large-import Automatically added label for PRs with a significant increase in transitive imports label Jan 28, 2026
@grunweg grunweg changed the title feat(Linter/NameCheck): also check for name components which are in u… feat: linter for name components in uppercase Jan 28, 2026
@grunweg
grunweg force-pushed the checknames-casing-harder branch from a7c5868 to fc39dce Compare January 28, 2026 13:11
@grunweg grunweg removed the awaiting-CI This PR does not pass CI yet. This label is automatically removed once it does. label Jan 28, 2026
Comment thread Mathlib/Tactic/Linter/Style.lean Resolved
Comment thread Mathlib/Tactic/Linter/Style.lean Resolved
Comment thread Mathlib/Tactic/Linter/Style.lean Resolved
Comment thread Mathlib/Tactic/Linter/Style.lean Resolved
@joneugster joneugster added the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label Jan 30, 2026
@joneugster joneugster self-assigned this Jan 30, 2026
@grunweg

grunweg commented Jan 30, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the review! I have addressed or responded to all comments.

@grunweg grunweg removed the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label Jan 30, 2026
@grunweg grunweg added awaiting-CI This PR does not pass CI yet. This label is automatically removed once it does. and removed please-adopt Inactive PR (would be valuable to adopt) labels Jul 1, 2026
@mathlib-merge-conflicts mathlib-merge-conflicts Bot added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Jul 17, 2026
@mathlib-merge-conflicts

Copy link
Copy Markdown

This pull request has conflicts, please merge master and resolve them.

@github-actions github-actions Bot removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Nov 29, 2026
@github-actions github-actions Bot removed the awaiting-CI This PR does not pass CI yet. This label is automatically removed once it does. label Nov 30, 2026
@grunweg grunweg removed the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label Nov 30, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t-linter Linter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants