diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index 8363882..8cc862d 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -16,12 +16,6 @@ files: '\.go$' language: 'script' description: "Runs `go vet`, requires golang" -- id: go-lint - name: 'go lint' - entry: run-go-lint.sh - files: '\.go$' - language: 'script' - description: "Runs `golint`, requires https://github.com/golang/lint" - id: go-cyclo name: 'go-cyclo' entry: run-go-cyclo.sh diff --git a/README.md b/README.md index b5815c5..fcaaa77 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ pre-commit-golang ================= -:rotating_light: Please see the project sunsetting announcement: +:rotating_light: This repo exists due to the sunsetting of the original repo [Issues/98](https://github.com/dnephin/pre-commit-golang/issues/98) :rotating_light: @@ -13,12 +13,11 @@ golang hooks for http://pre-commit.com/ Add this to your `.pre-commit-config.yaml` - - repo: https://github.com/dnephin/pre-commit-golang + - repo: https://github.com/CostcoFanboy/pre-commit-golang rev: master hooks: - id: go-fmt - id: go-vet - - id: go-lint - id: go-imports - id: go-cyclo args: [-over=15] @@ -34,7 +33,6 @@ Add this to your `.pre-commit-config.yaml` - `go-fmt` - Runs `gofmt`, requires golang - `go-vet` - Runs `go vet`, requires golang -- `go-lint` - Runs `golint`, requires https://github.com/golang/lint but is unmaintained & deprecated in favour of [`golangci-lint`](https://github.com/golangci/golangci-lint) - `go-imports` - Runs `goimports`, requires golang.org/x/tools/cmd/goimports - `go-cyclo` - Runs `gocyclo`, require https://github.com/fzipp/gocyclo - `validate-toml` - Runs `tomlv`, requires diff --git a/run-go-lint.sh b/run-go-lint.sh deleted file mode 100755 index 1629062..0000000 --- a/run-go-lint.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env bash - -set -eu -o pipefail - -if ! command -v golint &> /dev/null ; then - echo "golint not installed or available in the PATH" >&2 - echo "please check https://github.com/golang/lint" >&2 - exit 1 -fi - -failed=false - -for file in "$@"; do - # redirect stderr so that violations and summaries are properly interleaved. - if ! golint -set_exit_status "$file" 2>&1 - then - failed=true - fi -done - -if [[ $failed == "true" ]]; then - exit 1 -fi