FormalConjecturesUtil/Linters/CategoryDocstringLinter.lean

GitHub source file

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

3 declarations, 0 contain sorry, 0 declared as axioms

The Category Docstring Linter

The CategoryDocstringLinter ensures that declarations tagged as @[category research open], @[category research solved], or @[category textbook] have a docstring.

Imports (2)
Imported by 2 files
  1. def CategoryDocstringLinter.categoryNeedsDocstring Whether the given category requires a docstring line 39 source

    Source documentation

    Whether the given category requires a docstring.

    standard axioms: propext what this means

    Statement uses: ProblemAttributes.Category, Bool

    Proof uses: Unit, Bool.true, Bool.false

    1 instances, coercions and auxiliary constants left out.

    def categoryNeedsDocstring : ProblemAttributes.Category → Bool
      | .research .open | .research .solved | .textbook => true
      | _ => false
    
    /-- Whether the declaration modifiers contain a docstring. -/

    Mentions: ProblemAttributes.Category

  2. def CategoryDocstringLinter.hasDocstring Whether the declaration modifiers contain a docstring line 44 source

    Source documentation

    Whether the declaration modifiers contain a docstring.

    standard axioms: propext what this means

    Statement uses: Lean.TSyntax, List.cons, Lean.SyntaxNodeKind, Lean.Name.mkStr4, List.nil, Bool

    Proof uses: Lean.Syntax, GetElem?.getElem!, Nat, True, Lean.TSyntax.raw, OfNat.ofNat, Bool.not, String.isEmpty, Lean.Syntax.getAtomVal

    5 instances, coercions and auxiliary constants left out.

    def hasDocstring (stx : TSyntax ``Command.declModifiers) : Bool :=
    …
  3. def CategoryDocstringLinter.categoryDocstringLinter The linter checking for docstrings on research statements line 49 source

    Source documentation

    The linter checking for docstrings on research statements.

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: Lean.Elab.Command.Linter

    Proof uses: Lean.Elab.Command.Linter.mk, Lean.withSetOptionIn, Lean.Syntax, ite, Lean.Elab.Command.CommandElabM, Unit, Eq, Bool, Lean.Syntax.isOfKind, Lean.Name.mkStr4, Bool.true, Lean.Syntax.getArg, OfNat.ofNat, Nat, cond, Bool.or, Bool.false, Lean.TSyntax, List.cons, Lean.SyntaxNodeKind and 31 more

    13 instances, coercions and auxiliary constants left out.

    def categoryDocstringLinter : Linter where
    …