Documentation

Mathlib.Lean.Linter

Additional utilities and boilerplate for the Linter API #

@[macro_inline]

Runs a CommandElabM action when the provided linter option is true.

This function assumes you have already called withSetOptionIn; use whenLinterActivated to do so automatically. At the start of linter code, whenLinterActivated should be preferred when possible.

Note: this definition is marked as @[macro_inline], so it is okay to supply it with a linter option which has been registered in the same module.

Equations
Instances For
    @[macro_inline]

    Runs a CommandElabM action when the provided linter option is false.

    Note: this definition is marked as @[macro_inline], so it is okay to supply it with a linter option which has been registered in the same module.

    Equations
    Instances For
      @[macro_inline]

      Processes set_option ... ins that wrap the input stx, then acts on the inner syntax with x after checking that the provided linter option is true.

      If breakOnError is true (the default), avoids running the linter when errors are present.

      This is typically used to start off linter code:

      def myLinter : Linter where
        run := whenLinterActivated linter.myLinter fun stx ↦ do
          ...
      

      Note: this definition is marked as @[macro_inline], so it is okay to supply it with a linter option which has been registered in the same module.

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