Skip to content

๐Ÿ‹ Docker base pre-commit-hooks

License

Notifications You must be signed in to change notification settings

virtualroot/pre-commit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

28 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

pre-commit

tests

Operative system agnostic hooks

Using pre-commit-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: ...

Hooks available

dockerfile-lint

Lint Dockerfiles with hadolint.

golang-staticcheck

Ling golang files with staticcheck.

golang-golint

Lint golang files with golint.

Add a new hook

  • 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

License

MIT