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.
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.
Whether a term whose type has a head of structName is allowed to use numeric projections.
Equations
- Mathlib.Linter.allowsNumericProj env structName = (Mathlib.Linter.upstreamAllowedâ.contains structName || Mathlib.Linter.allowNumericProjExt.hasTag env structName)
Instances For
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].