madoqua
A pre-commit hook for Python repos: fix what you staged, re-stage it, run the checks in parallel, say one line. Small, fast, silent until there's something to say.
pre-commit ok (3 py files, 1.8s, slowest: ty check 1.6s): ruff fix, ruff format applied & staged; ruff check, ty check passed
That is the entire output of a clean commit. A commit with a problem prints only the tool that had one.
Documentation · Configuration · Commands
Install
uv tool install madoqua
# or
pipx install madoqua
# or, per project
uv add --dev madoqua
Use
madoqua install # write hooks/pre-commit and point git at it
madoqua run # what the hook does; also what a bare `madoqua` does
madoqua stats # what the hook has been costing you
madoqua needs a virtualenv at <repo_root>/.venv with the tools it calls
installed — it refuses to run a ruff from outside it, because a version that
disagrees with CI produces failures that look like your code's fault. With the
defaults that means uv venv && uv sync.
Configure
Zero configuration gets you ruff check --fix, ruff format, ruff check and
ty check. To change that, add [tool.madoqua] to pyproject.toml:
[tool.madoqua]
fix = ["ruff check --fix --quiet", "ruff format --quiet"]
check = [
"ruff check --quiet",
{ name = "ty", cmd = "ty check", timeout_s = 120, max_output_lines = 200 },
]
hooks.local.toml in the repo's git directory — .git/hooks.local.toml in an
ordinary clone — is a personal, uncommitted overlay on the same schema:
check/fix replace a list, extend_check/extend_fix append to it, scalars
win. MADOQUA_SKIP="ty,ruff check" drops checks by name for one run.
See Configuration.
Exit codes
| Code | Meaning |
|---|---|
0 |
Clean — the commit may proceed |
1 |
A check failed, or the virtualenv guard refused — the commit is blocked |
2 |
The run could not complete — madoqua itself is misconfigured or broken |
Using it from Claude Code
Paste this into your project's CLAUDE.md:
## madoqua
`madoqua` is this repo's pre-commit hook. It runs the fixers on the staged
Python files, re-stages them, runs the checks in parallel, and prints one line.
It runs itself on `git commit` — invoke it directly to see what a commit would
say before making one.
```sh
madoqua guide # what to do here, right now
madoqua run # what `git commit` will do; one line if clean
MADOQUA_SKIP="ty check" madoqua run # drop a check by name, this run only
madoqua stats # which check is costing the most time
Start with madoqua guide: it prints setup instructions in a repo that is not
wired up yet, and triage instructions in one that is. madoqua guide tune is
the configuration reference.
Exit codes: 0 clean, 1 a check failed (the commit would be blocked), 2
madoqua could not run. Failing checks print only the failing tool's output, on
stderr.
Configuration is [tool.madoqua] in pyproject.toml. Set max_output_lines
on a noisy check to keep its failures inside a context window.
<!-- END SHARED:claude-snippet -->
## Development
```sh
make review-quick # fmt, clippy, tests
make review # the above plus cargo-audit and cargo-deny
make docs # build the mdBook site + llms.txt
make wheel # build the Python wheel with maturin
Installing from a checkout:
cargo install --path .
See docs/dev/ARCHITECTURE.md and
docs/adr/.
License
MIT — see LICENSE.
Metadata
Release files for madoqua 0.2.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| madoqua-0.2.3.tar.gz | 891.7 kB | With provenance | Details for madoqua-0.2.3.tar.gz |
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| madoqua-0.2.3-py3-none-win_amd64.whl | Python 3 | none | Windows x86-64 | Details for madoqua-0.2.3-py3-none-win_amd64.whl |
| madoqua-0.2.3-py3-none-manylinux_2_28_x86_64.whl | Python 3 | none | Linux glibc 2.28+ x86-64 | Details for madoqua-0.2.3-py3-none-manylinux_2_28_x86_64.whl |
| madoqua-0.2.3-py3-none-macosx_11_0_arm64.whl | Python 3 | none | macOS 11.0+ ARM64 | Details for madoqua-0.2.3-py3-none-macosx_11_0_arm64.whl |
Total release size: 3.3 MB
Release files / madoqua-0.2.3.tar.gz
| Download URL | madoqua-0.2.3.tar.gz |
|---|---|
| Size | 891.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2ac61df9a8311554952fcd9f9c3430f0047c92f7b07fb97b32f49e2076aec431
|
|
BLAKE2b-256 checksum How to use checksums |
b1d85757103ee84f26fb0675ca2d5888cfe213df2c100c993dc57639418a7697
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 8, 2026.
Transparency logRelease files / madoqua-0.2.3-py3-none-win_amd64.whl
| Download URL | madoqua-0.2.3-py3-none-win_amd64.whl |
|---|---|
| Size | 776.2 kB |
| Tags | Python 3 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
7c5c09df07253fce0f97f0b4cce27d18e436a24da9e326e33025581914eac2a8
|
|
BLAKE2b-256 checksum How to use checksums |
1690b005b17bd997811ed7ecc4c49a3abb19b1ffabb918515e3128d514769e51
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 8, 2026.
Transparency logRelease files / madoqua-0.2.3-py3-none-manylinux_2_28_x86_64.whl
| Download URL | madoqua-0.2.3-py3-none-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 869.5 kB |
| Tags | Linux glibc 2.28+ x86-64 Python 3 |
|
SHA-256 checksum How to use checksums |
cd3ffaadee3d17e9de7c93fde5d0599ea72c9ea3953527927ace82eae5cde93d
|
|
BLAKE2b-256 checksum How to use checksums |
380be26c19b0a7ee243727995de8b73bb8cb058ca503ece7fd5e9226c6c3b4aa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 8, 2026.
Transparency logRelease files / madoqua-0.2.3-py3-none-macosx_11_0_arm64.whl
| Download URL | madoqua-0.2.3-py3-none-macosx_11_0_arm64.whl |
|---|---|
| Size | 756.5 kB |
| Tags | Python 3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
932a94ef1504e7f58543515e059f92759fca8f4be302eb688be39f646a3406f1
|
|
BLAKE2b-256 checksum How to use checksums |
351e437826ae822943643a85e51a1f9a328b3cb729a1b319ded8e03c1272581f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 8, 2026.
Transparency logSecurity for madoqua 0.2.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 4 files in this release have been uploaded with provenance metadata.
Attestation for madoqua-0.2.3.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 8, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.