2015-08-01 02:34:19 +02:00
|
|
|
git-hooks
|
|
|
|
=========
|
|
|
|
|
|
|
|
Collection of git hooks. Most of the pre-commit hooks are Go specific.
|
|
|
|
|
|
|
|
|
|
|
|
usage
|
|
|
|
-----
|
|
|
|
|
2015-08-01 13:01:26 +02:00
|
|
|
* to install the hooks use:
|
2015-08-01 02:36:32 +02:00
|
|
|
|
2023-08-24 19:21:00 +02:00
|
|
|
go install git.mthie.com/mthie/git-gohooks@latest
|
|
|
|
go install git.mthie.com/mthie/git-gohooks/githook-golangci-lint@latest
|
|
|
|
go install git.mthie.com/mthie/git-gohooks/githook-gobuild@latest
|
|
|
|
go install git.mthie.com/mthie/git-gohooks/githook-gofmt@latest
|
|
|
|
go install git.mthie.com/mthie/git-gohooks/githook-gotest@latest
|
2015-08-01 02:35:13 +02:00
|
|
|
|
2015-08-01 02:34:19 +02:00
|
|
|
|
2015-08-01 13:01:26 +02:00
|
|
|
* on a Unix based system symlink it with
|
2015-08-01 02:37:23 +02:00
|
|
|
|
2015-08-01 02:36:32 +02:00
|
|
|
( cd .git/hooks && \
|
|
|
|
ln -s $GOPATH/bin/git-gohooks pre-commit && \
|
2023-08-24 19:18:46 +02:00
|
|
|
ln -s $GOPATH/bin/githook-golangci-lint pre-commit_01_golangci_lint && \
|
|
|
|
ln -s $GOPATH/bin/githook-gofmt pre-commit_02_gofmt && \
|
|
|
|
ln -s $GOPATH/bin/githook-gobuild pre-commit_03_gobuild && \
|
|
|
|
ln -s $GOPATH/bin/githook-gotest pre-commit_04_gotest )
|
2015-08-01 02:34:19 +02:00
|
|
|
|
2015-08-01 13:01:26 +02:00
|
|
|
* on a Windows system in a command shell with **Administrator privileges**
|
|
|
|
|
|
|
|
cd .git\hooks
|
|
|
|
mklink /H pre-commit <YourGoPath>\bin\git-gohooks.exe
|
2023-08-24 19:18:46 +02:00
|
|
|
mklink /H pre-commit_01_golangci_lint.exe <YourGoPath>\bin\githook-golangci-lint.exe
|
|
|
|
mklink /H pre-commit_02_gofmt.exe <YourGoPath>\bin\githook-gofmt.exe
|
|
|
|
mklink /H pre-commit_03_gobuild.exe <YourGoPath>\bin\githook-gobuild.exe
|
|
|
|
mklink /H pre-commit_04_gotest.exe <YourGoPath>\bin\githook-gotest.exe
|