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:

Returns true if decl is an automatically generated declaration.

Also returns true if decl is an internal name or created during macro expansion.

Instances For

    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 declaration name.

        Instances For

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

          Defines the @[builtin_env_linter] attribute for adding a linter to the default set. The form @[builtin_env_linter extra] will not add the linter to the default set, but it can be selected by lake builtin-lint --extra.

          Linters are named using their declaration names, without the namespace. These must be distinct.

          Instances For