Skip to main content

hadolint-pre-commit

CI PyPI version PyPI - Python Version License: MIT pre-commit

A pre-commit hook for hadolint that automatically downloads and installs the hadolint binary — no manual installation required.

Background

The official hadolint/hadolint repository provides a pre-commit hook configuration, but it does not auto-install the hadolint binary. Users who add it to their .pre-commit-config.yaml are met with:

Executable `hadolint` not found

This is a known, long-standing issue that affects everyone who tries to use hadolint as a zero-dependency pre-commit hook. The official hook assumes you have already installed hadolint separately (e.g. via brew install hadolint), which defeats the purpose of a self-contained pre-commit integration.

This project solves that problem. It distributes the official, pre-built hadolint binary through PyPI as a platform-specific wheel. When pre-commit sets up the hook environment, it runs pip install hadolint-py automatically — and your binary is ready to use.

Usage

Add the following to your .pre-commit-config.yaml:

repos:
  - repo: https://github.com/shenxianpeng/hadolint-pre-commit
    rev: v2.15.1.1
    hooks:
      - id: hadolint

Run pre-commit install and the hadolint binary will be downloaded and installed automatically. That's it.

Passing arguments

You can pass any hadolint CLI argument via the args key:

repos:
  - repo: https://github.com/shenxianpeng/hadolint-pre-commit
    rev: v2.15.1.1
    hooks:
      - id: hadolint
        args: [--ignore, DL3008, --ignore, DL3009]

Using a configuration file

hadolint supports a .hadolint.yaml file in your project root. Create it alongside your Dockerfiles:

# .hadolint.yaml
ignore:
  - DL3008  # Pin versions in apt-get install
  - DL3009  # Delete the apt-get lists after installing

failure-threshold: warning
trustedRegistries:
  - docker.io
  - gcr.io

When a .hadolint.yaml is present, hadolint picks it up automatically — no extra args needed.

How it works

This package ships the hadolint binary via PyPI using setuptools-download. When pip install hadolint-py is run (which pre-commit does automatically), the appropriate pre-built binary for your platform is downloaded from the official hadolint GitHub releases and placed in your environment's bin/ directory (or Scripts/ on Windows).

Supported platforms

OS Architecture
Linux x86_64
Linux arm64
macOS x86_64
macOS arm64
Windows x86_64

Comparison with alternatives

Approach Auto-installs binary Works offline after install Cross-platform Zero extra setup
This project ✅ ✅ ✅ ✅
hadolint/hadolint official hook ❌ (requires pre-installed hadolint) ✅ ✅ ❌
brew install hadolint + system hook ❌ (manual step) ✅ ⚠️ macOS only ❌
Docker-based hook ✅ ✅ ✅ ❌ (requires Docker)

Install as a standalone tool

You can also use hadolint-py outside of pre-commit as a standalone CLI tool:

pip install hadolint-py
hadolint --version
hadolint Dockerfile

Versioning

The PyPI version is derived automatically from the release tag (e.g. tag v2.15.1.1 → PyPI version 2.15.1.1) — reference the matching rev: in your .pre-commit-config.yaml. See CONTRIBUTING.md for the release process.

Contributing

Contributions are welcome! Please open an issue or pull request on GitHub.

License

MIT

Metadata

Release files for hadolint-py 2.15.1.2

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

Source distribution (sdist)

Source distribution for hadolint-py 2.15.1.2
File Size Uploaded
hadolint_py-2.15.1.2.tar.gz 8.3 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for hadolint-py 2.15.1.2
File
hadolint_py-2.15.1.2-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details
hadolint_py-2.15.1.2-py3-none-manylinux_2_17_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64 Details
hadolint_py-2.15.1.2-py3-none-manylinux_2_17_aarch64.whl Python 3 none Linux glibc 2.17+ ARM64 Details
hadolint_py-2.15.1.2-py3-none-macosx_10_15_universal2.whl Python 3 none macOS 10.15+ universal2 (ARM64, x86-64) Details

Total release size: 62.2 MB

Release files / hadolint_py-2.15.1.2.tar.gz

Download URL hadolint_py-2.15.1.2.tar.gz
Size 8.3 kB
Tags Source
SHA-256 checksum
How to use checksums
2bab20951d5497461c1c15350d6af97866fdb2842af77777a8bfe8a3668c07ec
BLAKE2b-256 checksum
How to use checksums
b536ca7181bda86742dcc26853b729a04b35aeb0d1ecdc810f39527c896f7574
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.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 Jul 31, 2026.

Transparency log

Release files / hadolint_py-2.15.1.2-py3-none-win_amd64.whl

Download URL hadolint_py-2.15.1.2-py3-none-win_amd64.whl
Size 15.6 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
dc636b2c96f61e372bf016703cbe07b3b31e9a16b6995f6175fd974f2474c5fd
BLAKE2b-256 checksum
How to use checksums
49341029ec8a3ecb1a680be72d2754250fd4e26145b63e4b9ddc7214e7213755
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.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 Jul 31, 2026.

Transparency log

Release files / hadolint_py-2.15.1.2-py3-none-manylinux_2_17_x86_64.whl

Download URL hadolint_py-2.15.1.2-py3-none-manylinux_2_17_x86_64.whl
Size 12.2 MB
Tags Linux glibc 2.17+ x86-64 Python 3
SHA-256 checksum
How to use checksums
4d0c2e4c2569fddc8774072690f0d23abf5643d69a9bb64277f5d0c8fabd49bd
BLAKE2b-256 checksum
How to use checksums
45c26039d33dbdc3c909c8b4ea598a8b0231e430747f7189d46b140a4aeeed9b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.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 Jul 31, 2026.

Transparency log

Release files / hadolint_py-2.15.1.2-py3-none-manylinux_2_17_aarch64.whl

Download URL hadolint_py-2.15.1.2-py3-none-manylinux_2_17_aarch64.whl
Size 13.1 MB
Tags Linux glibc 2.17+ ARM64 Python 3
SHA-256 checksum
How to use checksums
e85fda1da903e53b892a698c2e0eff7cea1f2e90f87f5f29bebbdbf0d4d8e332
BLAKE2b-256 checksum
How to use checksums
3a282d8d8819031b9c4171784acd892eff957a121641686737f4e321aed86acc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.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 Jul 31, 2026.

Transparency log

Release files / hadolint_py-2.15.1.2-py3-none-macosx_10_15_universal2.whl

Download URL hadolint_py-2.15.1.2-py3-none-macosx_10_15_universal2.whl
Size 21.4 MB
Tags Python 3 macOS 10.15+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
58b641d14257ec3a4ec1e5c2677068b951c3804c629a8e732be570def2c09231
BLAKE2b-256 checksum
How to use checksums
d62ffafcaae9e38a4a128663ad3302bc9a40c4b852fdf4ed7cfbc99472e5336a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.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 Jul 31, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

2.15.1.2 This release

5 release files

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