You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
2
2
#
3
-
# Generated on 2025-01-16T18:10:29Z by kres 3b3f992.
3
+
# Generated on 2025-04-22T10:59:51Z by kres fd5cab0.
4
+
5
+
version: "2"
4
6
5
7
# options for analysis running
6
8
run:
7
-
timeout: 10m
9
+
modules-download-mode: readonly
8
10
issues-exit-code: 1
9
11
tests: true
10
-
build-tags: [ ]
11
-
modules-download-mode: readonly
12
12
13
13
# output configuration options
14
14
output:
15
15
formats:
16
-
- format: colored-line-number
16
+
text:
17
17
path: stdout
18
-
print-issued-lines: true
19
-
print-linter-name: true
18
+
print-issued-lines: true
19
+
print-linter-name: true
20
20
path-prefix: ""
21
21
22
-
# all available settings of specific linters
23
-
linters-settings:
24
-
dogsled:
25
-
max-blank-identifiers: 2
26
-
dupl:
27
-
threshold: 150
28
-
errcheck:
29
-
check-type-assertions: true
30
-
check-blank: true
31
-
exhaustive:
32
-
default-signifies-exhaustive: false
33
-
gci:
34
-
sections:
35
-
- standard # Standard section: captures all standard packages.
36
-
- default # Default section: contains all imports that could not be matched to another section type.
37
-
- localmodule # Imports from the same module.
38
-
gocognit:
39
-
min-complexity: 30
40
-
nestif:
41
-
min-complexity: 5
42
-
goconst:
43
-
min-len: 3
44
-
min-occurrences: 3
45
-
gocritic:
46
-
disabled-checks: [ ]
47
-
gocyclo:
48
-
min-complexity: 20
49
-
godot:
50
-
scope: declarations
51
-
gofmt:
52
-
simplify: true
53
-
gomodguard: { }
54
-
govet:
55
-
enable-all: true
56
-
lll:
57
-
line-length: 200
58
-
tab-width: 4
59
-
misspell:
60
-
locale: US
61
-
ignore-words: [ ]
62
-
nakedret:
63
-
max-func-lines: 30
64
-
prealloc:
65
-
simple: true
66
-
range-loops: true # Report preallocation suggestions on range loops, true by default
67
-
for-loops: false # Report preallocation suggestions on for loops, false by default
68
-
nolintlint:
69
-
allow-unused: false
70
-
allow-no-explanation: [ ]
71
-
require-explanation: false
72
-
require-specific: true
73
-
rowserrcheck: { }
74
-
testpackage: { }
75
-
unparam:
76
-
check-exported: false
77
-
unused:
78
-
local-variables-are-used: false
79
-
whitespace:
80
-
multi-if: false # Enforces newlines (or comments) after every multi-line if statement
81
-
multi-func: false # Enforces newlines (or comments) after every multi-line function signature
82
-
wsl:
83
-
strict-append: true
84
-
allow-assign-and-call: true
85
-
allow-multiline-assign: true
86
-
allow-cuddle-declarations: false
87
-
allow-trailing-comment: false
88
-
force-case-trailing-whitespace: 0
89
-
force-err-cuddling: false
90
-
allow-separated-leading-comment: false
91
-
gofumpt:
92
-
extra-rules: false
93
-
cyclop:
94
-
# the maximal code complexity to report
95
-
max-complexity: 20
96
-
depguard:
97
-
rules:
98
-
prevent_unmaintained_packages:
99
-
list-mode: lax # allow unless explicitly denied
100
-
files:
101
-
- $all
102
-
deny:
103
-
- pkg: io/ioutil
104
-
desc: "replaced by io and os packages since Go 1.16: https://tip.golang.org/doc/go1.16#ioutil"
105
22
106
23
linters:
107
-
enable-all: true
108
-
disable-all: false
109
-
fast: false
24
+
default: all
110
25
disable:
111
26
- exhaustruct
112
27
- err113
113
28
- forbidigo
29
+
- funcorder
114
30
- funlen
115
31
- gochecknoglobals
116
32
- gochecknoinits
@@ -131,20 +47,113 @@ linters:
131
47
- testifylint # complains about our assert recorder and has a number of false positives for assert.Greater(t, thing, 1)
132
48
- protogetter # complains about us using Value field on typed spec, instead of GetValue which has a different signature
133
49
- perfsprint # complains about us using fmt.Sprintf in non-performance critical code, updating just kres took too long
134
-
- goimports # same as gci
135
50
- musttag # seems to be broken - goes into imported libraries and reports issues there
136
-
- exportloopref # WARN The linter 'exportloopref' is deprecated (since v1.60.2) due to: Since Go1.22 (loopvar) this linter is no longer relevant. Replaced by copyloopvar.
51
+
# all available settings of specific linters
52
+
settings:
53
+
cyclop:
54
+
# the maximal code complexity to report
55
+
max-complexity: 20
56
+
dogsled:
57
+
max-blank-identifiers: 2
58
+
dupl:
59
+
threshold: 150
60
+
errcheck:
61
+
check-type-assertions: true
62
+
check-blank: true
63
+
exhaustive:
64
+
default-signifies-exhaustive: false
65
+
gocognit:
66
+
min-complexity: 30
67
+
nestif:
68
+
min-complexity: 5
69
+
goconst:
70
+
min-len: 3
71
+
min-occurrences: 3
72
+
gocritic:
73
+
disabled-checks: [ ]
74
+
gocyclo:
75
+
min-complexity: 20
76
+
godot:
77
+
scope: declarations
78
+
gomodguard: { }
79
+
govet:
80
+
enable-all: true
81
+
lll:
82
+
line-length: 200
83
+
tab-width: 4
84
+
misspell:
85
+
locale: US
86
+
nakedret:
87
+
max-func-lines: 30
88
+
prealloc:
89
+
simple: true
90
+
range-loops: true # Report preallocation suggestions on range loops, true by default
91
+
for-loops: false # Report preallocation suggestions on for loops, false by default
92
+
nolintlint:
93
+
allow-unused: false
94
+
allow-no-explanation: [ ]
95
+
require-explanation: false
96
+
require-specific: true
97
+
rowserrcheck: { }
98
+
testpackage: { }
99
+
unparam:
100
+
check-exported: false
101
+
unused:
102
+
local-variables-are-used: false
103
+
whitespace:
104
+
multi-if: false # Enforces newlines (or comments) after every multi-line if statement
105
+
multi-func: false # Enforces newlines (or comments) after every multi-line function signature
106
+
wsl:
107
+
strict-append: true
108
+
allow-assign-and-call: true
109
+
allow-multiline-assign: true
110
+
allow-trailing-comment: false
111
+
force-case-trailing-whitespace: 0
112
+
allow-separated-leading-comment: false
113
+
allow-cuddle-declarations: false
114
+
force-err-cuddling: false
115
+
depguard:
116
+
rules:
117
+
prevent_unmaintained_packages:
118
+
list-mode: lax # allow unless explicitly denied
119
+
files:
120
+
- $all
121
+
deny:
122
+
- pkg: io/ioutil
123
+
desc: "replaced by io and os packages since Go 1.16: https://tip.golang.org/doc/go1.16#ioutil"
RUN --mount=type=cache,target=/root/.cache/go-build --mount=type=cache,target=/go/pkg go install github.com/siderolabs/deep-copy@${DEEPCOPY_VERSION} \
35
+
RUN --mount=type=cache,target=/root/.cache/go-build,id=state-etcd/root/.cache/go-build --mount=type=cache,target=/go/pkg,id=state-etcd/go/pkg go install github.com/siderolabs/deep-copy@${DEEPCOPY_VERSION} \
36
36
&& mv /go/bin/deep-copy /bin/deep-copy
37
37
ARG GOLANGCILINT_VERSION
38
-
RUN --mount=type=cache,target=/root/.cache/go-build --mount=type=cache,target=/go/pkg go install github.com/golangci/golangci-lint/cmd/golangci-lint@${GOLANGCILINT_VERSION} \
38
+
RUN --mount=type=cache,target=/root/.cache/go-build,id=state-etcd/root/.cache/go-build --mount=type=cache,target=/go/pkg,id=state-etcd/go/pkg go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@${GOLANGCILINT_VERSION} \
39
39
&& mv /go/bin/golangci-lint /bin/golangci-lint
40
-
RUN --mount=type=cache,target=/root/.cache/go-build --mount=type=cache,target=/go/pkg go install golang.org/x/vuln/cmd/govulncheck@latest \
40
+
RUN --mount=type=cache,target=/root/.cache/go-build,id=state-etcd/root/.cache/go-build --mount=type=cache,target=/go/pkg,id=state-etcd/go/pkg go install golang.org/x/vuln/cmd/govulncheck@latest \
41
41
&& mv /go/bin/govulncheck /bin/govulncheck
42
42
ARG GOFUMPT_VERSION
43
43
RUN go install mvdan.cc/gofumpt@${GOFUMPT_VERSION} \
@@ -49,10 +49,10 @@ WORKDIR /src
49
49
COPY go.mod go.mod
50
50
COPY go.sum go.sum
51
51
RUN cd .
52
-
RUN --mount=type=cache,target=/go/pkg go mod download
53
-
RUN --mount=type=cache,target=/go/pkg go mod verify
52
+
RUN --mount=type=cache,target=/go/pkg,id=state-etcd/go/pkg go mod download
53
+
RUN --mount=type=cache,target=/go/pkg,id=state-etcd/go/pkg go mod verify
54
54
COPY ./pkg ./pkg
55
-
RUN --mount=type=cache,target=/go/pkg go list -mod=readonly all >/dev/null
55
+
RUN --mount=type=cache,target=/go/pkg,id=state-etcd/go/pkg go list -mod=readonly all >/dev/null
56
56
57
57
# runs gofumpt
58
58
FROM base AS lint-gofumpt
@@ -63,25 +63,24 @@ FROM base AS lint-golangci-lint
63
63
WORKDIR /src
64
64
COPY .golangci.yml .
65
65
ENV GOGC=50
66
-
RUN golangci-lint config verify --config .golangci.yml
67
-
RUN --mount=type=cache,target=/root/.cache/go-build --mount=type=cache,target=/root/.cache/golangci-lint --mount=type=cache,target=/go/pkg golangci-lint run --config .golangci.yml
66
+
RUN --mount=type=cache,target=/root/.cache/go-build,id=state-etcd/root/.cache/go-build --mount=type=cache,target=/root/.cache/golangci-lint,id=state-etcd/root/.cache/golangci-lint,sharing=locked --mount=type=cache,target=/go/pkg,id=state-etcd/go/pkg golangci-lint run --config .golangci.yml
68
67
69
68
# runs govulncheck
70
69
FROM base AS lint-govulncheck
71
70
WORKDIR /src
72
-
RUN --mount=type=cache,target=/root/.cache/go-build --mount=type=cache,target=/go/pkg govulncheck ./...
71
+
RUN --mount=type=cache,target=/root/.cache/go-build,id=state-etcd/root/.cache/go-build --mount=type=cache,target=/go/pkg,id=state-etcd/go/pkg govulncheck ./...
73
72
74
73
# runs unit-tests with race detector
75
74
FROM base AS unit-tests-race
76
75
WORKDIR /src
77
76
ARG TESTPKGS
78
-
RUN --mount=type=cache,target=/root/.cache/go-build --mount=type=cache,target=/go/pkg --mount=type=cache,target=/tmp CGO_ENABLED=1 go test -v -race -count 1 ${TESTPKGS}
77
+
RUN --mount=type=cache,target=/root/.cache/go-build,id=state-etcd/root/.cache/go-build --mount=type=cache,target=/go/pkg,id=state-etcd/go/pkg --mount=type=cache,target=/tmp,id=state-etcd/tmp CGO_ENABLED=1 go test -v -race -count 1 ${TESTPKGS}
79
78
80
79
# runs unit-tests
81
80
FROM base AS unit-tests-run
82
81
WORKDIR /src
83
82
ARG TESTPKGS
84
-
RUN --mount=type=cache,target=/root/.cache/go-build --mount=type=cache,target=/go/pkg --mount=type=cache,target=/tmp go test -v -covermode=atomic -coverprofile=coverage.txt -coverpkg=${TESTPKGS} -count 1 ${TESTPKGS}
83
+
RUN --mount=type=cache,target=/root/.cache/go-build,id=state-etcd/root/.cache/go-build --mount=type=cache,target=/go/pkg,id=state-etcd/go/pkg --mount=type=cache,target=/tmp,id=state-etcd/tmp go test -v -covermode=atomic -coverprofile=coverage.txt -coverpkg=${TESTPKGS} -count 1 ${TESTPKGS}
0 commit comments