diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index faed2bd..2d4567a 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -1,12 +1,14 @@ - id: go-test-mod-cover name: 'go-test-mod-cover' - entry: 'go-test-mod-cover.sh' + entry: 'go-test-cover.sh' language: 'script' - description: 'Run go test in module mode (GO111MODULE=on) with coverage report' + description: 'Run go test in module mode with coverage report.' pass_filenames: false + files: "*.go" - id: golangci-lint-mod name: 'golangci-lint-mod' - entry: 'golangci-lint-mod.sh' + entry: 'golangci-lint.sh' language: 'script' - description: 'Run golangci-lint in module mode (GO111MODULE=on)' - pass_filenames: false \ No newline at end of file + description: 'Run golangci-lint in module mode.' + pass_filenames: false + files: "*.go" diff --git a/go-test-cover.sh b/go-test-cover.sh new file mode 100755 index 0000000..6834cda --- /dev/null +++ b/go-test-cover.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env sh + +$(which go) test -cover diff --git a/go-test-mod-cover.sh b/go-test-mod-cover.sh deleted file mode 100755 index a907769..0000000 --- a/go-test-mod-cover.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env sh - -export GO111MODULE=on - -$(which go) test -cover ./... \ No newline at end of file diff --git a/golangci-lint-mod.sh b/golangci-lint-mod.sh deleted file mode 100755 index c1fd7b5..0000000 --- a/golangci-lint-mod.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env sh - -export GO111MODULE=on - -$(which golangci-lint) run ./... \ No newline at end of file diff --git a/golangci-lint.sh b/golangci-lint.sh new file mode 100755 index 0000000..434dbe8 --- /dev/null +++ b/golangci-lint.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env sh + +$(which golangci-lint) run