Hey! These docs are for version 2.8, which is no longer officially supported. Click here for the latest version, 2.18!

Adding a typechecker is almost identical to [adding a linter](🔗), except for these differences:

  1. Subclass `CheckRequest` from `pants.core.goals.check`, rather than `LintRequest`. Register a `UnionRule(CheckRequest, CustomCheckRequest)`.

  2. Return `CheckResults` in your rule—which is a collection of `CheckResult` objects—rather than returning `LintResults`. Both types are defined in `pants.core.goals.check`.

The rule will look like this:

Refer to [Add a linter](🔗). See [`pants/backend/python/typecheck/mypy/rules.py`](🔗) for an example of MyPy.