Show HN: I canceled my AI code reviewer and wrote a free local one
Avouch is a lightweight, Git-aware static analysis CLI for Python that helps identify structural problems in Python code before it is committed. It does not require a daemon, network, or path lists to maintain. Avouch analyzes only the files that will be touched by the next commit, parses them using the standard ast module, and reports any issues based on limits configured in avouch.toml. The tool requires Python 3.10+ and Git on PATH.
Avouch's interface consists of a single command with optional flags for review scope. The review scope is defined by Git, so there is no need to configure it at invocation time. Deleted paths and non-.py files are skipped, and committed, untouched files never appear in the output. Files that appear generated are also skipped.
The review can be scoped to changed, staged, or all files using the --changed, --staged, and --all-files flags respectively. These flags are mutually exclusive, so only one can be used at a time. Output can be formatted as JSON, verbose, or quiet. Colors are ANSI codes displayed only when stdout is a TTY, while piped output remains plain for clean CI capture. Runtime errors are written to stderr, ensuring clean stdout for piping and JSON capture.
Avouch exits with a 0 when the review is clean, 1 when findings are reported, and 2 when it cannot run. The --docs flag prints terminal documentation, which can then be used for automation and CI. The review document is a stable, versioned JSON contract, with the same input always producing the same output. Avouch can run as a GitHub Actions check on every pull request and push, providing exit codes that CI systems can interpret for job failures.
Written by urgent.news from Hacker News's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.