Pre-commit / Prek hook for Zuban.
Example .pre-commit-config.yaml:
repos:
- repo: https://github.com/zubanls/zuban-pre-commit
rev: v0.10.2
hooks:
# Run `zuban check`
- id: zuban
args: [--pretty] # optional
# Run `zuban mypy`
- id: zmypy
args: [--warn-unreachable] # optionalCommand-line arguments are optional. You can read more about the available options in the Zuban CLI documentation.
Most configuration should live in:
pyproject.tomlunder[tool.zuban], ormypy.ini
See the configuration reference for more details.
Note
zuban checkauto-detects its mode based on CLI flags and project configuration ([tool.zuban],[tool.mypy], ormypy.ini).Use the
zmypyhook to explicitly runzuban mypy.
Example prek.toml:
[[repos]]
repo = "https://github.com/zubanls/zuban-pre-commit"
rev = "v0.10.2"
hooks = [
{ id = "zuban", args = ["--pretty"] }, # default / auto-detected mode
{ id = "zmypy", args = ["--warn-unreachable"] }, # force mypy-compatible mode
]zuban: runszuban checkzmypy: runszuban mypy