Skip to content

Commit f68da4a

Browse files
authored
golangci-lint: update to v2 (#6550)
Signed-off-by: Nick Santos <nick.santos@docker.com>
1 parent 396dd9b commit f68da4a

File tree

4 files changed

+70
-70
lines changed

4 files changed

+70
-70
lines changed

.circleci/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ RUN go install github.com/google/wire/cmd/wire@latest \
3131
&& go install golang.org/x/tools/cmd/goimports@latest \
3232
&& go clean -cache -modcache
3333

34-
RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.64.8
34+
RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v2.1.6

.circleci/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
build-linux:
1111
resource_class: medium+
1212
docker:
13-
- image: docker/tilt-ci@sha256:d3a4b59d61b0f254a467ae265ab07c20426793fafea6d4c0582bb487b5a21569
13+
- image: docker/tilt-ci@sha256:383e2d24af70080eaf88d0f47d37cb11ecb7c2a2cb7ccfe1b3e96572bf163d30
1414
# apiserver code generation scripts require being in GOPATH
1515
working_directory: /home/circleci/go/src/github.com/tilt-dev/tilt
1616
steps:
@@ -47,7 +47,7 @@ jobs:
4747
only_for_branches: master
4848
check-docs:
4949
docker:
50-
- image: docker/tilt-ci@sha256:d3a4b59d61b0f254a467ae265ab07c20426793fafea6d4c0582bb487b5a21569
50+
- image: docker/tilt-ci@sha256:383e2d24af70080eaf88d0f47d37cb11ecb7c2a2cb7ccfe1b3e96572bf163d30
5151
steps:
5252
- checkout
5353
- setup_remote_docker

.golangci.yml

Lines changed: 66 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,81 @@
1-
# options for analysis running
1+
version: "2"
22
run:
3-
timeout: 10m
43
go: "1.24"
5-
exclude-files:
6-
- "zz_generated.*\\.go$"
7-
- "vendored_openapi\\.go$"
8-
allow-parallel-runners: true
9-
modules-download-mode: vendor
104
build-tags:
115
- integration
12-
13-
# output configuration options
6+
modules-download-mode: vendor
7+
allow-parallel-runners: true
148
output:
15-
# colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number"
169
formats:
17-
- format: colored-line-number
18-
19-
# print lines of code with issue, default is true
20-
print-issued-lines: true
21-
22-
# print linter name in the end of issue text, default is true
23-
print-linter-name: true
24-
25-
# all available settings of specific linters
26-
linters-settings:
27-
errcheck:
28-
# report about not checking of errors in type assertions: `a := b.(MyStruct)`;
29-
# default is false: such cases aren't reported by default.
30-
check-type-assertions: false
31-
32-
# report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`;
33-
# default is false: such cases aren't reported by default.
34-
check-blank: false
35-
govet:
36-
settings:
37-
printf:
38-
funcs:
39-
- Verbosef
40-
- Infof
41-
- Debugf
42-
- PrintColorf
43-
goimports:
44-
local-prefixes: github.com/tilt-dev
45-
misspell:
46-
# Correct spellings using locale preferences for US or UK.
47-
# Default is to use a neutral variety of English.
48-
# Setting locale to US will correct the British spelling of 'colour' to 'color'.
49-
locale: US
50-
ignore-words:
51-
- servantes
52-
- cancelled # British spelling used in Kubernetes code
53-
10+
text:
11+
path: stdout
12+
print-linter-name: true
13+
print-issued-lines: true
5414
linters:
55-
disable-all: true
15+
default: none
5616
enable:
5717
- copyloopvar
5818
- errcheck
59-
- goimports
60-
- gosimple
6119
- govet
6220
- ineffassign
63-
- staticcheck
6421
- misspell
6522
- unconvert
6623
- unused
67-
68-
issues:
69-
exclude-rules:
70-
- linters:
71-
- staticcheck
72-
text: "SA1019:"
73-
- linters:
74-
- gosimple
75-
text: "S1008:"
76-
- path: _test\.go
77-
linters:
78-
- errcheck
79-
- path: types.go
80-
linters:
81-
- unconvert
24+
settings:
25+
errcheck:
26+
check-type-assertions: false
27+
check-blank: false
28+
govet:
29+
settings:
30+
printf:
31+
funcs:
32+
- Verbosef
33+
- Infof
34+
- Debugf
35+
- PrintColorf
36+
misspell:
37+
locale: US
38+
ignore-rules:
39+
- servantes
40+
- cancelled
41+
exclusions:
42+
generated: lax
43+
presets:
44+
- comments
45+
- common-false-positives
46+
- legacy
47+
- std-error-handling
48+
rules:
49+
- linters:
50+
- staticcheck
51+
text: 'SA1019:'
52+
- linters:
53+
- staticcheck
54+
text: 'S1008:'
55+
- linters:
56+
- errcheck
57+
path: _test\.go
58+
- linters:
59+
- unconvert
60+
path: types.go
61+
paths:
62+
- zz_generated.*\.go$
63+
- vendored_openapi\.go$
64+
- third_party$
65+
- builtin$
66+
- examples$
67+
formatters:
68+
enable:
69+
- goimports
70+
settings:
71+
goimports:
72+
local-prefixes:
73+
- github.com/tilt-dev
74+
exclusions:
75+
generated: lax
76+
paths:
77+
- zz_generated.*\.go$
78+
- vendored_openapi\.go$
79+
- third_party$
80+
- builtin$
81+
- examples$

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ ifneq ($(CIRCLECI),true)
109109
GOFLAGS="-mod=vendor" golangci-lint run $(LINT_FLAGS) -v --timeout 300s
110110
else
111111
mkdir -p test-results
112-
GOFLAGS="-mod=vendor" golangci-lint run -v --timeout 300s --out-format junit-xml > test-results/lint.xml
112+
GOFLAGS="-mod=vendor" golangci-lint run -v --timeout 300s --output.junit-xml.path=test-results/lint.xml
113113
endif
114114

115115
wire:

0 commit comments

Comments
 (0)