Physlib.Meta.Linters.Sorry
The linter for `sorry` declarations and the sorryful attribute
This module defines an attribute `sorryful` and a linter `noSorry`.
The attribute `sorryful` adds the declaration to an environment extension `sorryfulExtension` which can be used to create TODO entries.
The linter `noSorry` checks for declarations that contain the `sorryAx` axiom if and only if it has the `sorryful` attribute.
Coloring `sorryful`
It is possible to color the `sorryful` attribute in VSCode. This is part of the `.vscode/settings.json` file, but requires the `TODO Highlight` extension to be downloaded.
The sorryful environment extension
The `pseudo` environment extension
The sorryful attribute
The pseudo attribute
6 declarations
Persistent Environment Extension for `sorryful` Declarations
The `sorryfulExtension` is a persistent environment extension that stores an array of metadata entries, each of type `SorryfulInfo`, corresponding to declarations annotated with the `sorryful` attribute. This extension allows the environment to maintain a registry of declarations that contain the `sorryAx` axiom (commonly known as "sorry"), facilitating the generation of TODO entries and linter checks.
Add a metadata entry for a `sorryful` declaration to the environment extension
This function, operating within a monad that has access to the global environment, adds a metadata entry to the `sorryfulExtension`. The entry consists of the declaration's name , its documentation string , the source file name , and the line number where the declaration is located.
The Environment Extension for `pseudo`-attributed Declarations
The `pseudoExtension` is a persistent environment extension used to store and manage information, specifically of type `PseudoInfo`, associated with declarations that have been marked with the `pseudo` attribute.
Add a declaration to the `pseudo` environment extension
For a monad with access to the environment (satisfying `MonadEnv`), the function `addPseudofulEntry` takes a declaration name and modifies the current environment by adding as a new entry to the `pseudoExtension`.
The `sorryful` attribute for `sorryAx` declarations
The `sorryful` attribute is a syntax element used to mark Lean declarations. It permits a declaration to contain the `sorryAx` axiom (representing an incomplete proof or definition). Conversely, any declaration marked with the `sorryful` attribute must contain the `sorryAx` axiom.
The `pseudo` attribute for `Lean.ofReduceBool` declarations
The `pseudo` attribute is a syntax attribute used to mark Lean declarations. It permits a declaration to contain the `Lean.ofReduceBool` axiom (an axiom used to lift boolean reductions to propositional proofs). Conversely, any declaration marked with the `pseudo` attribute is required to contain the `Lean.ofReduceBool` axiom.
