Operative system agnostic hooks
Install pre-commit and add this to your .pre-commit-config.yaml
- repo: https://github.com/virtualroot/pre-commit
rev: v... # Check latest version in Releases
hooks:
- id: dockerfile-lint
# - id: ...
Lint Dockerfiles with hadolint.
Ling golang files with staticcheck.
Lint golang files with golint.
- Add linter tool in Dockerfile
- Add hook following
language-linter_name
naming scheme - Rebuild Docker images with
docker build -t virtualroot/pre-commit:latest .
- Test your hook with
pre-commit try-repo . language-linter_name --files foobar
- Add test and fixtures