Adding a typechecker is almost identical to [adding a linter](🔗), except for these differences:
Subclass `
CheckRequest
` from `pants.core.goals.check
`, rather than `LintRequest
`. Register a `UnionRule(CheckRequest, CustomCheckRequest)
`.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.