Commit 289a5fb8 by Arve Knudsen Committed by GitHub

Chore: Fix golangci-lint timeout config, disable govet (#23015)

* golangci-lint: Fix timeout config; disable govet
* CircleCI: Use official golangci-lint binary
parent a0d9851c
......@@ -711,22 +711,31 @@ jobs:
lint-go:
docker:
- image: circleci/golang:1.13.4
environment:
# we need CGO because of go-sqlite3
CGO_ENABLED: 1
# Reduce golangci-lint memory usage (default is 100)
GOGC: 20
working_directory: /go/src/github.com/grafana/grafana
environment:
# we need CGO because of go-sqlite3
CGO_ENABLED: 1
# Reduce golangci-lint memory usage (default is 100)
GOGC: 20
steps:
- checkout
- run:
name: Install Go linters
command: |
pushd /tmp
curl -fLO https://github.com/golangci/golangci-lint/releases/download/v1.24.0/golangci-lint-1.24.0-linux-amd64.tar.gz
echo 241ca454102e909de04957ff8a5754c757cefa255758b3e1fba8a4533d19d179 \
golangci-lint-1.24.0-linux-amd64.tar.gz | sha256sum --check --strict --status
tar -xf golangci-lint-1.24.0-linux-amd64.tar.gz
sudo mv golangci-lint-1.24.0-linux-amd64/golangci-lint /usr/local/bin/
popd
make scripts/go/bin/revive scripts/go/bin/gosec
- run:
name: Lint Go
command: |
# Build linters
make scripts/go/bin/golangci-lint scripts/go/bin/revive scripts/go/bin/gosec
go vet ./pkg/...
# Avoid golangci-lint concurrency since it tends to run out of memory
./scripts/go/bin/golangci-lint run --config scripts/go/configs/.golangci.yml -j 1 ./pkg/...
# Adjust golangci-lint concurrency since it can run out of memory
golangci-lint run -v -j 2 --config scripts/go/configs/.golangci.yml ./pkg/...
./scripts/go/bin/revive -formatter stylish -config ./scripts/go/configs/revive.toml ./pkg/...
./scripts/go/bin/revive -formatter stylish ./pkg/services/alerting/...
./scripts/go/bin/gosec -quiet -exclude=G104,G107,G108,G201,G202,G204,G301,G304,G401,G402,G501 \
......
enable:
run:
deadline: 10m
timeout: 10m
linters:
disable-all: true
......@@ -9,7 +7,6 @@ linters:
- deadcode
- gofmt
- gosimple
- govet
- ineffassign
- structcheck
- typecheck
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment