https://github.com/aleksac/hadolint-py
Run hadolint in pre-commit without docker or system installation
https://github.com/aleksac/hadolint-py
dockerfile-linter hadolint pip pre-commit pre-commit-hook
Last synced: 2 days ago
JSON representation
Run hadolint in pre-commit without docker or system installation
- Host: GitHub
- URL: https://github.com/aleksac/hadolint-py
- Owner: AleksaC
- License: mit
- Created: 2020-12-13T16:40:07.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-05-10T20:45:55.000Z (12 months ago)
- Last Synced: 2025-04-17T08:33:32.886Z (5 days ago)
- Topics: dockerfile-linter, hadolint, pip, pre-commit, pre-commit-hook
- Language: Python
- Homepage:
- Size: 45.9 KB
- Stars: 31
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# hadolint-py
[](https://github.com/AleksaC/hadolint-py/actions/workflows/add-new-versions.yml)
[](https://github.com/AleksaC/hadolint-py/actions/workflows/tests.yml)
[](LICENSE)A python package that provides a pip-installable
[hadolint](https://github.com/hadolint/hadolint) binary.The mechanism by which the binary is downloaded is basically copied from
[shellcheck-py](https://github.com/shellcheck-py/shellcheck-py).## Getting started
### Installation
The package hasn't been published to PyPI yet, and may never be, as its primary
purpose doesn't require it. However you can install it through git:```shell script
pip install git+https://github.com/AleksaC/[email protected]
```To install another version simply replace the v2.12.0 with the version you want.
### With pre-commit
This package was primarily built to provide a convenient way of running hadolint
as a [pre-commit](https://pre-commit.com) hook, since haskell isn't supported by
pre-commit. An alternative to this solution is to create a docker hook since
hadolint provides a docker image, but I think that it has unnecessary amount of overhead.Example `.pre-commit-config.yaml` with rules `DL3025` and `DL3018` excluded:
```yaml
repos:
- repo: https://github.com/AleksaC/hadolint-py
rev: v2.12.1b3
hooks:
- id: hadolint
args: [--ignore, DL3025, --ignore, DL3018]
```## Contact 🙋♂️
- [Personal website](https://aleksac.me)
-![]()
- [email protected]