Skip to main content

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 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 check     # every check on the whole repo; fixes and stages nothing
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 check                     # every check on the whole repo; fixes nothing
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.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for madoqua 0.2.8
File Size Uploaded Provenance Actions
madoqua-0.2.8.tar.gz 915.3 kB With provenance Details for madoqua-0.2.8.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for madoqua 0.2.8
File Interpreter ABI Platform Actions
madoqua-0.2.8-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for madoqua-0.2.8-py3-none-win_amd64.whl
madoqua-0.2.8-py3-none-manylinux_2_28_x86_64.whl Python 3 none Linux glibc 2.28+ x86-64 Details for madoqua-0.2.8-py3-none-manylinux_2_28_x86_64.whl
madoqua-0.2.8-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for madoqua-0.2.8-py3-none-macosx_11_0_arm64.whl

Total release size: 3.4 MB

Release files / madoqua-0.2.8.tar.gz

Download URL madoqua-0.2.8.tar.gz
Size 915.3 kB
Tags Source
SHA-256 checksum
How to use checksums
9686c932d00761261cfae0aab0a34720c51ed86d09f1ab2e8590e77ee8941958
BLAKE2b-256 checksum
How to use checksums
62985d82c0802e6b43c1fbd9c9e430f1b2eb7b4fcbdbfe329b58002dbc3d01b5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Oct 28, 2026.

Transparency log

Release files / madoqua-0.2.8-py3-none-win_amd64.whl

Download URL madoqua-0.2.8-py3-none-win_amd64.whl
Size 801.9 kB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
b8a7437bcce5a139de49ac814ef2739564a909bf53d12fa8141d6ba8a19c66ee
BLAKE2b-256 checksum
How to use checksums
4122e9ae202b7689ca91c29e373fea77b4d59ff6d760c328b8bc3036c96918fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Oct 28, 2026.

Transparency log

Release files / madoqua-0.2.8-py3-none-manylinux_2_28_x86_64.whl

Download URL madoqua-0.2.8-py3-none-manylinux_2_28_x86_64.whl
Size 893.6 kB
Tags Linux glibc 2.28+ x86-64 Python 3
SHA-256 checksum
How to use checksums
8c64aa959b713b5a7d5a71a5c3e272a3aaf5ed4d6d2633f11c8c1850ebb27961
BLAKE2b-256 checksum
How to use checksums
a16995a90c95c1ff630629aba26909cd7cbb5bdd97db1be1b3f521a29f472167
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Oct 28, 2026.

Transparency log

Release files / madoqua-0.2.8-py3-none-macosx_11_0_arm64.whl

Download URL madoqua-0.2.8-py3-none-macosx_11_0_arm64.whl
Size 775.5 kB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
e855024b9dd9f99f06b23238628d8b9f47745cada4541f6a7d0eba8255a4b8af
BLAKE2b-256 checksum
How to use checksums
40d4079474506f0afede430673b34a8946584cef888ce8fa5aadd7c1d129ee3f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Oct 28, 2026.

Transparency log

Security for madoqua 0.2.8

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.

Select from 4 files

Attestation for madoqua-0.2.8.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 Oct 28, 2026.

Transparency log

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page