github.com/inturn/pre-commit-gobuild@v1.0.12/README.md (about) 1 # pre-commit-gobuild 2 3 The project contains pre-commit https://pre-commit.com/ hooks for building and running unit tests towards a go project. 4 The hooks are written on golang as the example of how it may be done. Of course, the same 5 functionality can be made with a bush script but with the golang script we can make the process 6 of building more flexible and adjusted for some personal needs. 7 8 This is the example of the .pre-commit-config.yaml settings file in order to use the hooks in the project: 9 10 ``` 11 fail_fast: false 12 repos: 13 - repo: git://github.com/guntenbein/pre-commit-gobuild 14 rev: HEAD 15 hooks: 16 - id: go-build 17 stages: [push] 18 - id: go-test 19 stages: [push] 20 ``` 21 22 23 You need to execute the following in order to clean the pre-commit cache 24 and install the hooks for your repo (should be run from the root of the repo): 25 26 ``` 27 pre-commit clean 28 pre-commit install -f --hook-type pre-commit 29 pre-commit install -f --hook-type pre-push 30 ```