We use pre-commit
to use the hooks in this projects
Using pip
:
pip install pre-commit
Using homebrew
:
brew install pre-commit
In you project create a file called .pre-commit-config.yaml
repos:
- repo: https://github.com/alessio-perugini/pp-git-hooks
rev: main
hooks:
- id: go-imports
args:
- "--docker-image"
- "prontopro/golang:1.19.0-2-dev"
- "--local=github.com/ProntoPro"
- id: go-lint
args: [-c=.golangci.yml]
- id: php-cbf
Then run the pre-commit install
to set up the git hook scripts.
If you want to run the script inside a docker container add the args:
args:
- "--docker-image"
- "prontopro/golang:1.19.0-2-dev"
Sometimes we may add or modify some hook scripts. Every time we commit a change in this repository, our users, who wants to receive the latest version, have to run:
pre-commit autoupdate
in the project which pre-commit
is in use
See .pre-commit-hooks.yaml
file in this repo