Skip to content

Commit 9a87f17

Browse files
committed
fix: explicitly enable header linter (#31849)
In files that don't import `Mathlib.Init` but do import `Mathlib.Tactic.Linter.Header`, the linter didn't fire currently: the option is only enabled when we define `linter.mathlibStandardSet`. So in the Mathlib lakefile (but not for downstream projects) we should enable the linter explicitly. Not sure how we should test this, since it is a lakefile option. Spotted during review of #31820. Co-authored-by: Anne C.A. Baanen <vierkantor@vierkantor.com>
1 parent bf9761c commit 9a87f17

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lakefile.lean

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ require "leanprover-community" / "plausible" @ git "main"
2727
`lake build` uses them, as well as `Archive` and `Counterexamples`. -/
2828
abbrev mathlibOnlyLinters : Array LeanOption := #[
2929
`linter.mathlibStandardSet, true⟩,
30+
-- Explicitly enable the header linter, since the standard set is defined in `Mathlib.Init`
31+
-- but we want to run this linter in files imported by `Mathlib.Init`.
32+
`linter.style.header, true⟩,
3033
`linter.checkInitImports, true⟩,
3134
`linter.allScriptsDocumented, true⟩,
3235
`linter.pythonStyle, true⟩,

0 commit comments

Comments
 (0)