From 596a1850b3cbf9daf1e72f0e100816a50ae3f724 Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Mon, 30 Jun 2025 00:04:46 +0200 Subject: [PATCH 01/14] docs: update GitHub Action assets --- assets/github-action-config-v2.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/github-action-config-v2.json b/assets/github-action-config-v2.json index c0f5a8b27af7..ab0063893586 100644 --- a/assets/github-action-config-v2.json +++ b/assets/github-action-config-v2.json @@ -1,7 +1,7 @@ { "MinorVersionToConfig": { "latest": { - "TargetVersion": "v2.1.6" + "TargetVersion": "v2.2.1" }, "v1.10": { "Error": "golangci-lint version 'v1.10' isn't supported: we support only v2.0.0 and later versions" @@ -196,7 +196,7 @@ "TargetVersion": "v2.1.6" }, "v2.2": { - "TargetVersion": "v2.2.0" + "TargetVersion": "v2.2.1" } } } From dc04404bab4fb20f869b6e46f398a77ddfda26b0 Mon Sep 17 00:00:00 2001 From: Ludovic Fernandez Date: Mon, 30 Jun 2025 23:06:27 +0200 Subject: [PATCH 02/14] dev: fix GitHub Action assets generation (#5906) --- assets/github-action-config-v1.json | 2 +- assets/github-action-config.json | 2 +- scripts/gen_github_action_config/main.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/assets/github-action-config-v1.json b/assets/github-action-config-v1.json index f5cfae5a16a5..9ca1dd8c8d99 100644 --- a/assets/github-action-config-v1.json +++ b/assets/github-action-config-v1.json @@ -196,7 +196,7 @@ "Error": "golangci-lint version 'v2.1' isn't supported: only v1 versions are supported" }, "v2.2": { - "Error": "golangci-lint version 'v2.1' isn't supported: only v1 versions are supported" + "Error": "golangci-lint version 'v2.2' isn't supported: only v1 versions are supported" } } } diff --git a/assets/github-action-config.json b/assets/github-action-config.json index f5cfae5a16a5..9ca1dd8c8d99 100644 --- a/assets/github-action-config.json +++ b/assets/github-action-config.json @@ -196,7 +196,7 @@ "Error": "golangci-lint version 'v2.1' isn't supported: only v1 versions are supported" }, "v2.2": { - "Error": "golangci-lint version 'v2.1' isn't supported: only v1 versions are supported" + "Error": "golangci-lint version 'v2.2' isn't supported: only v1 versions are supported" } } } diff --git a/scripts/gen_github_action_config/main.go b/scripts/gen_github_action_config/main.go index 2324b7de7505..a2bd9dc7fb37 100644 --- a/scripts/gen_github_action_config/main.go +++ b/scripts/gen_github_action_config/main.go @@ -103,7 +103,7 @@ func fetchAllReleases(ctx context.Context) ([]release, error) { EndCursor githubv4.String HasNextPage bool } - } `graphql:"releases(first: 100, orderBy: { field: CREATED_AT, direction: DESC }, after: $releasesCursor)"` + } `graphql:"releases(first: 80, orderBy: { field: CREATED_AT, direction: DESC }, after: $releasesCursor)"` } `graphql:"repository(owner: $owner, name: $name)"` } From fb86fc8038a65b82acbeadb55f88d20bedf3113b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 1 Jul 2025 15:03:35 +0200 Subject: [PATCH 03/14] build(deps): bump the linter-testdata group across 2 directories with 3 updates (#5908) --- pkg/golinters/protogetter/testdata/go.mod | 4 +-- pkg/golinters/protogetter/testdata/go.sum | 32 +++++++++++------------ pkg/golinters/spancheck/testdata/go.mod | 6 ++--- pkg/golinters/spancheck/testdata/go.sum | 12 ++++----- 4 files changed, 27 insertions(+), 27 deletions(-) diff --git a/pkg/golinters/protogetter/testdata/go.mod b/pkg/golinters/protogetter/testdata/go.mod index ac7bf891a2f6..bdd07846bc6e 100644 --- a/pkg/golinters/protogetter/testdata/go.mod +++ b/pkg/golinters/protogetter/testdata/go.mod @@ -3,7 +3,7 @@ module protogetter go 1.23.0 require ( - google.golang.org/grpc v1.72.2 + google.golang.org/grpc v1.73.0 google.golang.org/protobuf v1.36.6 ) @@ -11,5 +11,5 @@ require ( golang.org/x/net v0.40.0 // indirect golang.org/x/sys v0.33.0 // indirect golang.org/x/text v0.25.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20250218202821-56aae31c358a // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20250324211829-b45e905df463 // indirect ) diff --git a/pkg/golinters/protogetter/testdata/go.sum b/pkg/golinters/protogetter/testdata/go.sum index 88c148026714..4c7396c01aaa 100644 --- a/pkg/golinters/protogetter/testdata/go.sum +++ b/pkg/golinters/protogetter/testdata/go.sum @@ -4,31 +4,31 @@ github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= -github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= -github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +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/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA= go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A= -go.opentelemetry.io/otel v1.34.0 h1:zRLXxLCgL1WyKsPVrgbSdMN4c0FMkDAskSTQP+0hdUY= -go.opentelemetry.io/otel v1.34.0/go.mod h1:OWFPOQ+h4G8xpyjgqo4SxJYdDQ/qmRH+wivy7zzx9oI= -go.opentelemetry.io/otel/metric v1.34.0 h1:+eTR3U0MyfWjRDhmFMxe2SsW64QrZ84AOhvqS7Y+PoQ= -go.opentelemetry.io/otel/metric v1.34.0/go.mod h1:CEDrp0fy2D0MvkXE+dPV7cMi8tWZwX3dmaIhwPOaqHE= -go.opentelemetry.io/otel/sdk v1.34.0 h1:95zS4k/2GOy069d321O8jWgYsW3MzVV+KuSPKp7Wr1A= -go.opentelemetry.io/otel/sdk v1.34.0/go.mod h1:0e/pNiaMAqaykJGKbi+tSjWfNNHMTxoC9qANsCzbyxU= -go.opentelemetry.io/otel/sdk/metric v1.34.0 h1:5CeK9ujjbFVL5c1PhLuStg1wxA7vQv7ce1EK0Gyvahk= -go.opentelemetry.io/otel/sdk/metric v1.34.0/go.mod h1:jQ/r8Ze28zRKoNRdkjCZxfs6YvBTG1+YIqyFVFYec5w= -go.opentelemetry.io/otel/trace v1.34.0 h1:+ouXS2V8Rd4hp4580a8q23bg0azF2nI8cqLYnC8mh/k= -go.opentelemetry.io/otel/trace v1.34.0/go.mod h1:Svm7lSjQD7kG7KJ/MUHPVXSDGz2OX4h0M2jHBhmSfRE= +go.opentelemetry.io/otel v1.35.0 h1:xKWKPxrxB6OtMCbmMY021CqC45J+3Onta9MqjhnusiQ= +go.opentelemetry.io/otel v1.35.0/go.mod h1:UEqy8Zp11hpkUrL73gSlELM0DupHoiq72dR+Zqel/+Y= +go.opentelemetry.io/otel/metric v1.35.0 h1:0znxYu2SNyuMSQT4Y9WDWej0VpcsxkuklLa4/siN90M= +go.opentelemetry.io/otel/metric v1.35.0/go.mod h1:nKVFgxBZ2fReX6IlyW28MgZojkoAkJGaE8CpgeAU3oE= +go.opentelemetry.io/otel/sdk v1.35.0 h1:iPctf8iprVySXSKJffSS79eOjl9pvxV9ZqOWT0QejKY= +go.opentelemetry.io/otel/sdk v1.35.0/go.mod h1:+ga1bZliga3DxJ3CQGg3updiaAJoNECOgJREo9KHGQg= +go.opentelemetry.io/otel/sdk/metric v1.35.0 h1:1RriWBmCKgkeHEhM7a2uMjMUfP7MsOF5JpUCaEqEI9o= +go.opentelemetry.io/otel/sdk/metric v1.35.0/go.mod h1:is6XYCUMpcKi+ZsOvfluY5YstFnhW0BidkR+gL+qN+w= +go.opentelemetry.io/otel/trace v1.35.0 h1:dPpEfJu1sDIqruz7BHFG3c7528f6ddfSWfFDVt/xgMs= +go.opentelemetry.io/otel/trace v1.35.0/go.mod h1:WUk7DtFp1Aw2MkvqGdwiXYDZZNvA/1J8o6xRXLrIkyc= golang.org/x/net v0.40.0 h1:79Xs7wF06Gbdcg4kdCCIQArK11Z1hr5POQ6+fIYHNuY= golang.org/x/net v0.40.0/go.mod h1:y0hY0exeL2Pku80/zKK7tpntoX23cqL3Oa6njdgRtds= golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw= golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= golang.org/x/text v0.25.0 h1:qVyWApTSYLk/drJRO5mDlNYskwQznZmkpV2c8q9zls4= golang.org/x/text v0.25.0/go.mod h1:WEdwpYrmk1qmdHvhkSTNPm3app7v4rsT8F2UD6+VHIA= -google.golang.org/genproto/googleapis/rpc v0.0.0-20250218202821-56aae31c358a h1:51aaUVRocpvUOSQKM6Q7VuoaktNIaMCLuhZB6DKksq4= -google.golang.org/genproto/googleapis/rpc v0.0.0-20250218202821-56aae31c358a/go.mod h1:uRxBH1mhmO8PGhU89cMcHaXKZqO+OfakD8QQO0oYwlQ= -google.golang.org/grpc v1.72.2 h1:TdbGzwb82ty4OusHWepvFWGLgIbNo1/SUynEN0ssqv8= -google.golang.org/grpc v1.72.2/go.mod h1:wH5Aktxcg25y1I3w7H69nHfXdOG3UiadoBtjh3izSDM= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250324211829-b45e905df463 h1:e0AIkUUhxyBKh6ssZNrAMeqhA7RKUj42346d1y02i2g= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250324211829-b45e905df463/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A= +google.golang.org/grpc v1.73.0 h1:VIWSmpI2MegBtTuFt5/JWy2oXxtjJ/e89Z70ImfD2ok= +google.golang.org/grpc v1.73.0/go.mod h1:50sbHOUqWoCQGI8V2HQLJM0B+LMlIUjNSZmow7EVBQc= google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY= google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY= diff --git a/pkg/golinters/spancheck/testdata/go.mod b/pkg/golinters/spancheck/testdata/go.mod index 256ae9e1b2a9..8ebf4b84e5c2 100644 --- a/pkg/golinters/spancheck/testdata/go.mod +++ b/pkg/golinters/spancheck/testdata/go.mod @@ -3,13 +3,13 @@ module spancheck go 1.23.0 require ( - go.opentelemetry.io/otel v1.36.0 - go.opentelemetry.io/otel/trace v1.36.0 + go.opentelemetry.io/otel v1.37.0 + go.opentelemetry.io/otel/trace v1.37.0 ) require ( github.com/go-logr/logr v1.4.3 // indirect github.com/go-logr/stdr v1.2.2 // indirect go.opentelemetry.io/auto/sdk v1.1.0 // indirect - go.opentelemetry.io/otel/metric v1.36.0 // indirect + go.opentelemetry.io/otel/metric v1.37.0 // indirect ) diff --git a/pkg/golinters/spancheck/testdata/go.sum b/pkg/golinters/spancheck/testdata/go.sum index da8e1100881e..6724d88508a6 100644 --- a/pkg/golinters/spancheck/testdata/go.sum +++ b/pkg/golinters/spancheck/testdata/go.sum @@ -13,11 +13,11 @@ github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOf github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA= go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A= -go.opentelemetry.io/otel v1.36.0 h1:UumtzIklRBY6cI/lllNZlALOF5nNIzJVb16APdvgTXg= -go.opentelemetry.io/otel v1.36.0/go.mod h1:/TcFMXYjyRNh8khOAO9ybYkqaDBb/70aVwkNML4pP8E= -go.opentelemetry.io/otel/metric v1.36.0 h1:MoWPKVhQvJ+eeXWHFBOPoBOi20jh6Iq2CcCREuTYufE= -go.opentelemetry.io/otel/metric v1.36.0/go.mod h1:zC7Ks+yeyJt4xig9DEw9kuUFe5C3zLbVjV2PzT6qzbs= -go.opentelemetry.io/otel/trace v1.36.0 h1:ahxWNuqZjpdiFAyrIoQ4GIiAIhxAunQR6MUoKrsNd4w= -go.opentelemetry.io/otel/trace v1.36.0/go.mod h1:gQ+OnDZzrybY4k4seLzPAWNwVBBVlF2szhehOBB/tGA= +go.opentelemetry.io/otel v1.37.0 h1:9zhNfelUvx0KBfu/gb+ZgeAfAgtWrfHJZcAqFC228wQ= +go.opentelemetry.io/otel v1.37.0/go.mod h1:ehE/umFRLnuLa/vSccNq9oS1ErUlkkK71gMcN34UG8I= +go.opentelemetry.io/otel/metric v1.37.0 h1:mvwbQS5m0tbmqML4NqK+e3aDiO02vsf/WgbsdpcPoZE= +go.opentelemetry.io/otel/metric v1.37.0/go.mod h1:04wGrZurHYKOc+RKeye86GwKiTb9FKm1WHtO+4EVr2E= +go.opentelemetry.io/otel/trace v1.37.0 h1:HLdcFNbRQBE2imdSEgm/kwqmQj1Or1l/7bW6mxVK7z4= +go.opentelemetry.io/otel/trace v1.37.0/go.mod h1:TlgrlQ+PtQO5XFerSPUYG0JSgGyryXewPGyayAWSBS0= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= From 4fe2e59ba9cbe6022d35edac72f671eff3f07354 Mon Sep 17 00:00:00 2001 From: Ludovic Fernandez Date: Fri, 4 Jul 2025 21:34:43 +0200 Subject: [PATCH 04/14] docs: add the command to check the Go version used to build (#5913) --- docs/src/docs/welcome/faq.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/docs/welcome/faq.mdx b/docs/src/docs/welcome/faq.mdx index 62109ac5afb7..381502a4615e 100644 --- a/docs/src/docs/welcome/faq.mdx +++ b/docs/src/docs/welcome/faq.mdx @@ -44,7 +44,7 @@ If there are `typecheck` errors, golangci-lint will not be able to produce other How to troubleshoot: -- [ ] Ensure the version of golangci-lint is built with a compatible version of Go. +- [ ] Ensure the version of golangci-lint is built with a compatible version of Go (`golangci-lint version`). - [ ] Ensure dependencies are up to date with `go mod tidy`. - [ ] Ensure building works with `go run ./...`/`go build ./...` - whole package. - [ ] Ensure you are not running an analysis on code that depends on files/packages outside the scope of the analyzed elements. From aaeb9a25eb3032a62784f343d095a18d8f0b1b0a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 6 Jul 2025 13:45:07 +0200 Subject: [PATCH 05/14] build(deps): bump github.com/alecthomas/chroma/v2 from 2.18.0 to 2.19.0 (#5914) --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index db07bb6dab09..1a435e40bb8a 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24 github.com/GaijinEntertainment/go-exhaustruct/v3 v3.3.1 github.com/OpenPeeDeeP/depguard/v2 v2.2.1 - github.com/alecthomas/chroma/v2 v2.18.0 + github.com/alecthomas/chroma/v2 v2.19.0 github.com/alecthomas/go-check-sumtype v0.3.1 github.com/alexkohler/nakedret/v2 v2.0.6 github.com/alexkohler/prealloc v1.0.0 diff --git a/go.sum b/go.sum index 51a82b62990a..af15bd6a3c01 100644 --- a/go.sum +++ b/go.sum @@ -63,8 +63,8 @@ github.com/OpenPeeDeeP/depguard/v2 v2.2.1 h1:vckeWVESWp6Qog7UZSARNqfu/cZqvki8zsu github.com/OpenPeeDeeP/depguard/v2 v2.2.1/go.mod h1:q4DKzC4UcVaAvcfd41CZh0PWpGgzrVxUYBlgKNGquUo= github.com/alecthomas/assert/v2 v2.11.0 h1:2Q9r3ki8+JYXvGsDyBXwH3LcJ+WK5D0gc5E8vS6K3D0= github.com/alecthomas/assert/v2 v2.11.0/go.mod h1:Bze95FyfUr7x34QZrjL+XP+0qgp/zg8yS+TtBj1WA3k= -github.com/alecthomas/chroma/v2 v2.18.0 h1:6h53Q4hW83SuF+jcsp7CVhLsMozzvQvO8HBbKQW+gn4= -github.com/alecthomas/chroma/v2 v2.18.0/go.mod h1:RVX6AvYm4VfYe/zsk7mjHueLDZor3aWCNE14TFlepBk= +github.com/alecthomas/chroma/v2 v2.19.0 h1:Im+SLRgT8maArxv81mULDWN8oKxkzboH07CHesxElq4= +github.com/alecthomas/chroma/v2 v2.19.0/go.mod h1:RVX6AvYm4VfYe/zsk7mjHueLDZor3aWCNE14TFlepBk= github.com/alecthomas/go-check-sumtype v0.3.1 h1:u9aUvbGINJxLVXiFvHUlPEaD7VDULsrxJb4Aq31NLkU= github.com/alecthomas/go-check-sumtype v0.3.1/go.mod h1:A8TSiN3UPRw3laIgWEUOHHLPa6/r9MtoigdlP5h3K/E= github.com/alecthomas/repr v0.4.0 h1:GhI2A8MACjfegCPVq9f1FLvIBS+DrQ2KQBFZP1iFzXc= From b0c55d28660363573984e9e76214d2136973963b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 6 Jul 2025 13:45:32 +0200 Subject: [PATCH 06/14] build(deps): bump github.com/shirou/gopsutil/v4 from 4.25.5 to 4.25.6 (#5918) --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 1a435e40bb8a..0ea80a835489 100644 --- a/go.mod +++ b/go.mod @@ -101,7 +101,7 @@ require ( github.com/sashamelentyev/interfacebloat v1.1.0 github.com/sashamelentyev/usestdlibvars v1.29.0 github.com/securego/gosec/v2 v2.22.5 - github.com/shirou/gopsutil/v4 v4.25.5 + github.com/shirou/gopsutil/v4 v4.25.6 github.com/sirupsen/logrus v1.9.3 github.com/sivchari/containedctx v1.0.3 github.com/sonatard/noctx v0.3.4 diff --git a/go.sum b/go.sum index af15bd6a3c01..dab2774e9ca2 100644 --- a/go.sum +++ b/go.sum @@ -524,8 +524,8 @@ github.com/securego/gosec/v2 v2.22.5 h1:ySws9uwOeE42DsG54v2moaJfh7r08Ev7SAYJuoMD github.com/securego/gosec/v2 v2.22.5/go.mod h1:AWfgrFsVewk5LKobsPWlygCHt8K91boVPyL6GUZG5NY= github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= -github.com/shirou/gopsutil/v4 v4.25.5 h1:rtd9piuSMGeU8g1RMXjZs9y9luK5BwtnG7dZaQUJAsc= -github.com/shirou/gopsutil/v4 v4.25.5/go.mod h1:PfybzyydfZcN+JMMjkF6Zb8Mq1A/VcogFFg7hj50W9c= +github.com/shirou/gopsutil/v4 v4.25.6 h1:kLysI2JsKorfaFPcYmcJqbzROzsBWEOAtw6A7dIfqXs= +github.com/shirou/gopsutil/v4 v4.25.6/go.mod h1:PfybzyydfZcN+JMMjkF6Zb8Mq1A/VcogFFg7hj50W9c= github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk= github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041/go.mod h1:N5mDOmsrJOB+vfqUK+7DmDyjhSLIIBnXo9lvZJj3MWQ= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= From f6b5aa31704fbfe1845f0453de142fc8f0e303db Mon Sep 17 00:00:00 2001 From: Ludovic Fernandez Date: Mon, 7 Jul 2025 13:06:21 +0200 Subject: [PATCH 07/14] godot: add noinline value into the JSONSchema (#5922) --- jsonschema/golangci.jsonschema.json | 2 +- jsonschema/golangci.next.jsonschema.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/jsonschema/golangci.jsonschema.json b/jsonschema/golangci.jsonschema.json index 5c867a4d8415..3e51264fec47 100644 --- a/jsonschema/golangci.jsonschema.json +++ b/jsonschema/golangci.jsonschema.json @@ -1813,7 +1813,7 @@ "properties": { "scope": { "description": "Comments to be checked.", - "enum": ["declarations", "toplevel", "all"], + "enum": ["declarations", "toplevel", "all", "noinline"], "default": "declarations" }, "exclude": { diff --git a/jsonschema/golangci.next.jsonschema.json b/jsonschema/golangci.next.jsonschema.json index 5c867a4d8415..3e51264fec47 100644 --- a/jsonschema/golangci.next.jsonschema.json +++ b/jsonschema/golangci.next.jsonschema.json @@ -1813,7 +1813,7 @@ "properties": { "scope": { "description": "Comments to be checked.", - "enum": ["declarations", "toplevel", "all"], + "enum": ["declarations", "toplevel", "all", "noinline"], "default": "declarations" }, "exclude": { From 98932bab59f530e63a93d9edb6abef39a755a462 Mon Sep 17 00:00:00 2001 From: Ludovic Fernandez Date: Wed, 9 Jul 2025 14:59:27 +0200 Subject: [PATCH 08/14] docs: fix tutorial URL (#5925) --- docs/src/docs/contributing/new-linters.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/docs/contributing/new-linters.mdx b/docs/src/docs/contributing/new-linters.mdx index 57654e887f89..8c206a042a99 100644 --- a/docs/src/docs/contributing/new-linters.mdx +++ b/docs/src/docs/contributing/new-linters.mdx @@ -4,7 +4,7 @@ title: New linters ## How to write a linter -Use `go/analysis` and take a look at [this tutorial](https://disaev.me/p/writing-useful-go-analysis-linter/): +Use `go/analysis` and take a look at [this tutorial](https://web.archive.org/web/20250527152107/https://disaev.me/p/writing-useful-go-analysis-linter/): it shows how to write `go/analysis` linter from scratch and integrate it into `golangci-lint`. ## How to add a public linter to `golangci-lint` From 466ecf2de177cb39f2e2cfe5b4f0c26b76b92d48 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 10 Jul 2025 18:00:32 +0200 Subject: [PATCH 09/14] build(deps): bump golang.org/x/mod from 0.25.0 to 0.26.0 (#5927) --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 0ea80a835489..a553a79ea76e 100644 --- a/go.mod +++ b/go.mod @@ -133,7 +133,7 @@ require ( go.augendre.info/arangolint v0.2.0 go.augendre.info/fatcontext v0.8.0 go.uber.org/automaxprocs v1.6.0 - golang.org/x/mod v0.25.0 + golang.org/x/mod v0.26.0 golang.org/x/sys v0.33.0 golang.org/x/tools v0.34.0 gopkg.in/yaml.v3 v3.0.1 diff --git a/go.sum b/go.sum index dab2774e9ca2..43861b903110 100644 --- a/go.sum +++ b/go.sum @@ -698,8 +698,8 @@ golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91 golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.13.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= -golang.org/x/mod v0.25.0 h1:n7a+ZbQKQA/Ysbyb0/6IbB1H/X41mKgbhfv7AfG/44w= -golang.org/x/mod v0.25.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww= +golang.org/x/mod v0.26.0 h1:EGMPT//Ezu+ylkCijjPc+f4Aih7sZvaAr+O3EHBxvZg= +golang.org/x/mod v0.26.0/go.mod h1:/j6NAhSk8iQ723BGAUyoAcn7SlD7s15Dp9Nd/SfeaFQ= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= From b2b08ace3a0f0941451caee8f8d34fb05959aba2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 10 Jul 2025 18:01:48 +0200 Subject: [PATCH 10/14] build(deps): bump github.com/AlwxSin/noinlineerr from 1.0.3 to 1.0.4 (#5928) --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index a553a79ea76e..e262c3fb3d43 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( 4d63.com/gochecknoglobals v0.2.2 github.com/4meepo/tagalign v1.4.2 github.com/Abirdcfly/dupword v0.1.6 - github.com/AlwxSin/noinlineerr v1.0.3 + github.com/AlwxSin/noinlineerr v1.0.4 github.com/Antonboom/errname v1.1.0 github.com/Antonboom/nilnil v1.1.0 github.com/Antonboom/testifylint v1.6.1 diff --git a/go.sum b/go.sum index 43861b903110..c166f2757c46 100644 --- a/go.sum +++ b/go.sum @@ -41,8 +41,8 @@ github.com/4meepo/tagalign v1.4.2 h1:0hcLHPGMjDyM1gHG58cS73aQF8J4TdVR96TZViorO9E github.com/4meepo/tagalign v1.4.2/go.mod h1:+p4aMyFM+ra7nb41CnFG6aSDXqRxU/w1VQqScKqDARI= github.com/Abirdcfly/dupword v0.1.6 h1:qeL6u0442RPRe3mcaLcbaCi2/Y/hOcdtw6DE9odjz9c= github.com/Abirdcfly/dupword v0.1.6/go.mod h1:s+BFMuL/I4YSiFv29snqyjwzDp4b65W2Kvy+PKzZ6cw= -github.com/AlwxSin/noinlineerr v1.0.3 h1:9b5edChzzwX30BuBci13LHVZHF5q7hW9qtrs+wJdDog= -github.com/AlwxSin/noinlineerr v1.0.3/go.mod h1:+QgkkoYrMH7RHvcdxdlI7vYYEdgeoFOVjU9sUhw/rQc= +github.com/AlwxSin/noinlineerr v1.0.4 h1:+WeO27L9bora38Quw+we2Tt0tr/UKJLP5bOMxwEeO5Y= +github.com/AlwxSin/noinlineerr v1.0.4/go.mod h1:+QgkkoYrMH7RHvcdxdlI7vYYEdgeoFOVjU9sUhw/rQc= github.com/Antonboom/errname v1.1.0 h1:A+ucvdpMwlo/myWrkHEUEBWc/xuXdud23S8tmTb/oAE= github.com/Antonboom/errname v1.1.0/go.mod h1:O1NMrzgUcVBGIfi3xlVuvX8Q/VP/73sseCaAppfjqZw= github.com/Antonboom/nilnil v1.1.0 h1:jGxJxjgYS3VUUtOTNk8Z1icwT5ESpLH/426fjmQG+ng= From 80027c4d526d2c993f513871bdcd4deb3b9702f8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 10 Jul 2025 19:08:35 +0200 Subject: [PATCH 11/14] build(deps): bump golang.org/x/sys from 0.33.0 to 0.34.0 (#5931) --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index e262c3fb3d43..910cf3bac2b3 100644 --- a/go.mod +++ b/go.mod @@ -134,7 +134,7 @@ require ( go.augendre.info/fatcontext v0.8.0 go.uber.org/automaxprocs v1.6.0 golang.org/x/mod v0.26.0 - golang.org/x/sys v0.33.0 + golang.org/x/sys v0.34.0 golang.org/x/tools v0.34.0 gopkg.in/yaml.v3 v3.0.1 honnef.co/go/tools v0.6.1 diff --git a/go.sum b/go.sum index c166f2757c46..1403473107d3 100644 --- a/go.sum +++ b/go.sum @@ -817,8 +817,8 @@ golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw= -golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= +golang.org/x/sys v0.34.0 h1:H5Y5sJ2L2JRdyv7ROF1he/lPdvFsd0mJHFw2ThKHxLA= +golang.org/x/sys v0.34.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= From 059cc527e09b34f562e2dbaba23de3e4801dcff2 Mon Sep 17 00:00:00 2001 From: Ludovic Fernandez Date: Thu, 10 Jul 2025 23:43:54 +0200 Subject: [PATCH 12/14] docs: improve debug keys documentation (#5930) --- pkg/commands/fmt.go | 4 +--- pkg/logutils/logutils.go | 46 ++++++++++++++++++++-------------------- 2 files changed, 24 insertions(+), 26 deletions(-) diff --git a/pkg/commands/fmt.go b/pkg/commands/fmt.go index 502dcebdfe9c..c1ba8716612f 100644 --- a/pkg/commands/fmt.go +++ b/pkg/commands/fmt.go @@ -37,15 +37,13 @@ type fmtCommand struct { runner *goformat.Runner - log logutils.Log - debugf logutils.DebugFunc + log logutils.Log } func newFmtCommand(logger logutils.Log, info BuildInfo) *fmtCommand { c := &fmtCommand{ viper: viper.New(), log: logger, - debugf: logutils.Debug(logutils.DebugKeyExec), cfg: config.NewDefault(), buildInfo: info, } diff --git a/pkg/logutils/logutils.go b/pkg/logutils/logutils.go index e417ac4b738d..bfd4544aa08e 100644 --- a/pkg/logutils/logutils.go +++ b/pkg/logutils/logutils.go @@ -16,23 +16,20 @@ const EnvTestRun = "GL_TEST_RUN" const envDebug = "GL_DEBUG" const ( - DebugKeyBinSalt = "bin_salt" - DebugKeyGoModSalt = "gomod_salt" - DebugKeyConfigReader = "config_reader" - DebugKeyEmpty = "" - DebugKeyEnabledLinters = "enabled_linters" - DebugKeyExec = "exec" - DebugKeyFormatter = "formatter" - DebugKeyFormattersOutput = "formatters_output" - DebugKeyGoEnv = "goenv" - DebugKeyLintersContext = "linters_context" - DebugKeyLintersDB = "lintersdb" - DebugKeyLintersOutput = "linters_output" - DebugKeyLoader = "loader" // Debugs packages loading (including `go/packages` internal debugging). - DebugKeyPkgCache = "pkgcache" - DebugKeyRunner = "runner" - DebugKeyStopwatch = "stopwatch" - DebugKeyTest = "test" + DebugKeyBinSalt = "bin_salt" // Forces the usage of constant as salt (only for maintainers). + DebugKeyGoModSalt = "gomod_salt" // Display logs related to the salt computation from the go.mod file. + DebugKeyConfigReader = "config_reader" // Display logs related to configuration loading. + DebugKeyEmpty = "" + DebugKeyEnabledLinters = "enabled_linters" // Display logs related to the enabled linters inside the [lintersdb.Manager]. + DebugKeyExec = "exec" // Display logs related to the lock file. + DebugKeyGoEnv = "goenv" // Display logs related to [goenv.Env]. + DebugKeyLintersContext = "linters_context" // Display logs related to the package analysis context (not related to [context.Context]). + DebugKeyLintersDB = "lintersdb" // Display logs related to the linters/formatters loading. + DebugKeyLoader = "loader" // Display logs related to package loading (including `go/packages` internal debugging). + DebugKeyPkgCache = "pkgcache" // Display logs related to cache. + DebugKeyRunner = "runner" // Display logs related to the linter runner. + DebugKeyStopwatch = "stopwatch" // Display logs related to the stopwatch of the cache. + DebugKeyTest = "test" // Display debug logs during integration tests. ) // Printers. @@ -59,7 +56,6 @@ const ( DebugKeyPathPrettifier = "path_prettifier" DebugKeyPathRelativity = "path_relativity" DebugKeySeverityRules = "severity_rules" - DebugKeySkipDirs = "skip_dirs" DebugKeySourceCode = "source_code" ) @@ -77,12 +73,16 @@ const ( DebugKeyGoAnalysisFactsInherit = DebugKeyGoAnalysisFacts + "/inherit" ) -// Linters. +// Linters and Formatters. const ( - DebugKeyForbidigo = "forbidigo" // Debugs `forbidigo` linter. - DebugKeyGoCritic = "gocritic" // Debugs `gocritic` linter. - DebugKeyGovet = "govet" // Debugs `govet` linter. - DebugKeyLinter = "linter" + DebugKeyFormatter = "formatter" // Display logs from the shared logger for formatters. + DebugKeyFormattersOutput = "formatters_output" // Display logs from formatters themselves. + DebugKeyLinter = "linter" // Display logs from the shared logger for linters. + DebugKeyLintersOutput = "linters_output" // Display logs from linters themselves. + + DebugKeyForbidigo = "forbidigo" // Debugs `forbidigo` linter. + DebugKeyGoCritic = "gocritic" // Debugs `gocritic` linter. + DebugKeyGovet = "govet" // Debugs `govet` linter. DebugKeyRevive = "revive" // Debugs `revive` linter. DebugKeyStaticcheck = "staticcheck" // Debugs `staticcheck` linter. ) From 7c8ce4674a4df792b3d54b9091f73e684a44daf2 Mon Sep 17 00:00:00 2001 From: Ludovic Fernandez Date: Fri, 11 Jul 2025 00:18:08 +0200 Subject: [PATCH 13/14] fix: panic: close of closed channel (#5929) --- go.mod | 2 +- pkg/goanalysis/runner_action.go | 5 +++- pkg/goanalysis/runner_loadingpackage.go | 32 +++++++++++-------------- 3 files changed, 19 insertions(+), 20 deletions(-) diff --git a/go.mod b/go.mod index 910cf3bac2b3..d44875f075cd 100644 --- a/go.mod +++ b/go.mod @@ -134,6 +134,7 @@ require ( go.augendre.info/fatcontext v0.8.0 go.uber.org/automaxprocs v1.6.0 golang.org/x/mod v0.26.0 + golang.org/x/sync v0.15.0 golang.org/x/sys v0.34.0 golang.org/x/tools v0.34.0 gopkg.in/yaml.v3 v3.0.1 @@ -213,7 +214,6 @@ require ( go.uber.org/zap v1.24.0 // indirect golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 // indirect golang.org/x/exp/typeparams v0.0.0-20250210185358-939b2ce775ac // indirect - golang.org/x/sync v0.15.0 // indirect golang.org/x/text v0.26.0 // indirect google.golang.org/protobuf v1.36.6 // indirect gopkg.in/ini.v1 v1.67.0 // indirect diff --git a/pkg/goanalysis/runner_action.go b/pkg/goanalysis/runner_action.go index 855b769bcc99..c25324b7783e 100644 --- a/pkg/goanalysis/runner_action.go +++ b/pkg/goanalysis/runner_action.go @@ -1,6 +1,7 @@ package goanalysis import ( + "context" "fmt" "runtime/debug" @@ -28,12 +29,14 @@ func (actAlloc *actionAllocator) alloc() *action { return act } -func (act *action) waitUntilDependingAnalyzersWorked(stopChan chan struct{}) { +func (act *action) waitUntilDependingAnalyzersWorked(ctx context.Context, stopChan chan struct{}) { for _, dep := range act.Deps { if dep.Package == act.Package { select { case <-stopChan: return + case <-ctx.Done(): + return case <-dep.analysisDoneCh: } } diff --git a/pkg/goanalysis/runner_loadingpackage.go b/pkg/goanalysis/runner_loadingpackage.go index cb0dcd000516..001b80060b0b 100644 --- a/pkg/goanalysis/runner_loadingpackage.go +++ b/pkg/goanalysis/runner_loadingpackage.go @@ -1,6 +1,7 @@ package goanalysis import ( + "context" "errors" "fmt" "go/ast" @@ -14,6 +15,7 @@ import ( "sync" "sync/atomic" + "golang.org/x/sync/errgroup" "golang.org/x/tools/go/gcexportdata" "golang.org/x/tools/go/packages" @@ -83,36 +85,30 @@ func (lp *loadingPackage) analyze(stopChan chan struct{}, loadMode LoadMode, loa return } - var actsWg sync.WaitGroup - - actsWg.Add(len(lp.actions)) + actsWg, ctx := errgroup.WithContext(context.Background()) for _, act := range lp.actions { - go func(act *action) { - defer actsWg.Done() - - act.waitUntilDependingAnalyzersWorked(stopChan) + actsWg.Go(func() error { + act.waitUntilDependingAnalyzersWorked(ctx, stopChan) select { case <-stopChan: - return + return nil + case <-ctx.Done(): + return nil default: } act.analyzeSafe() - select { - case <-stopChan: - return - default: - if act.Err != nil { - close(stopChan) - } - } - }(act) + return act.Err + }) } - actsWg.Wait() + err := actsWg.Wait() + if err != nil { + close(stopChan) + } } func (lp *loadingPackage) loadFromSource(loadMode LoadMode) error { From e9d425110dcd46293652c5981b0a479d091d9f88 Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Fri, 11 Jul 2025 13:41:53 +0200 Subject: [PATCH 14/14] chore: prepare release --- CHANGELOG.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d977e44d961..fdd7588786e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,16 @@ If you value it, consider supporting us, we appreciate it! ❤️ [![Open Collective backers and sponsors](https://img.shields.io/badge/OpenCollective-Donate-blue?logo=opencollective&style=for-the-badge)](https://opencollective.com/golangci-lint) [![GitHub Sponsors](https://img.shields.io/badge/GitHub-Donate-blue?logo=github&style=for-the-badge)](https://github.com/sponsors/golangci) +### v2.2.2 + +1. Linters bug fixes + * `noinlineerr`: from 1.0.3 to 1.0.4 +2. Documentation + * Improve debug keys documentation +3. Misc. + * fix: panic close of closed channel + * godot: add noinline value into the JSONSchema + ### v2.2.1 1. Linters bug fixes