forked from TrueCloudLab/neoneo-go
Makefile: use golangci-lint instead of golint
It includes golint and also has a lot of other useful linters.
This commit is contained in:
parent
9d2712573f
commit
c76f8b8fbe
3 changed files with 8 additions and 23 deletions
|
@ -41,8 +41,8 @@ jobs:
|
||||||
- run:
|
- run:
|
||||||
name: go-lint
|
name: go-lint
|
||||||
command: |
|
command: |
|
||||||
go get -u -v golang.org/x/lint/golint
|
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.40.0
|
||||||
golint -set_exit_status ./...
|
make lint
|
||||||
|
|
||||||
vet:
|
vet:
|
||||||
working_directory: /go/src/github.com/nspcc-dev/neo-go
|
working_directory: /go/src/github.com/nspcc-dev/neo-go
|
||||||
|
|
25
.github/workflows/run_tests.yml
vendored
25
.github/workflows/run_tests.yml
vendored
|
@ -16,29 +16,14 @@ env:
|
||||||
jobs:
|
jobs:
|
||||||
lint:
|
lint:
|
||||||
name: Lint
|
name: Lint
|
||||||
runs-on: ubuntu-18.04
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
- name: golangci-lint
|
||||||
- name: Set up Go
|
uses: golangci/golangci-lint-action@v2
|
||||||
uses: actions/setup-go@v2
|
|
||||||
with:
|
with:
|
||||||
go-version: 1.16
|
version: latest
|
||||||
|
|
||||||
- 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
|
|
||||||
|
|
||||||
vet:
|
vet:
|
||||||
name: Vet
|
name: Vet
|
||||||
|
@ -189,4 +174,4 @@ jobs:
|
||||||
run: go mod download -json
|
run: go mod download -json
|
||||||
|
|
||||||
- name: Build Docker image
|
- name: Build Docker image
|
||||||
run: make image
|
run: make image
|
||||||
|
|
2
Makefile
2
Makefile
|
@ -84,7 +84,7 @@ vet:
|
||||||
@go vet ./...
|
@go vet ./...
|
||||||
|
|
||||||
lint:
|
lint:
|
||||||
@go list ./... | xargs -L1 golint -set_exit_status
|
@golangci-lint run
|
||||||
|
|
||||||
fmt:
|
fmt:
|
||||||
@gofmt -l -w -s $$(find . -type f -name '*.go'| grep -v "/vendor/")
|
@gofmt -l -w -s $$(find . -type f -name '*.go'| grep -v "/vendor/")
|
||||||
|
|
Loading…
Reference in a new issue