diff --git a/.circleci/config.yml b/.circleci/config.yml index e3218aa8..500e58f6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -14,10 +14,6 @@ jobs: - run: name: get tools command: make tools - - run: - name: copy source - command: | - mkdir bin - run: name: run lint and tests for both services command: | diff --git a/Makefile b/Makefile index e159bfce..385f7134 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,7 @@ version := "v1.2.0" commit := $(shell git rev-parse --short HEAD) +gopath := $(shell go env GOPATH) build: dist/sso-auth dist/sso-proxy @@ -16,7 +17,7 @@ dist/sso-proxy: go build -o dist/sso-proxy ./cmd/sso-proxy tools: - go get golang.org/x/lint/golint + curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(gopath)/bin v1.16.0 go get github.com/rakyll/statik test: diff --git a/scripts/test b/scripts/test index 44f7003b..ad0c761a 100755 --- a/scripts/test +++ b/scripts/test @@ -3,13 +3,8 @@ set -e cd $(dirname "$BASH_SOURCE[0]")/.. -echo "running go fmt ..." -res=$(go fmt ./...) -if [ -n "$res" ]; then - echo "$res" - echo "gofmt failed..." - exit 1 -fi +echo "running golangci-lint ..." +golangci-lint run -E gofmt -E golint -E gocritic -E gosec -E misspell # where necessary attempts to add/remove modules from go.mod and go.sum. echo "running go mod tidy ..." @@ -24,12 +19,6 @@ fi echo "running go mod verify ..." go mod verify -echo "running golint ..." -golint -set_exit_status cmd internal - -echo "running go vet ..." -go vet ./... - echo "running tests ..." cd internal go test -cover -race ./... $@