diff --git a/.golangci.yml b/.golangci.yml index 6a8c842..1da17c7 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,130 +1,32 @@ # THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT. # -# Generated on 2025-02-24T10:54:07Z by kres c92d97e6. +# Generated on 2025-04-14T12:32:42Z by kres d903dae-dirty. + +version: "2" # options for analysis running run: - timeout: 10m + modules-download-mode: readonly issues-exit-code: 1 tests: true - build-tags: [ ] - modules-download-mode: readonly # output configuration options output: formats: - - format: colored-line-number + text: path: stdout - print-issued-lines: true - print-linter-name: true + print-issued-lines: true + print-linter-name: true path-prefix: "" -# all available settings of specific linters -linters-settings: - dogsled: - max-blank-identifiers: 2 - dupl: - threshold: 150 - errcheck: - check-type-assertions: true - check-blank: true - exhaustive: - default-signifies-exhaustive: false - gci: - sections: - - standard # Standard section: captures all standard packages. - - default # Default section: contains all imports that could not be matched to another section type. - - localmodule # Imports from the same module. - gocognit: - min-complexity: 30 - nestif: - min-complexity: 5 - goconst: - min-len: 3 - min-occurrences: 3 - gocritic: - disabled-checks: [ ] - gocyclo: - min-complexity: 20 - godot: - scope: declarations - gofmt: - simplify: true - gomodguard: { } - govet: - enable-all: true - lll: - line-length: 200 - tab-width: 4 - misspell: - locale: US - ignore-words: [ ] - nakedret: - max-func-lines: 30 - prealloc: - simple: true - range-loops: true # Report preallocation suggestions on range loops, true by default - for-loops: false # Report preallocation suggestions on for loops, false by default - nolintlint: - allow-unused: false - allow-no-explanation: [ ] - require-explanation: false - require-specific: true - rowserrcheck: { } - testpackage: { } - unparam: - check-exported: false - unused: - local-variables-are-used: false - whitespace: - multi-if: false # Enforces newlines (or comments) after every multi-line if statement - multi-func: false # Enforces newlines (or comments) after every multi-line function signature - wsl: - strict-append: true - allow-assign-and-call: true - allow-multiline-assign: true - allow-cuddle-declarations: false - allow-trailing-comment: false - force-case-trailing-whitespace: 0 - force-err-cuddling: false - allow-separated-leading-comment: false - gofumpt: - extra-rules: false - cyclop: - # the maximal code complexity to report - max-complexity: 20 - depguard: - rules: - prevent_unmaintained_packages: - list-mode: lax # allow unless explicitly denied - files: - - $all - deny: - - pkg: io/ioutil - desc: "replaced by io and os packages since Go 1.16: https://tip.golang.org/doc/go1.16#ioutil" - test_kres_depguard_extra_rule_1: - deny: - - desc: Test rule 1 - pkg: io/ioutil - files: - - test_1.go - list-mode: lax - test_kres_depguard_extra_rule_2: - deny: - - desc: Test rule 2 - pkg: io/ioutil - files: - - test_2.go - list-mode: lax linters: - enable-all: true - disable-all: false - fast: false + default: all disable: - exhaustruct - err113 - forbidigo + - funcorder - funlen - gochecknoglobals - gochecknoinits @@ -145,19 +47,127 @@ linters: - testifylint # complains about our assert recorder and has a number of false positives for assert.Greater(t, thing, 1) - protogetter # complains about us using Value field on typed spec, instead of GetValue which has a different signature - perfsprint # complains about us using fmt.Sprintf in non-performance critical code, updating just kres took too long - - goimports # same as gci - musttag # seems to be broken - goes into imported libraries and reports issues there + # all available settings of specific linters + settings: + cyclop: + # the maximal code complexity to report + max-complexity: 20 + dogsled: + max-blank-identifiers: 2 + dupl: + threshold: 150 + errcheck: + check-type-assertions: true + check-blank: true + exhaustive: + default-signifies-exhaustive: false + gocognit: + min-complexity: 30 + nestif: + min-complexity: 5 + goconst: + min-len: 3 + min-occurrences: 3 + gocritic: + disabled-checks: [ ] + gocyclo: + min-complexity: 20 + godot: + scope: declarations + gomodguard: { } + govet: + enable-all: true + lll: + line-length: 200 + tab-width: 4 + misspell: + locale: US + nakedret: + max-func-lines: 30 + prealloc: + simple: true + range-loops: true # Report preallocation suggestions on range loops, true by default + for-loops: false # Report preallocation suggestions on for loops, false by default + nolintlint: + allow-unused: false + allow-no-explanation: [ ] + require-explanation: false + require-specific: true + rowserrcheck: { } + testpackage: { } + unparam: + check-exported: false + unused: + local-variables-are-used: false + whitespace: + multi-if: false # Enforces newlines (or comments) after every multi-line if statement + multi-func: false # Enforces newlines (or comments) after every multi-line function signature + wsl: + strict-append: true + allow-assign-and-call: true + allow-multiline-assign: true + allow-trailing-comment: false + force-case-trailing-whitespace: 0 + allow-separated-leading-comment: false + allow-cuddle-declarations: false + force-err-cuddling: false + depguard: + rules: + prevent_unmaintained_packages: + list-mode: lax # allow unless explicitly denied + files: + - $all + deny: + - pkg: io/ioutil + desc: "replaced by io and os packages since Go 1.16: https://tip.golang.org/doc/go1.16#ioutil" + test_kres_depguard_extra_rule_1: + deny: + - desc: Test rule 1 + pkg: io/ioutil + files: + - test_1.go + list-mode: lax + test_kres_depguard_extra_rule_2: + deny: + - desc: Test rule 2 + pkg: io/ioutil + files: + - test_2.go + list-mode: lax + exclusions: + generated: lax + paths: + - third_party$ + - builtin$ + - examples$ issues: - exclude: [ ] - exclude-rules: [ ] - exclude-use-default: false - exclude-case-sensitive: false max-issues-per-linter: 10 max-same-issues: 3 - new: false uniq-by-line: true + new: false severity: - default-severity: error - case-sensitive: false + default: error +formatters: + enable: + - gci + - gofmt + - gofumpt + settings: + gci: + sections: + - standard + - default + - localmodule + gofmt: + simplify: true + gofumpt: + extra-rules: false + exclusions: + generated: lax + paths: + - third_party$ + - builtin$ + - examples$ diff --git a/Dockerfile b/Dockerfile index c78d4b0..af046ac 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,16 +2,16 @@ # THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT. # -# Generated on 2025-03-24T12:23:13Z by kres 24cab8a. +# Generated on 2025-04-14T12:36:48Z by kres bcd6279-dirty. ARG TOOLCHAIN -FROM ghcr.io/siderolabs/ca-certificates:v1.10.0-alpha.0-37-g359807b AS image-ca-certificates +FROM ghcr.io/siderolabs/ca-certificates:v1.10.0 AS image-ca-certificates -FROM ghcr.io/siderolabs/fhs:v1.10.0-alpha.0-37-g359807b AS image-fhs +FROM ghcr.io/siderolabs/fhs:v1.10.0 AS image-fhs # runs markdownlint -FROM docker.io/oven/bun:1.2.4-alpine AS lint-markdown +FROM docker.io/oven/bun:1.2.9-alpine AS lint-markdown WORKDIR /src RUN bun i markdownlint-cli@0.44.0 sentences-per-line@0.3.0 COPY .markdownlint.json . @@ -36,7 +36,7 @@ ARG DEEPCOPY_VERSION RUN --mount=type=cache,target=/root/.cache/go-build,id=kres/root/.cache/go-build --mount=type=cache,target=/go/pkg,id=kres/go/pkg go install github.com/siderolabs/deep-copy@${DEEPCOPY_VERSION} \ && mv /go/bin/deep-copy /bin/deep-copy ARG GOLANGCILINT_VERSION -RUN --mount=type=cache,target=/root/.cache/go-build,id=kres/root/.cache/go-build --mount=type=cache,target=/go/pkg,id=kres/go/pkg go install github.com/golangci/golangci-lint/cmd/golangci-lint@${GOLANGCILINT_VERSION} \ +RUN --mount=type=cache,target=/root/.cache/go-build,id=kres/root/.cache/go-build --mount=type=cache,target=/go/pkg,id=kres/go/pkg go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@${GOLANGCILINT_VERSION} \ && mv /go/bin/golangci-lint /bin/golangci-lint RUN --mount=type=cache,target=/root/.cache/go-build,id=kres/root/.cache/go-build --mount=type=cache,target=/go/pkg,id=kres/go/pkg go install golang.org/x/vuln/cmd/govulncheck@latest \ && mv /go/bin/govulncheck /bin/govulncheck diff --git a/Makefile b/Makefile index 0192eeb..07634af 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ # THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT. # -# Generated on 2025-03-24T14:51:59Z by kres 945cb02. +# Generated on 2025-04-14T12:21:51Z by kres d903dae-dirty. # common variables @@ -17,16 +17,16 @@ WITH_RACE ?= false REGISTRY ?= ghcr.io USERNAME ?= siderolabs REGISTRY_AND_USERNAME ?= $(REGISTRY)/$(USERNAME) -PROTOBUF_GO_VERSION ?= 1.36.5 +PROTOBUF_GO_VERSION ?= 1.36.6 GRPC_GO_VERSION ?= 1.5.1 GRPC_GATEWAY_VERSION ?= 2.26.3 VTPROTOBUF_VERSION ?= 0.6.0 -GOIMPORTS_VERSION ?= 0.31.0 -GOMOCK_VERSION ?= 0.5.0 +GOIMPORTS_VERSION ?= 0.32.0 +GOMOCK_VERSION ?= 0.5.1 DEEPCOPY_VERSION ?= v0.5.6 -GOLANGCILINT_VERSION ?= v1.64.6 -GOFUMPT_VERSION ?= v0.7.0 -GO_VERSION ?= 1.24.1 +GOLANGCILINT_VERSION ?= v2.1.1 +GOFUMPT_VERSION ?= v0.8.0 +GO_VERSION ?= 1.24.2 GO_BUILDFLAGS ?= GO_LDFLAGS ?= CGO_ENABLED ?= 0 diff --git a/go.mod b/go.mod index c931917..007d3a8 100644 --- a/go.mod +++ b/go.mod @@ -4,14 +4,14 @@ go 1.24.0 require ( github.com/drone/drone-yaml v1.2.3 - github.com/go-git/go-git/v5 v5.14.0 - github.com/google/go-github/v69 v69.2.0 + github.com/go-git/go-git/v5 v5.15.0 + github.com/google/go-github/v71 v71.0.0 github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 github.com/siderolabs/gen v0.8.0 github.com/spf13/cobra v1.9.1 github.com/stretchr/testify v1.10.0 golang.org/x/mod v0.24.0 - golang.org/x/oauth2 v0.28.0 + golang.org/x/oauth2 v0.29.0 gopkg.in/yaml.v3 v3.0.1 ) @@ -21,7 +21,7 @@ require ( github.com/ProtonMail/go-crypto v1.1.6 // indirect github.com/bmatcuk/doublestar v1.3.4 // indirect github.com/buildkite/yaml v2.1.0+incompatible // indirect - github.com/cloudflare/circl v1.6.0 // indirect + github.com/cloudflare/circl v1.6.1 // indirect github.com/cyphar/filepath-securejoin v0.4.1 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/docker/go-units v0.5.0 // indirect @@ -39,8 +39,8 @@ require ( github.com/skeema/knownhosts v1.3.1 // indirect github.com/spf13/pflag v1.0.6 // indirect github.com/xanzy/ssh-agent v0.3.3 // indirect - golang.org/x/crypto v0.36.0 // indirect - golang.org/x/net v0.37.0 // indirect - golang.org/x/sys v0.31.0 // indirect + golang.org/x/crypto v0.37.0 // indirect + golang.org/x/net v0.39.0 // indirect + golang.org/x/sys v0.32.0 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect ) diff --git a/go.sum b/go.sum index 6425926..a532770 100644 --- a/go.sum +++ b/go.sum @@ -18,8 +18,8 @@ github.com/bmatcuk/doublestar v1.3.4 h1:gPypJ5xD31uhX6Tf54sDPUOBXTqKH4c9aPY66CyQ github.com/bmatcuk/doublestar v1.3.4/go.mod h1:wiQtGV+rzVYxB7WIlirSN++5HPtPlXEo9MEoZQC/PmE= github.com/buildkite/yaml v2.1.0+incompatible h1:xirI+ql5GzfikVNDmt+yeiXpf/v1Gt03qXTtT5WXdr8= github.com/buildkite/yaml v2.1.0+incompatible/go.mod h1:UoU8vbcwu1+vjZq01+KrpSeLBgQQIjL/H7Y6KwikUrI= -github.com/cloudflare/circl v1.6.0 h1:cr5JKic4HI+LkINy2lg3W2jF8sHCVTBncJr5gIIq7qk= -github.com/cloudflare/circl v1.6.0/go.mod h1:uddAzsPgqdMAYatqJ0lsjX1oECcQLIlRpzZh3pJrofs= +github.com/cloudflare/circl v1.6.1 h1:zqIqSPIndyBh1bjLVVDHMPpVKqp8Su/V+6MeDzzQBQ0= +github.com/cloudflare/circl v1.6.1/go.mod h1:uddAzsPgqdMAYatqJ0lsjX1oECcQLIlRpzZh3pJrofs= github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= github.com/cyphar/filepath-securejoin v0.4.1 h1:JyxxyPEaktOD+GAnqIqTf9A8tHyAG22rowi7HkoSU1s= github.com/cyphar/filepath-securejoin v0.4.1/go.mod h1:Sdj7gXlvMcPZsbhwhQ33GguGLDGQL7h7bg04C/+u9jI= @@ -49,8 +49,8 @@ github.com/go-git/go-billy/v5 v5.6.2 h1:6Q86EsPXMa7c3YZ3aLAQsMA0VlWmy43r6FHqa/UN github.com/go-git/go-billy/v5 v5.6.2/go.mod h1:rcFC2rAsp/erv7CMz9GczHcuD0D32fWzH+MJAU+jaUU= github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399 h1:eMje31YglSBqCdIqdhKBW8lokaMrL3uTkpGYlE2OOT4= github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399/go.mod h1:1OCfN199q1Jm3HZlxleg+Dw/mwps2Wbk9frAWm+4FII= -github.com/go-git/go-git/v5 v5.14.0 h1:/MD3lCrGjCen5WfEAzKg00MJJffKhC8gzS80ycmCi60= -github.com/go-git/go-git/v5 v5.14.0/go.mod h1:Z5Xhoia5PcWA3NF8vRLURn9E5FRhSl7dGj9ItW3Wk5k= +github.com/go-git/go-git/v5 v5.15.0 h1:f5Qn0W0F7ry1iN0ZwIU5m/n7/BKB4hiZfc+zlZx7ly0= +github.com/go-git/go-git/v5 v5.15.0/go.mod h1:4Ge4alE/5gPs30F2H1esi2gPd69R0C39lolkucHBOp8= github.com/gogo/protobuf v0.0.0-20170307180453-100ba4e88506/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 h1:f+oWsMOmNPc8JmEHVZIycC7hBoQxHH9pNKQORJNozsQ= @@ -62,8 +62,8 @@ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5a github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= -github.com/google/go-github/v69 v69.2.0 h1:wR+Wi/fN2zdUx9YxSmYE0ktiX9IAR/BeePzeaUUbEHE= -github.com/google/go-github/v69 v69.2.0/go.mod h1:xne4jymxLR6Uj9b7J7PyTpkMYstEMMwGZa0Aehh1azM= +github.com/google/go-github/v71 v71.0.0 h1:Zi16OymGKZZMm8ZliffVVJ/Q9YZreDKONCr+WUd0Z30= +github.com/google/go-github/v71 v71.0.0/go.mod h1:URZXObp2BLlMjwu0O8g4y6VBneUj2bCHgnI8FfgZ51M= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= @@ -131,8 +131,8 @@ github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.36.0 h1:AnAEvhDddvBdpY+uR+MyHmuZzzNqXSe/GvuDeob5L34= -golang.org/x/crypto v0.36.0/go.mod h1:Y4J0ReaxCR1IMaabaSMugxJES1EpwhBHhv2bDHklZvc= +golang.org/x/crypto v0.37.0 h1:kJNSjF/Xp7kU0iB2Z+9viTPMW4EqqsrywMXLJOOsXSE= +golang.org/x/crypto v0.37.0/go.mod h1:vg+k43peMZ0pUMhYmVAWysMK35e6ioLh3wB8ZCAfbVc= golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 h1:2dVuKD2vS7b0QIHQbpyTISPd0LeHDbnYEryqj5Q1ug8= golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY= golang.org/x/mod v0.24.0 h1:ZfthKaKaT4NrhGVZHO1/WDTwGES4De8KtWO0SIbNJMU= @@ -140,11 +140,11 @@ golang.org/x/mod v0.24.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181005035420-146acd28ed58/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.37.0 h1:1zLorHbz+LYj7MQlSf1+2tPIIgibq2eL5xkrGk6f+2c= -golang.org/x/net v0.37.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8= +golang.org/x/net v0.39.0 h1:ZCu7HMWDxpXpaiKdhzIfaltL9Lp31x/3fCP11bc6/fY= +golang.org/x/net v0.39.0/go.mod h1:X7NRbYVEA+ewNkCNyJ513WmMdQ3BineSwVtN2zD/d+E= golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.28.0 h1:CrgCKl8PPAVtLnU3c+EDw6x11699EWlsDeWNWKdIOkc= -golang.org/x/oauth2 v0.28.0/go.mod h1:onh5ek6nERTohokkhCD/y2cV4Do3fxFHFuAejCkRWT8= +golang.org/x/oauth2 v0.29.0 h1:WdYw2tdTK1S8olAzWHdgeqfy+Mtm9XNhv/xJsY65d98= +golang.org/x/oauth2 v0.29.0/go.mod h1:onh5ek6nERTohokkhCD/y2cV4Do3fxFHFuAejCkRWT8= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20181005133103-4497e2df6f9e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -153,15 +153,15 @@ golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik= -golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= +golang.org/x/sys v0.32.0 h1:s77OFDvIQeibCmezSnk/q6iAfkdiQaJi4VzroCFrN20= +golang.org/x/sys v0.32.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.30.0 h1:PQ39fJZ+mfadBm0y5WlL4vlM7Sx1Hgf13sMIY2+QS9Y= -golang.org/x/term v0.30.0/go.mod h1:NYYFdzHoI5wRh/h5tDMdMqCqPJZEuNqVR5xJLd/n67g= +golang.org/x/term v0.31.0 h1:erwDkOK1Msy6offm1mOgvspSkslFnIGsFnxOKoufg3o= +golang.org/x/term v0.31.0/go.mod h1:R4BeIy7D95HzImkxGkTW1UQTtP54tio2RyHz7PwK0aw= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY= -golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4= +golang.org/x/text v0.24.0 h1:dd5Bzh4yt5KYA8f9CJHCP4FB4D51c2c6JvN37xJJkJ0= +golang.org/x/text v0.24.0/go.mod h1:L8rBsPeo2pSS+xqN0d5u2ikmjtmoJbDBT1b7nHvFCdU= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/internal/config/constants.go b/internal/config/constants.go index c664754..47871aa 100644 --- a/internal/config/constants.go +++ b/internal/config/constants.go @@ -42,22 +42,22 @@ const ( GitHubScriptActionVersion = "v7" // GoFmtVersion is the version of gofmt. // renovate: datasource=go depName=github.com/mvdan/gofumpt - GoFmtVersion = "v0.7.0" + GoFmtVersion = "v0.8.0" // GoImportsVersion is the version of goimports. // renovate: datasource=go depName=golang.org/x/tools - GoImportsVersion = "v0.31.0" + GoImportsVersion = "v0.32.0" // GoMockVersion is the version of gomock. // renovate: datasource=go depName=github.com/uber-go/mock - GoMockVersion = "v0.5.0" + GoMockVersion = "v0.5.1" // GolangCIlintVersion is the version of golangci-lint. // renovate: datasource=go depName=github.com/golangci/golangci-lint - GolangCIlintVersion = "v1.64.6" + GolangCIlintVersion = "v2.1.1" // GolangContainerImageVersion is the default golang container image. // renovate: datasource=docker versioning=docker depName=golang GolangContainerImageVersion = "1.24-alpine" // GoVersion is the version of Go. // renovate: datasource=github-tags extractVersion=^go(?.*)$ depName=golang/go - GoVersion = "1.24.1" + GoVersion = "1.24.2" // GrpcGatewayVersion is the version of grpc-gateway. // renovate: datasource=go depName=github.com/grpc-ecosystem/grpc-gateway GrpcGatewayVersion = "v2.26.3" @@ -72,13 +72,13 @@ const ( MarkdownLintCLIVersion = "0.44.0" // BunContainerImageVersion is the default bun container image. // renovate: datasource=docker versioning=docker depName=oven/bun - BunContainerImageVersion = "1.2.4-alpine" + BunContainerImageVersion = "1.2.9-alpine" // PkgsVersion is the version of pkgs. // renovate: datasource=github-tags depName=siderolabs/pkgs - PkgsVersion = "v1.10.0-alpha.0-37-g359807b" + PkgsVersion = "v1.10.0" // ProtobufGoVersion is the version of protobuf. // renovate: datasource=go depName=google.golang.org/protobuf/cmd/protoc-gen-go - ProtobufGoVersion = "v1.36.5" + ProtobufGoVersion = "v1.36.6" // ProtobufTSGatewayVersion is the version of protobuf-ts. // renovate: datasource=go depName=github.com/siderolabs/protoc-gen-grpc-gateway-ts ProtobufTSGatewayVersion = "v1.2.1" diff --git a/internal/output/files.go b/internal/output/files.go index 9ea4953..5b089f2 100644 --- a/internal/output/files.go +++ b/internal/output/files.go @@ -41,7 +41,7 @@ func (adapter *FileAdapter) Generate() error { // buffer the output before writing it down buffers := map[string]*bytes.Buffer{} - for _, filename := range adapter.FileWriter.Filenames() { + for _, filename := range adapter.Filenames() { buf := bytes.NewBuffer(nil) dir := filepath.Dir(filename) @@ -52,7 +52,7 @@ func (adapter *FileAdapter) Generate() error { } } - if err := adapter.FileWriter.GenerateFile(filename, buf); err != nil { + if err := adapter.GenerateFile(filename, buf); err != nil { if errors.Is(err, ErrSkip) { continue } @@ -64,7 +64,7 @@ func (adapter *FileAdapter) Generate() error { } // write everything back to the filesystem - for _, filename := range adapter.FileWriter.Filenames() { + for _, filename := range adapter.Filenames() { if _, ok := buffers[filename]; !ok { continue } diff --git a/internal/output/github/github.go b/internal/output/github/github.go index 97ddd48..d6aa8ba 100644 --- a/internal/output/github/github.go +++ b/internal/output/github/github.go @@ -10,7 +10,7 @@ import ( "fmt" "os" - "github.com/google/go-github/v69/github" + "github.com/google/go-github/v71/github" "golang.org/x/oauth2" ) diff --git a/internal/output/golangci/golangci.go b/internal/output/golangci/golangci.go index fb08ebb..06f1ec8 100644 --- a/internal/output/golangci/golangci.go +++ b/internal/output/golangci/golangci.go @@ -127,7 +127,7 @@ func (o *Output) buildTemplateData() (golangciLintTemplateData, error) { for line := range strings.Lines(sb.String()) { if line != "" { - indented.WriteString(" ") + indented.WriteString(" ") indented.WriteString(strings.TrimRight(line, "\n")) // ensure no double newlines indented.WriteByte('\n') } diff --git a/internal/output/golangci/golangci.yml b/internal/output/golangci/golangci.yml index 1a8f856..ae08e99 100644 --- a/internal/output/golangci/golangci.yml +++ b/internal/output/golangci/golangci.yml @@ -1,112 +1,28 @@ +version: "2" + # options for analysis running run: - timeout: 10m + modules-download-mode: readonly issues-exit-code: 1 tests: true - build-tags: [ ] - modules-download-mode: readonly # output configuration options output: formats: - - format: colored-line-number + text: path: stdout - print-issued-lines: true - print-linter-name: true + print-issued-lines: true + print-linter-name: true path-prefix: "" -# all available settings of specific linters -linters-settings: - dogsled: - max-blank-identifiers: 2 - dupl: - threshold: 150 - errcheck: - check-type-assertions: true - check-blank: true - exhaustive: - default-signifies-exhaustive: false - gci: - sections: - - standard # Standard section: captures all standard packages. - - default # Default section: contains all imports that could not be matched to another section type. - - localmodule # Imports from the same module. - gocognit: - min-complexity: 30 - nestif: - min-complexity: 5 - goconst: - min-len: 3 - min-occurrences: 3 - gocritic: - disabled-checks: [ ] - gocyclo: - min-complexity: 20 - godot: - scope: declarations - gofmt: - simplify: true - gomodguard: { } - govet: - enable-all: true - lll: - line-length: 200 - tab-width: 4 - misspell: - locale: US - ignore-words: [ ] - nakedret: - max-func-lines: 30 - prealloc: - simple: true - range-loops: true # Report preallocation suggestions on range loops, true by default - for-loops: false # Report preallocation suggestions on for loops, false by default - nolintlint: - allow-unused: false - allow-no-explanation: [ ] - require-explanation: false - require-specific: true - rowserrcheck: { } - testpackage: { } - unparam: - check-exported: false - unused: - local-variables-are-used: false - whitespace: - multi-if: false # Enforces newlines (or comments) after every multi-line if statement - multi-func: false # Enforces newlines (or comments) after every multi-line function signature - wsl: - strict-append: true - allow-assign-and-call: true - allow-multiline-assign: true - allow-cuddle-declarations: false - allow-trailing-comment: false - force-case-trailing-whitespace: 0 - force-err-cuddling: false - allow-separated-leading-comment: false - gofumpt: - extra-rules: false - cyclop: - # the maximal code complexity to report - max-complexity: 20 - depguard: - rules: - prevent_unmaintained_packages: - list-mode: lax # allow unless explicitly denied - files: - - $all - deny: - - pkg: io/ioutil - desc: "replaced by io and os packages since Go 1.16: https://tip.golang.org/doc/go1.16#ioutil" -{{ .DepguardExtraRules }} + linters: - enable-all: true - disable-all: false - fast: false + default: all disable: - exhaustruct - err113 - forbidigo + - funcorder - funlen - gochecknoglobals - gochecknoinits @@ -127,19 +43,113 @@ linters: - testifylint # complains about our assert recorder and has a number of false positives for assert.Greater(t, thing, 1) - protogetter # complains about us using Value field on typed spec, instead of GetValue which has a different signature - perfsprint # complains about us using fmt.Sprintf in non-performance critical code, updating just kres took too long - - goimports # same as gci - musttag # seems to be broken - goes into imported libraries and reports issues there - + # all available settings of specific linters + settings: + cyclop: + # the maximal code complexity to report + max-complexity: 20 + dogsled: + max-blank-identifiers: 2 + dupl: + threshold: 150 + errcheck: + check-type-assertions: true + check-blank: true + exhaustive: + default-signifies-exhaustive: false + gocognit: + min-complexity: 30 + nestif: + min-complexity: 5 + goconst: + min-len: 3 + min-occurrences: 3 + gocritic: + disabled-checks: [ ] + gocyclo: + min-complexity: 20 + godot: + scope: declarations + gomodguard: { } + govet: + enable-all: true + lll: + line-length: 200 + tab-width: 4 + misspell: + locale: US + nakedret: + max-func-lines: 30 + prealloc: + simple: true + range-loops: true # Report preallocation suggestions on range loops, true by default + for-loops: false # Report preallocation suggestions on for loops, false by default + nolintlint: + allow-unused: false + allow-no-explanation: [ ] + require-explanation: false + require-specific: true + rowserrcheck: { } + testpackage: { } + unparam: + check-exported: false + unused: + local-variables-are-used: false + whitespace: + multi-if: false # Enforces newlines (or comments) after every multi-line if statement + multi-func: false # Enforces newlines (or comments) after every multi-line function signature + wsl: + strict-append: true + allow-assign-and-call: true + allow-multiline-assign: true + allow-trailing-comment: false + force-case-trailing-whitespace: 0 + allow-separated-leading-comment: false + allow-cuddle-declarations: false + force-err-cuddling: false + depguard: + rules: + prevent_unmaintained_packages: + list-mode: lax # allow unless explicitly denied + files: + - $all + deny: + - pkg: io/ioutil + desc: "replaced by io and os packages since Go 1.16: https://tip.golang.org/doc/go1.16#ioutil" +{{ .DepguardExtraRules }} + exclusions: + generated: lax + paths: + - third_party$ + - builtin$ + - examples$ issues: - exclude: [ ] - exclude-rules: [ ] - exclude-use-default: false - exclude-case-sensitive: false max-issues-per-linter: 10 max-same-issues: 3 - new: false uniq-by-line: true + new: false severity: - default-severity: error - case-sensitive: false + default: error +formatters: + enable: + - gci + - gofmt + - gofumpt + settings: + gci: + sections: + - standard + - default + - localmodule + gofmt: + simplify: true + gofumpt: + extra-rules: false + exclusions: + generated: lax + paths: + - third_party$ + - builtin$ + - examples$ diff --git a/internal/project/common/repository.go b/internal/project/common/repository.go index cc76658..d8b9642 100644 --- a/internal/project/common/repository.go +++ b/internal/project/common/repository.go @@ -10,7 +10,7 @@ import ( "net/http" "slices" - "github.com/google/go-github/v69/github" + "github.com/google/go-github/v71/github" "github.com/siderolabs/gen/xslices" "github.com/siderolabs/kres/internal/config" diff --git a/internal/project/golang/linters.go b/internal/project/golang/linters.go index 7d9954b..b22d1bd 100644 --- a/internal/project/golang/linters.go +++ b/internal/project/golang/linters.go @@ -41,7 +41,7 @@ func (linters *Linters) ToolchainBuild(stage *dockerfile.Stage) error { Step(step.Arg("GOLANGCILINT_VERSION")). Step(step.Script( fmt.Sprintf( - "go install github.com/golangci/golangci-lint/cmd/golangci-lint@${GOLANGCILINT_VERSION} \\\n"+ + "go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@${GOLANGCILINT_VERSION} \\\n"+ "\t&& mv /go/bin/golangci-lint %s/golangci-lint", linters.meta.BinPath), ). MountCache(filepath.Join(linters.meta.CachePath, "go-build"), linters.meta.GitHubRepository).