Documentation

Lean.Linter.EnvLinter.Basic

Basic environment linter types and attributes #

This file defines the basic types and attributes used by the environment linting framework. An environment linter consists of a function (declaration : Name) → MetaM (Option MessageData), this function together with some metadata is stored in the EnvLinter structure. We define two attributes:

An environment linting test for the lake builtin-lint command.

  • test defines a test to perform on every declaration. It should never fail. Returning none signifies a passing test. Returning some msg reports a failing test with error msg.

  • noErrorsFound : MessageData

    noErrorsFound is the message printed when all tests are negative

  • errorsFound : MessageData

    errorsFound is printed when at least one test is positive

  • isDefault : Bool

    If isDefault is false, this linter is only run when --extra is passed.

Instances For

    A NamedEnvLinter is an environment linter associated to a particular declaration.

    Instances For

      Gets an environment linter by option name.

      Equations
      Instances For

        Defines the envLinterExt extension for adding an environment linter to the default set.

        Defines the builtin_env_linter attribute for registering an environment linter. Each environment linter needs to have a registered Boolean-value Lean.Option that will be associated with it by providing the option name in the attribute, i.e. @[builtin_env_linter linter.envLinter.myLinter].

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For