Skip to content

chore: forbid prime (') in filenames, rename LinearCombination'#35518

Open
kim-em wants to merge 2 commits intomasterfrom
kim/no-prime-filenames
Open

chore: forbid prime (') in filenames, rename LinearCombination'#35518
kim-em wants to merge 2 commits intomasterfrom
kim/no-prime-filenames

Conversation

@kim-em
Copy link
Copy Markdown
Contributor

@kim-em kim-em commented Feb 19, 2026

This PR renames Mathlib/Tactic/LinearCombination'.lean to LinearCombinationPrime.lean (and the corresponding test file), and adds a lint check to modulesOSForbidden to prevent future files with prime/apostrophe characters in their names.

The ' character in filenames causes shell escaping issues in scripts (any find ... -name '*.lean' or similar pattern needs careful quoting to handle these files correctly).

🤖 Prepared with Claude Code

@github-actions
Copy link
Copy Markdown

github-actions bot commented Feb 19, 2026

PR summary 7d9358ee9d

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference
Mathlib.Tactic.LinearCombination' -520
Mathlib.Tactic.LinearCombinationPrime 520

Declarations diff

No declarations were harmed in the making of this PR! 🐙

You can run this locally as follows
## summary with just the declaration names:
./scripts/pr_summary/declarations_diff.sh <optional_commit>

## more verbose report:
./scripts/pr_summary/declarations_diff.sh long <optional_commit>

The doc-module for scripts/pr_summary/declarations_diff.sh contains some details about this script.


No changes to technical debt.

You can run this locally as

./scripts/reporting/technical-debt-metrics.sh 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).

note: file Mathlib/Tactic/LinearCombination'.lean` was renamed to `Mathlib/Tactic/LinearCombinationPrime.lean without a module deprecation
Please create a follow-up pull request adding one. Thanks!

note: file MathlibTest/linear_combination'.lean` was renamed to `MathlibTest/linear_combination_prime.lean without a module deprecation
Please create a follow-up pull request adding one. Thanks!

@github-actions github-actions bot added the file-removed A Lean module was (re)moved without a `deprecated_module` annotation label Feb 19, 2026
@euprunin
Copy link
Copy Markdown
Contributor

Thank you for addressing this small but annoying developer experience issue.

This closes #25244 .

After this change all filenames in the repo will match on ^[a-zA-Z0-9_./-]*$:

% git ls-files | grep -vE '^[a-zA-Z0-9_./-]*$'
Mathlib/Tactic/LinearCombination'.lean
MathlibTest/linear_combination'.lean

@eric-wieser
Copy link
Copy Markdown
Member

The ' character in filenames causes shell escaping issues in scripts (any find ... -name '*.lean' or similar pattern needs careful quoting to handle these files correctly).

My take on this is that we should avoid writing bash scripts in the first place, either because Python is by all reasonable metrics a safer language, or because we should be dog-fooding ourselves writing our scripts in Lean instead.

While I wouldn't say that keeping these primes is the correct strategy to increase the quality of the mathlib scripts, it probably is an effective one.

@euprunin
Copy link
Copy Markdown
Contributor

Filenames are infrastructure. Infrastructure should be maximally boring and frictionless.

Avoiding ' in filenames isn’t about tool preference: it’s about minimizing edge cases in a shared ecosystem.

Even with Python or Lean tooling, users still interact with Git and shells directly, and quoting issues remain.

@kim-em
Copy link
Copy Markdown
Contributor Author

kim-em commented Mar 4, 2026

The ' character in filenames causes shell escaping issues in scripts (any find ... -name '*.lean' or similar pattern needs careful quoting to handle these files correctly).

My take on this is that we should avoid writing bash scripts in the first place, either because Python is by all reasonable metrics a safer language, or because we should be dog-fooding ourselves writing our scripts in Lean instead.

While I wouldn't say that keeping these primes is the correct strategy to increase the quality of the mathlib scripts, it probably is an effective one.

I presume this is tongue-in-cheek and not an actual objection.

@kim-em
Copy link
Copy Markdown
Contributor Author

kim-em commented Mar 4, 2026

The deprecated module files would need to have ' in their filenames, which would be caught by the new linter added in this PR. So no deprecation for these.

@MichaelStollBayreuth MichaelStollBayreuth added the t-meta Tactics, attributes or user commands label Mar 9, 2026
@MichaelStollBayreuth MichaelStollBayreuth removed their assignment Mar 9, 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 Mar 13, 2026
@mathlib-merge-conflicts
Copy link
Copy Markdown

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

@grunweg grunweg added the LLM-generated PRs with substantial input from LLMs - review accordingly label Mar 16, 2026
@adamtopaz adamtopaz removed their assignment Mar 21, 2026
kim-em and others added 2 commits April 2, 2026 06:04
The apostrophe/prime character in filenames causes shell escaping issues
in scripts. This renames the two affected files and adds a lint check
to prevent new files with primes in their names.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@kim-em kim-em force-pushed the kim/no-prime-filenames branch from 04c6231 to b5c59ee Compare April 2, 2026 06:04
@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 Apr 2, 2026
Copy link
Copy Markdown
Contributor

@euprunin euprunin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

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

Labels

file-removed A Lean module was (re)moved without a `deprecated_module` annotation LLM-generated PRs with substantial input from LLMs - review accordingly t-meta Tactics, attributes or user commands

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants