Sitelet https://github.com/whyvineet/rety
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

68 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

Code Meaning
0 Run completed and the --fail-on threshold was not met
1 The --fail-on threshold was met
2 Usage error, no checker available, or --require-all not satisfied
3 A checker crashed, timed out, or rejected its config (the report is incomplete)

By default (--fail-on none) rety exits 0 whenever the run itself succeeded, regardless of what the checkers found.

Confidence scores

Confidence reflects cross-checker evidence only:

Badge Meaning
* HIGH Two different checkers report exactly the same line range
~ MED Two different checkers report overlapping line ranges, or share an enclosing statement/--line-tolerance and belong to the same code family
- LOW Joined only through a shared enclosing statement or --line-tolerance (different code families), or a single checker reported here

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