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

Versions follow the bundled hadolint release plus a wrapper patch digit: hadolint 2.15.1 → v2.15.1.0, v2.15.1.1, … — the trailing digit is a bug fix of this wrapper, not a new hadolint release (the hadolint version only changes when a new upstream release is bundled).

The PyPI version is derived automatically from the release tag (e.g. tag vX.Y.Z.W → PyPI version X.Y.Z.W) — reference the matching rev: in your .pre-commit-config.yaml. The rev: examples above point to the latest release. 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.3

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.3
File Size Uploaded Provenance Actions
hadolint_py-2.15.1.3.tar.gz 13.3 kB With provenance Details for hadolint_py-2.15.1.3.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for hadolint-py 2.15.1.3
File Actions
hadolint_py-2.15.1.3-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for hadolint_py-2.15.1.3-py3-none-win_amd64.whl
hadolint_py-2.15.1.3-py3-none-manylinux_2_17_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64 Details for hadolint_py-2.15.1.3-py3-none-manylinux_2_17_x86_64.whl
hadolint_py-2.15.1.3-py3-none-manylinux_2_17_aarch64.whl Python 3 none Linux glibc 2.17+ ARM64 Details for hadolint_py-2.15.1.3-py3-none-manylinux_2_17_aarch64.whl
hadolint_py-2.15.1.3-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for hadolint_py-2.15.1.3-py3-none-macosx_11_0_arm64.whl
hadolint_py-2.15.1.3-py3-none-macosx_10_15_x86_64.whl Python 3 none macOS 10.15+ x86-64 Details for hadolint_py-2.15.1.3-py3-none-macosx_10_15_x86_64.whl

Total release size: 67.1 MB

Release files / hadolint_py-2.15.1.3.tar.gz

Download URL hadolint_py-2.15.1.3.tar.gz
Size 13.3 kB
Tags Source
SHA-256 checksum
How to use checksums
9f9a0aa6d5e31a5e39e67202f3e57e6826afac21cf5404edc82bc7e44db6b06c
BLAKE2b-256 checksum
How to use checksums
1f507247e68fefc7a183d71ec6dd71ee6c6be5d3ec3be4685f0ccb4ba07b9349
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.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 Oct 29, 2026.

Transparency log

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

Download URL hadolint_py-2.15.1.3-py3-none-win_amd64.whl
Size 15.6 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
828f049507aa14e75db4ce2ab87302e98cf9cea8ab2a691f9d2122a8f95a31f4
BLAKE2b-256 checksum
How to use checksums
c7a1ffd8a1bb94691007925324a2f2e20058229169bfc37aa582593843054c2b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.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 Oct 29, 2026.

Transparency log

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

Download URL hadolint_py-2.15.1.3-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
d52cd0f22c3070087bdabd20500d2fa68bcc1ec670a5e660302eb7b19cea5196
BLAKE2b-256 checksum
How to use checksums
addbf49006d8ab98b897dd6dcf70a3c4c8c2f3fa6a18c444bc7ca0a766028501
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.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 Oct 29, 2026.

Transparency log

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

Download URL hadolint_py-2.15.1.3-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
87408ef7c95c9d989ec5939e540304f5a56516f04733cd01587d11cb0b77b6d8
BLAKE2b-256 checksum
How to use checksums
96db0f1aae15f42038d9208d30ceeb235d35123cb3fd17e955f1bf8a28c72819
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.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 Oct 29, 2026.

Transparency log

Release files / hadolint_py-2.15.1.3-py3-none-macosx_11_0_arm64.whl

Download URL hadolint_py-2.15.1.3-py3-none-macosx_11_0_arm64.whl
Size 21.4 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
1887a9793d4fc7e4ca8398dd3d02070bd8ef54303c424d79d6c02ff53059cfc7
BLAKE2b-256 checksum
How to use checksums
e586c49e1fad523a8cf49245b2ec80f4b4796db578075e8b2895448832fd62aa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.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 Oct 29, 2026.

Transparency log

Release files / hadolint_py-2.15.1.3-py3-none-macosx_10_15_x86_64.whl

Download URL hadolint_py-2.15.1.3-py3-none-macosx_10_15_x86_64.whl
Size 4.9 MB
Tags Python 3 macOS 10.15+ x86-64
SHA-256 checksum
How to use checksums
87f75071c33990f20e14feb6a601faa7eba3f5040822c1241f747907edeb5e20
BLAKE2b-256 checksum
How to use checksums
3e6009c5f8c56574632750404dd300263cb231a4fcc986307771cb57785a23bd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.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 Oct 29, 2026.

Transparency log

Security for hadolint-py 2.15.1.3

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 6 files in this release have been uploaded with provenance metadata.

Select from 6 files

Attestation for hadolint_py-2.15.1.3.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 29, 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