Skip to main content

hoglint

hoglint is a boundary linter for large Python and Django monorepos, built at PostHog.

It reads every Python file of a repo and builds one graph of the couplings between its packages: imports, dotted paths in strings, Django model and settings references, and more. It checks that graph against rules that you write in TOML. Existing violations go into a generated ledger file, so a rule can block new problems on the first day, before the old ones are fixed.

A Rust engine extracts the facts and judges the rules. A thin Python command line runs it.

Install

uv add --dev hoglint
uv run hoglint check

The wheel holds the Python package, the native module and the fact extractor, so you do not need a Rust toolchain. Wheels exist for Linux (x86_64 and aarch64, manylinux) and macOS (arm64 and x86_64). hoglint needs Python 3.14 or newer.

Configure

hoglint reads hoglint.toml at the root of the repo. The config can extend the built-in Django pack (extends = ["hoglint:django"]) and presets of your own. hoglint explain-config prints the expanded config, with the source of each key.

Commands

Command What it does
hoglint check Runs every rule on the working tree.
hoglint check --index Checks the staged snapshot. This is what the pre-commit hook runs.
hoglint check --write-ledger Rewrites the ledger from the scan. It adds new lines only with --record-growth.
hoglint ledger shrink Removes stale ledger lines. It never adds a line.
hoglint compare --base <ref> Checks a pull request against the merge base of <ref>.
hoglint explain <rule> Prints the page of a rule. It also explains the labels of a path or module.
hoglint query --by owners Lists open findings and accepted debt, grouped by owners, by target or by package (--by package, the package label of the module a line comes from). --json prints the counts per group, status and rule as one JSON object. A status is new (it blocks), advisory (its rule never blocks) or accepted (in the ledger).
hoglint map Prints the dependents map of the repo's Python files. It runs no rule.
hoglint watched Prints, for each group of a level, whether it claims and passes the level and which files it watches, as one JSON object. --map adds the dependents map from the same run.
hoglint --version Prints the installed version.

Exit codes

Exit Meaning
0 Clean.
1 Violations: new findings, code growth, a ledger that is not equal to the scan, or a stale exception.
2 hoglint cannot decide: new code that it cannot judge, a base engine that cannot run, or a config error.
3 hoglint could not run. It prints one line that says why.

The pre-commit hook

hoglint help hook prints what the hook checks, what each exit code means for the commit, and what to do about each problem.

Develop

To build from a checkout, see AGENTS.md: bin/build builds the extractor and the native module with the pinned Rust toolchain.

Metadata

Release files for hoglint 0.2.0

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

Built distributions (wheels)

Table of built distributions (wheels) for hoglint 0.2.0
File Actions
hoglint-0.2.0-cp312-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.12 abi3 Linux glibc 2.17+ x86-64 Details for hoglint-0.2.0-cp312-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
hoglint-0.2.0-cp312-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.12 abi3 Linux glibc 2.17+ ARM64 Details for hoglint-0.2.0-cp312-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
hoglint-0.2.0-cp312-abi3-macosx_11_0_arm64.whl CPython 3.12 abi3 macOS 11.0+ ARM64 Details for hoglint-0.2.0-cp312-abi3-macosx_11_0_arm64.whl
hoglint-0.2.0-cp312-abi3-macosx_10_12_x86_64.whl CPython 3.12 abi3 macOS 10.12+ x86-64 Details for hoglint-0.2.0-cp312-abi3-macosx_10_12_x86_64.whl

Total release size: 22.8 MB

Release files / hoglint-0.2.0-cp312-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL hoglint-0.2.0-cp312-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 5.9 MB
Tags CPython 3.12 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
f97fb58791b3671dd1aba3c5ac3a396c5f854ba0788dca9e294a3b2d40740135
BLAKE2b-256 checksum
How to use checksums
b304a0b845b400c3f67451f84e2854b0c5ece80cde7a37651b8c3d6c402c7810
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 Nov 17, 2026.

Transparency log

Release files / hoglint-0.2.0-cp312-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL hoglint-0.2.0-cp312-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 5.6 MB
Tags CPython 3.12 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
ae1d15f563833e7243d8cc30969e3d974d6faa30cdd1593f2edc964e2f72dc76
BLAKE2b-256 checksum
How to use checksums
d3ce4e5b5e4b0bb9484192bf299caeb7a3c3e138d6284b67b946f5fb82facd51
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 Nov 17, 2026.

Transparency log

Release files / hoglint-0.2.0-cp312-abi3-macosx_11_0_arm64.whl

Download URL hoglint-0.2.0-cp312-abi3-macosx_11_0_arm64.whl
Size 5.5 MB
Tags CPython 3.12 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
2130c03a40f9cbf59d0e987457c362fcf50ac4ea99a4b6b4a2613775ebc52afd
BLAKE2b-256 checksum
How to use checksums
22beced175ab8c1ebd7886c7c2446a30f578f56b5f17602bb679a189e90d432f
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 Nov 17, 2026.

Transparency log

Release files / hoglint-0.2.0-cp312-abi3-macosx_10_12_x86_64.whl

Download URL hoglint-0.2.0-cp312-abi3-macosx_10_12_x86_64.whl
Size 5.7 MB
Tags CPython 3.12 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
57244bf18a2aba5e476c476964e765a3eb3395e73fea1f4aa06f56dd0d4a267a
BLAKE2b-256 checksum
How to use checksums
c000d5eba720e993a1af70708a836b0848bbc02bb7db746db6ef1dee1dd5ab15
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 Nov 17, 2026.

Transparency log

Security for hoglint 0.2.0

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 hoglint-0.2.0-cp312-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

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 Nov 17, 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