diff --git a/.circleci/config.yml b/.circleci/config.yml index 7b528d9eb..17e8ac260 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -41,8 +41,8 @@ jobs: - run: name: go-lint command: | - go get -u -v golang.org/x/lint/golint - golint -set_exit_status ./... + curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.40.0 + make lint vet: working_directory: /go/src/github.com/nspcc-dev/neo-go diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml index 190770028..8fecf7582 100644 --- a/.github/workflows/run_tests.yml +++ b/.github/workflows/run_tests.yml @@ -16,29 +16,14 @@ env: jobs: lint: name: Lint - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - - name: Set up Go - uses: actions/setup-go@v2 + - name: golangci-lint + uses: golangci/golangci-lint-action@v2 with: - go-version: 1.16 - - - name: Restore Go modules from cache - uses: actions/cache@v2 - with: - path: /home/runner/go/pkg/mod - key: deps-${{ hashFiles('go.sum') }} - - - name: Update Go modules - run: go mod download -json - - - name: Run linter - run: | - go get -u -v golang.org/x/lint/golint - make lint + version: latest vet: name: Vet @@ -189,4 +174,4 @@ jobs: run: go mod download -json - name: Build Docker image - run: make image \ No newline at end of file + run: make image diff --git a/Makefile b/Makefile index 06261b346..4ea0dc735 100644 --- a/Makefile +++ b/Makefile @@ -84,7 +84,7 @@ vet: @go vet ./... lint: - @go list ./... | xargs -L1 golint -set_exit_status + @golangci-lint run fmt: @gofmt -l -w -s $$(find . -type f -name '*.go'| grep -v "/vendor/")