The areas / V34. The tactics of Mathlib
Mathlib.Tactic.Linter.NumericProjection
3 declarations. Mathlib docs · Source
Linting against numeric projections
This linter lints against numeric projections in syntax, i.e. syntax of the form foo.2, and
suggests replacing it with the corresponding field name projection.
Structures tagged with @[allow_numeric_proj] are exempt from this linter, as are structures from
upstream that are hardcoded into the linter (since tag attributes do not allow tagging declarations
downstream).
TODO
- Should we necessarily see through type defs? Maybe we should insist that the typedefs themselves are tagged instead.
opaque Mathlib.Linter.allowNumericProjExt E1 #
Lean.TagAttribute
Structures Foo tagged with @[allow_numeric_proj] are exempt from the numericProjections
linter, and thus their projections are allowed to appear as numeric projections in syntax. E.g., if
foo : Foo, the linter will not warn on foo.2.
def Mathlib.Linter.allowsNumericProj E1 #
Lean.Environment → Lean.Name → Bool
Whether a term whose type has a head of structName is allowed to use numeric projections.
opaque Mathlib.Linter.linter.style.numericProjections E1 #
Lean.Option Bool
Lints against numeric structure projections such as foo.2, unless the projection acts on a
structure which has been registered as exempt from this linter via @[allow_numeric_proj].