lean4-htt/src/Lean/Linter.lean
Paul Reichert 9d7d15b276
feat: lint coercions that are deprecated or banned in core (#11511)
This PR implements a linter that warns when a deprecated coercion is
applied. It also warns when the `Option` coercion or the
`Subarray`-to-`Array` coercion is used in `Init` or `Std`. The linter is
currently limited to `Coe` instances; `CoeFun` instances etc. are not
considered.

The linter works by collecting the `Coe` instance declaration names that
are being expanded in `expandCoe?` and storing them in the info tree.
The linter itself then analyzes the info tree and checks for banned or
deprecated coercions.
2025-12-12 15:09:13 +00:00

20 lines
594 B
Text

/-
Copyright (c) 2022 Lars König. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Lars König
-/
module
prelude
public import Lean.Linter.Util
public import Lean.Linter.Builtin
public import Lean.Linter.ConstructorAsVariable
public import Lean.Linter.Deprecated
public import Lean.Linter.DocsOnAlt
public import Lean.Linter.UnusedVariables
public import Lean.Linter.MissingDocs
public import Lean.Linter.Omit
public import Lean.Linter.List
public import Lean.Linter.Sets
public import Lean.Linter.UnusedSimpArgs
public import Lean.Linter.Coe