Skip to content
whyvineetPublic

About

Compare Python type checkers across one codebase and see which diagnostics actually agree.

Topics

Resources

Stars

6 stars

Watchers

0 watching

Forks

Latest commit

 

History

63 Commits

Folders and files

Repository files navigation

rety

One codebase. Multiple type checkers. One honest view.

PyPI Python Downloads CI License

mypy pyright pyrefly ty

Install · Usage · Development · License

Warning

Work in progress: This project is still under active development. You may hit bugs or unexpected behavior.

rety runs mypy, Pyright, Pyrefly, and ty on the same Python code, normalizes their diagnostics, and shows where they agree, where they disagree, and why.

$ rety check src/

  src/api.py ────────────────────────────────────────────────
  3/4  * HIGH  L42  in handle_request  [Call]
      mypy      error    42:18  Argument 1 to "process" has incompatible type "str"; expected "int" [arg-type]
      pyright   error    42:18  Argument of type "str" cannot be assigned to parameter "x" of type "int" [reportArgumentType]
      pyrefly   error    42:18  Expected `int`, got `str` [bad-argument-type]

Install

pipx install rety
# or
uv tool install rety

Tip

rety doesn't bundle the checkers. Run pip install mypy pyright pyrefly ty to get all four.

Usage

rety check src/                          # run all available checkers
rety check --checker mypy,pyright src/   # run specific checkers
rety check --format json src/            # machine-readable output
rety check --verbose src/                # show why diagnostics were grouped
rety check --fail-on error src/          # exit 1 on errors (for CI)
rety check --python .venv/bin/python src/  # make every checker use your project's environment

Exit codes: 0 done, 1 --fail-on threshold met, 2 usage error or no checker available, 3 a checker crashed, timed out or rejected its config (the report is incomplete).

Use as a library

from rety import ALL_ADAPTERS, run_checkers
from rety.align import align

adapters = [ALL_ADAPTERS[name]() for name in ("mypy", "pyright")]
results = run_checkers(adapters, paths=["src"], cwd="/path/to/project")
diagnostics = [d for r in results if r.succeeded for d in r.diagnostics]
for cluster in align(diagnostics, root="/path/to/project"):
    print(cluster.checkers_present, cluster.confidence, cluster.file)

Development

uv sync --all-groups
uv run pytest -q
uv run mypy src
uv run ruff check src tests

License

MIT

About

Compare Python type checkers across one codebase and see which diagnostics actually agree.

Topics

Resources

Stars

6 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages