Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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: 4 days ago
JSON representation

Run hadolint in pre-commit without docker or system installation

Awesome Lists containing this project

README

        

# hadolint-py

[![Add new versions](https://github.com/AleksaC/hadolint-py/actions/workflows/add-new-versions.yml/badge.svg)](https://github.com/AleksaC/hadolint-py/actions/workflows/add-new-versions.yml)
[![Run tests](https://github.com/AleksaC/hadolint-py/actions/workflows/tests.yml/badge.svg)](https://github.com/AleksaC/hadolint-py/actions/workflows/tests.yml)
[![License](https://img.shields.io/badge/License-MIT-green.svg)](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)
- Twitter followers
- [email protected]