leanprover-community / leanprover-community/mathlib4

Properly silence the docPrime linter in downstream projects

Open
#20,560 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Lean
Stars
4.2k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Description

The docPrime linter uses the file scripts/nolints_prime_decls.txt to keep track of which primed declarations already existed when the linter was created and should not be flagged by the linter.

This works well for mathlib, but downstream projects get flooded by warnings when they build mathlib from scratch, instead of downloading the cache via lake exe cache get.

The reason is that the linter looks for the file in scripts/nolints_prime_decls.txt, does not find it in the downstream project and therefore complains about all primed declarations. Once the cache has been saved with the linter warnings, lake then replays it every time.

For this reason, the docPrime linter is now disabled in mathlib.

See these previous Zulip discussions:

#20559 is the PR where the linter was disabled.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the docPrime linter and its use of scripts/nolints_prime_decls.txt, then review the linked Zulip discussions and PR #20559. Reproduce a downstream build without the cache and compare the warnings with a cached build. Done means downstream projects no longer receive the flood of docPrime warnings when building mathlib from scratch.

Written by the indexing model from the issue text.

Assessment

Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.