FormalConjecturesUtil/Linters/CopyrightLinter.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

5 declarations, 0 contain sorry, 0 declared as axioms

The copyright linter

This file implements a linter that checks that every file in the project has the correct copyright header.

Imports (1)
Imported by 1 file
  1. def CopyrightLinter.correctCopyrightPrefix The part of the expected copyright before the year line 34 source

    Source documentation

    The part of the expected copyright before the year.

    no axioms what this means

    Statement uses: String

    def correctCopyrightPrefix : String :=
    …
  2. def CopyrightLinter.correctCopyrightSuffix The part of the expected copyright after the year line 39 source

    Source documentation

    The part of the expected copyright after the year.

    no axioms what this means

    Statement uses: String

    def correctCopyrightSuffix : String :=
    …
  3. def CopyrightLinter.hasCorrectCopyright Check whether a file, given as a String, is prefixed with the correct copyright header line 56 source

    Source documentation

    Check whether a file, given as a String, is prefixed with the correct copyright header.

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

    Statement uses: String, Bool

    Proof uses: Id.run, Option, String.Slice, Id, String.dropPrefix?, CopyrightLinter.correctCopyrightPrefix, String.isPrefixOf, CopyrightLinter.correctCopyrightSuffix, String.Slice.extract, String.Slice.Pos.nextn, String.Slice.startPos, OfNat.ofNat, Nat, String.Slice.endPos, Bool.false

    3 instances, coercions and auxiliary constants left out.

    def hasCorrectCopyright (file : String) : Bool := Id.run do
    …
  4. def CopyrightLinter.correctCopyrightHeader The current correct copyright header line 61 source

    Source documentation

    The current correct copyright header.

    standard axioms: propext what this means

    Statement uses: String

    Proof uses: HAppend.hAppend, CopyrightLinter.correctCopyrightPrefix, CopyrightLinter.correctCopyrightSuffix

    2 instances, coercions and auxiliary constants left out.

    def correctCopyrightHeader : String := correctCopyrightPrefix ++ "2026" ++ correctCopyrightSuffix
    …

    Mentions: CopyrightLinter.correctCopyrightPrefix, CopyrightLinter.correctCopyrightSuffix

  5. def CopyrightLinter.copyrightLinter The copyright linter ensures that every file has the right copyright header line 75 source

    Source documentation

    The copyright linter ensures that every file has the right copyright header.

    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, Bind.bind, Lean.Elab.Command.CommandElabM, String, Unit, Lean.MonadLog.getFileName, ite, Eq, Bool, String.endsWith, Bool.true, Pure.pure, Lean.Elab.Command.Context, StateRefT', IO.RealWorld, Lean.Elab.Command.State, EIO, Lean.Exception and 24 more

    19 instances, coercions and auxiliary constants left out.

    def copyrightLinter : Linter where run := withSetOptionIn fun stx ↦ do
    …