File tree Expand file tree Collapse file tree 3 files changed +17
-0
lines changed
Expand file tree Collapse file tree 3 files changed +17
-0
lines changed Original file line number Diff line number Diff line change 8181 files : ' \.go$'
8282 language : ' script'
8383 description : " Runs `go mod tidy -v`, requires golang"
84+ - id : go-mod-vendor
85+ name : ' go-mod-vendor'
86+ entry : run-go-mod-vendor.sh
87+ files : ' \.go$'
88+ language : ' script'
89+ description : " Runs `go mod vendor`, requires golang"
Original file line number Diff line number Diff line change @@ -44,3 +44,4 @@ Add this to your `.pre-commit-config.yaml`
4444- ` go-unit-tests ` - run ` go test -tags=unit -timeout 30s -short -v `
4545- ` go-build ` - run ` go build ` , requires golang
4646- ` go-mod-tidy ` - run ` go mod tidy -v ` , requires golang
47+ - ` go-mod-vendor ` - run ` go mod vendor ` , requires golang
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ go mod vendor
4+ git diff --exit-code vendor & > /dev/null
5+
6+ if [ $? -eq 1 ]; then
7+ echo " vendor dir differs, please re-add it to your commit"
8+
9+ exit 1
10+ fi
You can’t perform that action at this time.
0 commit comments