FormalConjecturesUtil/Linters/ModuleDocstringLinter.lean
Explanation legend Lean4 Domain Explanation Language (L4DEL)
L4DEL explanations are a separate layer. They do not change the Lean source. Intuition is explanatory prose; numbered items are a reading path; sources link the wording back to evidence.
- L4DEL
- Lean4 Domain Explanation Language
Credit: The upstream authors and contributors retain credit for the project and mathematics. lean4-explainer only renders their pinned source and adds the separately disclosed explanation layer.
Project sources: Pinned project documentation, Formal Conjectures paper, arXiv v1
1 declarations, 0 contain sorry, 0 declared as axioms
The Module Docstring Linter
This file implements a linter that enforces module docstring hygiene:
- Missing module docstring: warns when a file has no
/-! ... -/block at all (detected on the first non-moduleDoccommand). - Duplicate module docstrings: warns when a file has more than one
/-! ... -/block (subsequent blocks should be regular/- ... -/comments).
Imports (1)
Imported by 2 files
- def
ModuleDocstringLinter.moduleDocstringLinterThe module docstring linter checks two things: - A file that has no `/-! line 53 sourceSource documentation
The module docstring linter checks two things:
- A file that has no
/-! ... -/block gets a warning on its first non-moduleDoccommand. - A file that has more than one
/-! ... -/block gets a warning on each extra block.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Lean.Elab.Command.LinterProof uses:
Lean.Elab.Command.Linter.mk,Lean.withSetOptionIn,Lean.Syntax,Bind.bind,Lean.Elab.Command.CommandElabM,String,Unit,Lean.MonadLog.getFileName,Lean.Environment,Lean.MonadEnv.getEnv,ite,Eq,Bool,BEq.beq,Lean.SyntaxNodeKind,Lean.Syntax.getKind,Lean.Name.mkStr4,Bool.true,Nat,HAdd.hAddand 34 more28 instances, coercions and auxiliary constants left out.
def moduleDocstringLinter : Linter where run := withSetOptionIn fun stx ↦ do …
- A file that has no