Makefile: use golangci-lint instead of golint

It includes golint and also has a lot of other useful linters.
This commit is contained in:
Roman Khimov 2021-05-12 23:25:06 +03:00
parent 9d2712573f
commit c76f8b8fbe
3 changed files with 8 additions and 23 deletions

View file

@ -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

View file

@ -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

View file

@ -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/")