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 },
]
.git/hooks.local.toml 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.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file madoqua-0.1.0.tar.gz.
File metadata
- Download URL: madoqua-0.1.0.tar.gz
- Upload date:
- Size: 883.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
11da662076cf51650b9aa29cefd8c07f9237dd2272fdfd64b46e3c44a3388e29
|
|
| MD5 |
d0a5bbe671f34ab1e38dd60d5c1661db
|
|
| BLAKE2b-256 |
67e3b92d3465410d9cb82f8081aea4bf1bbc4c434cf63d3e4435adc039f61418
|
Provenance
The following attestation bundles were made for madoqua-0.1.0.tar.gz:
Publisher:
release.yml on mojzis/madoqua
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
madoqua-0.1.0.tar.gz -
Subject digest:
11da662076cf51650b9aa29cefd8c07f9237dd2272fdfd64b46e3c44a3388e29 - Sigstore transparency entry: 2736359530
- Sigstore integration time:
-
Permalink:
mojzis/madoqua@48065e19dcfbc34e01d0bb6e16d6254924027cb1 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/mojzis
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@48065e19dcfbc34e01d0bb6e16d6254924027cb1 -
Trigger Event:
push
-
Statement type:
File details
Details for the file madoqua-0.1.0-py3-none-win_amd64.whl.
File metadata
- Download URL: madoqua-0.1.0-py3-none-win_amd64.whl
- Upload date:
- Size: 774.9 kB
- Tags: Python 3, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
791e3f31bcbd646775ed1c8ba3c4345074d3aa40d2de994908267ef25f6e8733
|
|
| MD5 |
82455a5bf32956b03d8c629626cfba77
|
|
| BLAKE2b-256 |
1a8ac1700d32f11aef7b38d24bea7d216c2d5f92cf20e548ff4aa1ed4dbbb14f
|
Provenance
The following attestation bundles were made for madoqua-0.1.0-py3-none-win_amd64.whl:
Publisher:
release.yml on mojzis/madoqua
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
madoqua-0.1.0-py3-none-win_amd64.whl -
Subject digest:
791e3f31bcbd646775ed1c8ba3c4345074d3aa40d2de994908267ef25f6e8733 - Sigstore transparency entry: 2736361021
- Sigstore integration time:
-
Permalink:
mojzis/madoqua@48065e19dcfbc34e01d0bb6e16d6254924027cb1 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/mojzis
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@48065e19dcfbc34e01d0bb6e16d6254924027cb1 -
Trigger Event:
push
-
Statement type:
File details
Details for the file madoqua-0.1.0-py3-none-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: madoqua-0.1.0-py3-none-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 867.5 kB
- Tags: Python 3, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ecc1a8c1246bfb1ef9c80890b0e0cfe0ff91f6f181d859081b9d25c38a691e57
|
|
| MD5 |
2962ea1eedcab228da0fae11ff6c578b
|
|
| BLAKE2b-256 |
be6aa658dddf02004d88658b6a9c7ef940df8d77a18a1a0fa8fe8f5dc77225ed
|
Provenance
The following attestation bundles were made for madoqua-0.1.0-py3-none-manylinux_2_28_x86_64.whl:
Publisher:
release.yml on mojzis/madoqua
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
madoqua-0.1.0-py3-none-manylinux_2_28_x86_64.whl -
Subject digest:
ecc1a8c1246bfb1ef9c80890b0e0cfe0ff91f6f181d859081b9d25c38a691e57 - Sigstore transparency entry: 2736361505
- Sigstore integration time:
-
Permalink:
mojzis/madoqua@48065e19dcfbc34e01d0bb6e16d6254924027cb1 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/mojzis
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@48065e19dcfbc34e01d0bb6e16d6254924027cb1 -
Trigger Event:
push
-
Statement type:
File details
Details for the file madoqua-0.1.0-py3-none-macosx_11_0_arm64.whl.
File metadata
- Download URL: madoqua-0.1.0-py3-none-macosx_11_0_arm64.whl
- Upload date:
- Size: 755.8 kB
- Tags: Python 3, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
260f9a7d0fc8a93762e97723018b80941c15416a35fc0211896b4c95afc9ba48
|
|
| MD5 |
4f67f86734acc6c3d9858e38dd24e46b
|
|
| BLAKE2b-256 |
734792b900ae5d4dceba341ca192fbc568555f8a4e907a72efe0a1144d487cb8
|
Provenance
The following attestation bundles were made for madoqua-0.1.0-py3-none-macosx_11_0_arm64.whl:
Publisher:
release.yml on mojzis/madoqua
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
madoqua-0.1.0-py3-none-macosx_11_0_arm64.whl -
Subject digest:
260f9a7d0fc8a93762e97723018b80941c15416a35fc0211896b4c95afc9ba48 - Sigstore transparency entry: 2736360069
- Sigstore integration time:
-
Permalink:
mojzis/madoqua@48065e19dcfbc34e01d0bb6e16d6254924027cb1 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/mojzis
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@48065e19dcfbc34e01d0bb6e16d6254924027cb1 -
Trigger Event:
push
-
Statement type: