Skip to content

Commit f72b30e

Browse files
committed
Allow using different golint config
The list of enabled and disabled checks is not well maintained, so it stops all version upgrades.
1 parent c99ebd3 commit f72b30e

File tree

3 files changed

+57
-1
lines changed

3 files changed

+57
-1
lines changed

.golangci.max.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
version: "2"
2+
linters:
3+
enable:
4+
- dogsled
5+
- errcheck
6+
- gocritic
7+
- govet
8+
- gocyclo
9+
- ineffassign
10+
- misspell
11+
- nakedret
12+
- revive
13+
- staticcheck
14+
- unconvert
15+
- unparam
16+
- unused
17+
exclusions:
18+
paths:
19+
- third_party
20+
formatters:
21+
enable:
22+
- gofmt
23+
- goimports
24+
exclusions:
25+
paths:
26+
- third_party

.golangci.min.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
version: "2"
2+
linters:
3+
enable:
4+
- govet
5+
- gocyclo
6+
disable:
7+
- errcheck
8+
- staticcheck
9+
exclusions:
10+
generated: lax
11+
presets:
12+
- comments
13+
- common-false-positives
14+
- legacy
15+
- std-error-handling
16+
paths:
17+
- third_party
18+
- '(.+)_test\.go'
19+
formatters:
20+
enable:
21+
- gofmt
22+
- goimports
23+
exclusions:
24+
generated: lax
25+
paths:
26+
- third_party

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@ MINIKUBE_RELEASES_URL=https://github.com/kubernetes/minikube/releases/download
7575
# latest from https://github.com/golangci/golangci-lint/releases
7676
# update this only by running `make update-golint-version`
7777
GOLINT_VERSION ?= v2.1.5
78+
# see https://golangci-lint.run/docs/configuration/file/ for config details
79+
GOLINT_CONFIG ?= .golangci.yaml
80+
# Set this to --verbose to see details about the linters and formatters used
81+
GOLINT_VERBOSE ?=
7882
# Limit number of default jobs, to avoid the CI builds running out of memory
7983
GOLINT_JOBS ?= 4
8084
# see https://github.com/golangci/golangci-lint#memory-usage-of-golangci-lint
@@ -83,7 +87,7 @@ GOLINT_GOGC ?= 100
8387
GOLINT_OPTIONS = \
8488
--max-issues-per-linter 0 --max-same-issues 0 \
8589
--build-tags "${MINIKUBE_INTEGRATION_BUILD_TAGS}" \
86-
--config .golangci.yaml
90+
--config $(GOLINT_CONFIG) $(GOLINT_VERBOSE)
8791

8892
export GO111MODULE := on
8993

0 commit comments

Comments
 (0)