diff --git a/.github/workflows/build-go.yaml b/.github/workflows/build-go.yaml index 3c18cc0ed..7230a8691 100644 --- a/.github/workflows/build-go.yaml +++ b/.github/workflows/build-go.yaml @@ -27,7 +27,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v6 with: - go-version: '1.25' + go-version: '1.26' - name: Run 'make check' run: make check diff --git a/.github/workflows/build-on-hosted-runner.yaml b/.github/workflows/build-on-hosted-runner.yaml index 5032868cf..635487fc5 100644 --- a/.github/workflows/build-on-hosted-runner.yaml +++ b/.github/workflows/build-on-hosted-runner.yaml @@ -27,7 +27,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v6 with: - go-version: "1.25" + go-version: "1.26" - name: Test run: go test -v ./... diff --git a/Makefile b/Makefile index 3b6a9553f..3d6a481b9 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ TKN_IMG ?= quay.io/redhat-developer/mapt:v${VERSION}-tkn # Integrations # renovate: datasource=github-releases depName=cirruslabs/cirrus-cli -CIRRUS_CLI ?= v0.163.2 +CIRRUS_CLI ?= v0.164.1 # renovate: datasource=github-releases depName=actions/runner GITHUB_RUNNER ?= 2.331.0 # renovate: datasource=gitlab-releases depName=gitlab-org/gitlab-runner diff --git a/go.mod b/go.mod index 7fbf8b668..ff703593c 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/coocood/freecache v1.2.5 github.com/pulumi/pulumi-command/sdk v1.1.3 github.com/pulumi/pulumi-random/sdk/v4 v4.19.1 - github.com/pulumi/pulumi/sdk/v3 v3.219.0 + github.com/pulumi/pulumi/sdk/v3 v3.220.0 github.com/sirupsen/logrus v1.9.4 github.com/spf13/cobra v1.10.2 ) @@ -20,10 +20,10 @@ require ( github.com/aws/amazon-ec2-instance-selector/v3 v3.1.3 github.com/aws/aws-sdk-go-v2 v1.41.1 github.com/aws/aws-sdk-go-v2/config v1.32.7 - github.com/aws/aws-sdk-go-v2/service/ec2 v1.285.0 + github.com/aws/aws-sdk-go-v2/service/ec2 v1.289.0 github.com/aws/aws-sdk-go-v2/service/s3 v1.96.0 github.com/aws/aws-sdk-go-v2/service/sts v1.41.6 - github.com/pulumi/pulumi-aws-native/sdk v1.51.0 + github.com/pulumi/pulumi-aws-native/sdk v1.54.0 github.com/pulumi/pulumi-aws/sdk/v7 v7.19.0 github.com/pulumi/pulumi-awsx/sdk/v3 v3.1.0 github.com/pulumi/pulumi-azure-native-sdk/authorization/v3 v3.13.0 @@ -35,7 +35,7 @@ require ( github.com/pulumi/pulumi-azure-native-sdk/storage/v3 v3.13.0 github.com/pulumi/pulumi-gitlab/sdk/v8 v8.11.0 github.com/pulumi/pulumi-tls/sdk/v5 v5.3.0 - golang.org/x/exp v0.0.0-20260112195511-716be5621a96 + golang.org/x/exp v0.0.0-20260212183809-81e46e3db34a ) require ( @@ -62,8 +62,8 @@ require ( github.com/oliveagle/jsonpath v0.1.4 // indirect github.com/patrickmn/go-cache v2.1.0+incompatible // indirect github.com/sahilm/fuzzy v0.1.1 // indirect - golang.org/x/mod v0.32.0 // indirect - golang.org/x/tools v0.41.0 // indirect + golang.org/x/mod v0.33.0 // indirect + golang.org/x/tools v0.42.0 // indirect ) require ( @@ -121,7 +121,7 @@ require ( github.com/pjbgf/sha1cd v0.5.0 // indirect github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect github.com/pulumi/appdash v0.0.0-20231130102222-75f619a67231 // indirect - github.com/pulumi/esc v0.21.0 // indirect + github.com/pulumi/esc v0.22.0 // indirect github.com/pulumi/pulumi-docker-build/sdk/go/dockerbuild v0.0.15 // indirect github.com/sagikazarmark/locafero v0.12.0 // indirect github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 // indirect @@ -134,7 +134,7 @@ require ( go.uber.org/multierr v1.11.0 // indirect go.yaml.in/yaml/v3 v3.0.4 // indirect golang.org/x/sync v0.19.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20260203192932-546029d2fa20 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260209200024-4cfbd4190f57 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) @@ -159,7 +159,7 @@ require ( github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect - github.com/kevinburke/ssh_config v1.4.0 // indirect + github.com/kevinburke/ssh_config v1.5.0 // indirect github.com/mattn/go-runewidth v0.0.19 // indirect github.com/mitchellh/go-ps v1.0.0 // indirect github.com/nxadm/tail v1.4.11 // indirect @@ -178,12 +178,12 @@ require ( github.com/uber/jaeger-lib v2.4.1+incompatible // indirect github.com/xanzy/ssh-agent v0.3.3 // indirect go.uber.org/atomic v1.11.0 // indirect - golang.org/x/crypto v0.47.0 // indirect - golang.org/x/net v0.49.0 // indirect + golang.org/x/crypto v0.48.0 // indirect + golang.org/x/net v0.50.0 // indirect golang.org/x/sys v0.41.0 // indirect - golang.org/x/term v0.39.0 // indirect - golang.org/x/text v0.33.0 // indirect - google.golang.org/grpc v1.78.0 // indirect + golang.org/x/term v0.40.0 // indirect + golang.org/x/text v0.34.0 // indirect + google.golang.org/grpc v1.79.1 // indirect google.golang.org/protobuf v1.36.11 // indirect gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect diff --git a/go.sum b/go.sum index b2ec19ae0..c039d90b1 100644 --- a/go.sum +++ b/go.sum @@ -69,8 +69,8 @@ github.com/aws/aws-sdk-go-v2/internal/ini v1.8.4 h1:WKuaxf++XKWlHWu9ECbMlha8WOEG github.com/aws/aws-sdk-go-v2/internal/ini v1.8.4/go.mod h1:ZWy7j6v1vWGmPReu0iSGvRiise4YI5SkR3OHKTZ6Wuc= github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.17 h1:JqcdRG//czea7Ppjb+g/n4o8i/R50aTBHkA7vu0lK+k= github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.17/go.mod h1:CO+WeGmIdj/MlPel2KwID9Gt7CNq4M65HUfBW97liM0= -github.com/aws/aws-sdk-go-v2/service/ec2 v1.285.0 h1:cRZQsqCy59DSJmvmUYzi9K+dutysXzfx6F+fkcIHtOk= -github.com/aws/aws-sdk-go-v2/service/ec2 v1.285.0/go.mod h1:Uy+C+Sc58jozdoL1McQr8bDsEvNFx+/nBY+vpO1HVUY= +github.com/aws/aws-sdk-go-v2/service/ec2 v1.289.0 h1:Ftj1M28RtAjgHpycBeQaFhfGx+aQ/swYEz+tBtIh9nE= +github.com/aws/aws-sdk-go-v2/service/ec2 v1.289.0/go.mod h1:Uy+C+Sc58jozdoL1McQr8bDsEvNFx+/nBY+vpO1HVUY= github.com/aws/aws-sdk-go-v2/service/ecs v1.71.0 h1:MzP/ElwTpINq+hS80ZQz4epKVnUTlz8Sz+P/AFORCKM= github.com/aws/aws-sdk-go-v2/service/ecs v1.71.0/go.mod h1:pMlGFDpHoLTJOIZHGdJOAWmi+xeIlQXuFTuQxs1epYE= github.com/aws/aws-sdk-go-v2/service/iam v1.53.2 h1:62G6btFUwAa5uR5iPlnlNVAM0zJSLbWgDfKOfUC7oW4= @@ -215,8 +215,8 @@ github.com/iwdgo/sigintwindows v0.2.2 h1:P6oWzpvV7MrEAmhUgs+zmarrWkyL77ycZz4v7+1 github.com/iwdgo/sigintwindows v0.2.2/go.mod h1:70wPb8oz8OnxPvsj2QMUjgIVhb8hMu5TUgX8KfFl7QY= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= -github.com/kevinburke/ssh_config v1.4.0 h1:6xxtP5bZ2E4NF5tuQulISpTO2z8XbtH8cg1PWkxoFkQ= -github.com/kevinburke/ssh_config v1.4.0/go.mod h1:q2RIzfka+BXARoNexmF9gkxEX7DmvbW9P4hIVx2Kg4M= +github.com/kevinburke/ssh_config v1.5.0 h1:3cPZmE54xb5j3G5xQCjSvokqNwU2uW+3ry1+PRLSPpA= +github.com/kevinburke/ssh_config v1.5.0/go.mod h1:q2RIzfka+BXARoNexmF9gkxEX7DmvbW9P4hIVx2Kg4M= github.com/keybase/go-keychain v0.0.1 h1:way+bWYa6lDppZoZcgMbYsvC7GxljxrskdNInRtuthU= github.com/keybase/go-keychain v0.0.1/go.mod h1:PdEILRW3i9D8JcdM+FmY6RwkHGnhHxXwkPPMeUgOK1k= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= @@ -296,10 +296,10 @@ github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRI github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pulumi/appdash v0.0.0-20231130102222-75f619a67231 h1:vkHw5I/plNdTr435cARxCW6q9gc0S/Yxz7Mkd38pOb0= github.com/pulumi/appdash v0.0.0-20231130102222-75f619a67231/go.mod h1:murToZ2N9hNJzewjHBgfFdXhZKjY3z5cYC1VXk+lbFE= -github.com/pulumi/esc v0.21.0 h1:TR8Ff22SU+z8cooTmUKkmk2FltXW/wDPrIwI9BP88Vk= -github.com/pulumi/esc v0.21.0/go.mod h1:mkghIFn/TvN3XnP4jmCB4U5BG1I4UjGluARi39ckrCE= -github.com/pulumi/pulumi-aws-native/sdk v1.51.0 h1:OZWPavbtb+7DqrL4w165gT4TFpCkvRf98CEk/ClNDpk= -github.com/pulumi/pulumi-aws-native/sdk v1.51.0/go.mod h1:gmgSOTrjC7wArS3etY/n8vcEvDF56AQenP8YSH9tlII= +github.com/pulumi/esc v0.22.0 h1:Kbk0kIPsoIu6vnLgKtiE8AKRfl8B8bg6adiQuwJiBjA= +github.com/pulumi/esc v0.22.0/go.mod h1:mkghIFn/TvN3XnP4jmCB4U5BG1I4UjGluARi39ckrCE= +github.com/pulumi/pulumi-aws-native/sdk v1.54.0 h1:ODFXB/QP5gkC3HPpxgS2mb6DgHIkWki13W9gBSTP+pA= +github.com/pulumi/pulumi-aws-native/sdk v1.54.0/go.mod h1:UkhMdEA8ukabGNkdw0nW3gF3lvCA35iU42XjCQN4pNM= github.com/pulumi/pulumi-aws/sdk/v7 v7.19.0 h1:/yYuicdSgI3zFqWJSQcinmcZOKk3XPxAYvy9kC5VUe8= github.com/pulumi/pulumi-aws/sdk/v7 v7.19.0/go.mod h1:/vArxgDnsrHs4ZujZvfaZ9OYFgtRh516NpnKwZYwIcU= github.com/pulumi/pulumi-awsx/sdk/v3 v3.1.0 h1:jphjwZoSnNyW4d3dpS++T+TlZFTy6vb9gJt33u6xf14= @@ -334,8 +334,8 @@ github.com/pulumi/pulumi-random/sdk/v4 v4.19.1 h1:MUr4+gUQy+wqhoHsuhXO6ypT40KhU9 github.com/pulumi/pulumi-random/sdk/v4 v4.19.1/go.mod h1:AJpJvPU3qJaq02VUui3rMZHchvVpTvVuVp0lbCeEE50= github.com/pulumi/pulumi-tls/sdk/v5 v5.3.0 h1:T5flLAVyTUbnNRbKMpwMpHoNiquxRlGzpevYkan5ZkM= github.com/pulumi/pulumi-tls/sdk/v5 v5.3.0/go.mod h1:dGWmFbFPclMTOrhpYtXN6trciFHZR08p31S6TqRrLzo= -github.com/pulumi/pulumi/sdk/v3 v3.219.0 h1:OwTSwk1ZuOI4hQUdSccWuIAuqs4fL/FcppesPOAKHQ8= -github.com/pulumi/pulumi/sdk/v3 v3.219.0/go.mod h1:ZOBPPC2NZOZf729AdCX+CctfNc5SN6aJh0bdqNdzQC4= +github.com/pulumi/pulumi/sdk/v3 v3.220.0 h1:TtdlW2VfvBWhFZSvaDN9lSUlSS4gGSdNWdca3RGPsBQ= +github.com/pulumi/pulumi/sdk/v3 v3.220.0/go.mod h1:UGWJOz25OiFIN0QH79UFij8mffH94TYebKUgy9Wvug0= github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= @@ -396,16 +396,16 @@ github.com/zclconf/go-cty v1.17.0 h1:seZvECve6XX4tmnvRzWtJNHdscMtYEx5R7bnnVyd/d0 github.com/zclconf/go-cty v1.17.0/go.mod h1:wqFzcImaLTI6A5HfsRwB0nj5n0MRZFwmey8YoFPPs3U= go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64= go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y= -go.opentelemetry.io/otel v1.38.0 h1:RkfdswUDRimDg0m2Az18RKOsnI8UDzppJAtj01/Ymk8= -go.opentelemetry.io/otel v1.38.0/go.mod h1:zcmtmQ1+YmQM9wrNsTGV/q/uyusom3P8RxwExxkZhjM= -go.opentelemetry.io/otel/metric v1.38.0 h1:Kl6lzIYGAh5M159u9NgiRkmoMKjvbsKtYRwgfrA6WpA= -go.opentelemetry.io/otel/metric v1.38.0/go.mod h1:kB5n/QoRM8YwmUahxvI3bO34eVtQf2i4utNVLr9gEmI= -go.opentelemetry.io/otel/sdk v1.38.0 h1:l48sr5YbNf2hpCUj/FoGhW9yDkl+Ma+LrVl8qaM5b+E= -go.opentelemetry.io/otel/sdk v1.38.0/go.mod h1:ghmNdGlVemJI3+ZB5iDEuk4bWA3GkTpW+DOoZMYBVVg= -go.opentelemetry.io/otel/sdk/metric v1.38.0 h1:aSH66iL0aZqo//xXzQLYozmWrXxyFkBJ6qT5wthqPoM= -go.opentelemetry.io/otel/sdk/metric v1.38.0/go.mod h1:dg9PBnW9XdQ1Hd6ZnRz689CbtrUp0wMMs9iPcgT9EZA= -go.opentelemetry.io/otel/trace v1.38.0 h1:Fxk5bKrDZJUH+AMyyIXGcFAPah0oRcT+LuNtJrmcNLE= -go.opentelemetry.io/otel/trace v1.38.0/go.mod h1:j1P9ivuFsTceSWe1oY+EeW3sc+Pp42sO++GHkg4wwhs= +go.opentelemetry.io/otel v1.39.0 h1:8yPrr/S0ND9QEfTfdP9V+SiwT4E0G7Y5MO7p85nis48= +go.opentelemetry.io/otel v1.39.0/go.mod h1:kLlFTywNWrFyEdH0oj2xK0bFYZtHRYUdv1NklR/tgc8= +go.opentelemetry.io/otel/metric v1.39.0 h1:d1UzonvEZriVfpNKEVmHXbdf909uGTOQjA0HF0Ls5Q0= +go.opentelemetry.io/otel/metric v1.39.0/go.mod h1:jrZSWL33sD7bBxg1xjrqyDjnuzTUB0x1nBERXd7Ftcs= +go.opentelemetry.io/otel/sdk v1.39.0 h1:nMLYcjVsvdui1B/4FRkwjzoRVsMK8uL/cj0OyhKzt18= +go.opentelemetry.io/otel/sdk v1.39.0/go.mod h1:vDojkC4/jsTJsE+kh+LXYQlbL8CgrEcwmt1ENZszdJE= +go.opentelemetry.io/otel/sdk/metric v1.39.0 h1:cXMVVFVgsIf2YL6QkRF4Urbr/aMInf+2WKg+sEJTtB8= +go.opentelemetry.io/otel/sdk/metric v1.39.0/go.mod h1:xq9HEVH7qeX69/JnwEfp6fVq5wosJsY1mt4lLfYdVew= +go.opentelemetry.io/otel/trace v1.39.0 h1:2d2vfpEDmCJ5zVYz7ijaJdOF59xLomrvj7bjt6/qCJI= +go.opentelemetry.io/otel/trace v1.39.0/go.mod h1:88w4/PnZSazkGzz/w84VHpQafiU4EtqqlVdxWy+rNOA= go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= @@ -416,24 +416,24 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.47.0 h1:V6e3FRj+n4dbpw86FJ8Fv7XVOql7TEwpHapKoMJ/GO8= -golang.org/x/crypto v0.47.0/go.mod h1:ff3Y9VzzKbwSSEzWqJsJVBnWmRwRSHt/6Op5n9bQc4A= -golang.org/x/exp v0.0.0-20260112195511-716be5621a96 h1:Z/6YuSHTLOHfNFdb8zVZomZr7cqNgTJvA8+Qz75D8gU= -golang.org/x/exp v0.0.0-20260112195511-716be5621a96/go.mod h1:nzimsREAkjBCIEFtHiYkrJyT+2uy9YZJB7H1k68CXZU= +golang.org/x/crypto v0.48.0 h1:/VRzVqiRSggnhY7gNRxPauEQ5Drw9haKdM0jqfcCFts= +golang.org/x/crypto v0.48.0/go.mod h1:r0kV5h3qnFPlQnBSrULhlsRfryS2pmewsg+XfMgkVos= +golang.org/x/exp v0.0.0-20260212183809-81e46e3db34a h1:ovFr6Z0MNmU7nH8VaX5xqw+05ST2uO1exVfZPVqRC5o= +golang.org/x/exp v0.0.0-20260212183809-81e46e3db34a/go.mod h1:K79w1Vqn7PoiZn+TkNpx3BUWUQksGO3JcVX6qIjytmA= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.32.0 h1:9F4d3PHLljb6x//jOyokMv3eX+YDeepZSEo3mFJy93c= -golang.org/x/mod v0.32.0/go.mod h1:SgipZ/3h2Ci89DlEtEXWUk/HteuRin+HHhN+WbNhguU= +golang.org/x/mod v0.33.0 h1:tHFzIWbBifEmbwtGz65eaWyGiGZatSrT9prnU8DbVL8= +golang.org/x/mod v0.33.0/go.mod h1:swjeQEj+6r7fODbD2cqrnje9PnziFuw4bmLbBZFrQ5w= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200421231249-e086a090c8fd/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.49.0 h1:eeHFmOGUTtaaPSGNmjBKpbng9MulQsJURQUAfUwY++o= -golang.org/x/net v0.49.0/go.mod h1:/ysNB2EvaqvesRkuLAyjI1ycPZlQHM3q01F02UY/MV8= +golang.org/x/net v0.50.0 h1:ucWh9eiCGyDR3vtzso0WMQinm2Dnt8cFMuQa9K33J60= +golang.org/x/net v0.50.0/go.mod h1:UgoSli3F/pBgdJBHCTc+tp3gmrU4XswgGRgtnwWTfyM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -459,31 +459,31 @@ golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.41.0 h1:Ivj+2Cp/ylzLiEU89QhWblYnOE9zerudt9Ftecq2C6k= golang.org/x/sys v0.41.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.39.0 h1:RclSuaJf32jOqZz74CkPA9qFuVTX7vhLlpfj/IGWlqY= -golang.org/x/term v0.39.0/go.mod h1:yxzUCTP/U+FzoxfdKmLaA0RV1WgE0VY7hXBwKtY/4ww= +golang.org/x/term v0.40.0 h1:36e4zGLqU4yhjlmxEaagx2KuYbJq3EwY8K943ZsHcvg= +golang.org/x/term v0.40.0/go.mod h1:w2P8uVp06p2iyKKuvXIm7N/y0UCRt3UfJTfZ7oOpglM= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.33.0 h1:B3njUFyqtHDUI5jMn1YIr5B0IE2U0qck04r6d4KPAxE= -golang.org/x/text v0.33.0/go.mod h1:LuMebE6+rBincTi9+xWTY8TztLzKHc/9C1uBCG27+q8= +golang.org/x/text v0.34.0 h1:oL/Qq0Kdaqxa1KbNeMKwQq0reLCCaFtqu2eNuSeNHbk= +golang.org/x/text v0.34.0/go.mod h1:homfLqTYRFyVYemLBFl5GgL/DWEiH5wcsQ5gSh1yziA= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.41.0 h1:a9b8iMweWG+S0OBnlU36rzLp20z1Rp10w+IY2czHTQc= -golang.org/x/tools v0.41.0/go.mod h1:XSY6eDqxVNiYgezAVqqCeihT4j1U2CCsqvH3WhQpnlg= +golang.org/x/tools v0.42.0 h1:uNgphsn75Tdz5Ji2q36v/nsFSfR/9BRFvqhGBaJGd5k= +golang.org/x/tools v0.42.0/go.mod h1:Ma6lCIwGZvHK6XtgbswSoWroEkhugApmsXyrUmBhfr0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk= gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E= -google.golang.org/genproto/googleapis/rpc v0.0.0-20260203192932-546029d2fa20 h1:Jr5R2J6F6qWyzINc+4AM8t5pfUz6beZpHp678GNrMbE= -google.golang.org/genproto/googleapis/rpc v0.0.0-20260203192932-546029d2fa20/go.mod h1:j9x/tPzZkyxcgEFkiKEEGxfvyumM01BEtsW8xzOahRQ= -google.golang.org/grpc v1.78.0 h1:K1XZG/yGDJnzMdd/uZHAkVqJE+xIDOcmdSFZkBUicNc= -google.golang.org/grpc v1.78.0/go.mod h1:I47qjTo4OKbMkjA/aOOwxDIiPSBofUtQUI5EfpWvW7U= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260209200024-4cfbd4190f57 h1:mWPCjDEyshlQYzBpMNHaEof6UX1PmHcaUODUywQ0uac= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260209200024-4cfbd4190f57/go.mod h1:j9x/tPzZkyxcgEFkiKEEGxfvyumM01BEtsW8xzOahRQ= +google.golang.org/grpc v1.79.1 h1:zGhSi45ODB9/p3VAawt9a+O/MULLl9dpizzNNpq7flY= +google.golang.org/grpc v1.79.1/go.mod h1:KmT0Kjez+0dde/v2j9vzwoAScgEPx/Bw1CYChhHLrHQ= google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE= google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/oci/Containerfile b/oci/Containerfile index 3063da6d5..95080f1e2 100644 --- a/oci/Containerfile +++ b/oci/Containerfile @@ -1,12 +1,12 @@ -FROM registry.access.redhat.com/ubi9/go-toolset@sha256:6983c6e7023236d1b5093c75c94402c7bdfd43c36ed9c34f2feda72a0ea7c8b1 as builder +FROM registry.access.redhat.com/ubi9/go-toolset@sha256:82b82ecf4aedf67c4369849047c2680dba755fe57547bbb05eca211b22038e29 as builder ARG TARGETARCH USER root WORKDIR /workspace COPY . . # renovate: datasource=github-releases depName=pulumi/pulumi -ENV PULUMI_VERSION 3.219.0 +ENV PULUMI_VERSION 3.220.0 ENV PULUMI_BASE_URL="https://github.com/pulumi/pulumi/releases/download/v${PULUMI_VERSION}/pulumi-v${PULUMI_VERSION}" ENV PULUMI_URL="${PULUMI_BASE_URL}-linux-x64.tar.gz" @@ -44,7 +44,7 @@ ARG PULUMI_TLS_VERSION=v5.3.0 # renovate: datasource=github-releases depName=pulumi/pulumi-random ARG PULUMI_RANDOM_VERSION=v4.19.1 # renovate: datasource=github-releases depName=pulumi/pulumi-aws-native -ARG PULUMI_AWS_NATIVE_VERSION=v1.51.0 +ARG PULUMI_AWS_NATIVE_VERSION=v1.54.0 # renovate: datasource=github-releases depName=pulumi/pulumi-gitlab ARG PULUMI_GITLAB_VERSION=v9.8.2 diff --git a/tools/go.mod b/tools/go.mod index a30be5dc5..e58aac788 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -1,15 +1,15 @@ module github.com/redhat-developer/mapt/tools -go 1.24.6 +go 1.25.0 -require github.com/golangci/golangci-lint/v2 v2.8.0 +require github.com/golangci/golangci-lint/v2 v2.9.0 require github.com/golangci/gofmt v0.0.0-20250106114630-d62b90e6713d // indirect require ( github.com/charmbracelet/x/cellbuf v0.0.15 // indirect // github.com/golangci/gofmt e7be49a5ab4d // indirect - github.com/golangci/golines v0.14.0 // indirect + github.com/golangci/golines v0.15.0 // indirect ) require ( @@ -31,7 +31,7 @@ require ( github.com/golangci/asciicheck v0.5.0 // indirect // github.com/golangci/gofmt e7be49a5ab4d // indirect github.com/gostaticanalysis/nilerr v0.1.2 // indirect - github.com/nunnatsa/ginkgolinter v0.22.0 // indirect + github.com/nunnatsa/ginkgolinter v0.23.0 // indirect ) require ( @@ -103,7 +103,7 @@ require ( github.com/golangci/dupl v0.0.0-20250308024227-f665c8d69b32 // indirect github.com/golangci/go-printf-func-name v0.1.1 // indirect // github.com/golangci/gofmt e7be49a5ab4d // indirect - github.com/golangci/misspell v0.7.0 // indirect + github.com/golangci/misspell v0.8.0 // indirect github.com/golangci/plugin-module-register v0.1.2 // indirect github.com/golangci/revgrep v0.8.0 // indirect github.com/golangci/swaggoswag v0.0.0-20250504205917-77f2aca3143e // indirect @@ -145,7 +145,7 @@ require ( github.com/mattn/go-colorable v0.1.14 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-runewidth v0.0.19 // indirect - github.com/mgechev/revive v1.13.0 // indirect + github.com/mgechev/revive v1.14.0 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/moricho/tparallel v0.3.2 // indirect github.com/muesli/termenv v0.16.0 // indirect @@ -174,7 +174,7 @@ require ( github.com/santhosh-tekuri/jsonschema/v6 v6.0.2 // indirect github.com/sashamelentyev/interfacebloat v1.1.0 // indirect github.com/sashamelentyev/usestdlibvars v1.29.0 // indirect - github.com/securego/gosec/v2 v2.22.11 // indirect + github.com/securego/gosec/v2 v2.23.0 // indirect github.com/sirupsen/logrus v1.9.4 // indirect github.com/sivchari/containedctx v1.0.3 // indirect github.com/sonatard/noctx v0.4.0 // indirect @@ -208,19 +208,18 @@ require ( go-simpler.org/sloglint v0.11.1 // indirect go.augendre.info/arangolint v0.4.0 // indirect go.augendre.info/fatcontext v0.9.0 // indirect - go.uber.org/automaxprocs v1.6.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.1 // indirect go.yaml.in/yaml/v2 v2.4.3 // indirect - golang.org/x/exp/typeparams v0.0.0-20260112195511-716be5621a96 // indirect - golang.org/x/mod v0.32.0 // indirect + golang.org/x/exp/typeparams v0.0.0-20260212183809-81e46e3db34a // indirect + golang.org/x/mod v0.33.0 // indirect golang.org/x/sync v0.19.0 // indirect golang.org/x/sys v0.41.0 // indirect - golang.org/x/text v0.33.0 // indirect - golang.org/x/tools v0.41.0 // indirect + golang.org/x/text v0.34.0 // indirect + golang.org/x/tools v0.42.0 // indirect google.golang.org/protobuf v1.36.11 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - honnef.co/go/tools v0.6.1 // indirect + honnef.co/go/tools v0.7.0 // indirect mvdan.cc/gofumpt v0.9.2 // indirect mvdan.cc/unparam v0.0.0-20251027182757-5beb8c8f8f15 // indirect ) diff --git a/tools/go.sum b/tools/go.sum index 72fa4e514..64d49d06e 100644 --- a/tools/go.sum +++ b/tools/go.sum @@ -177,12 +177,12 @@ github.com/golangci/go-printf-func-name v0.1.1 h1:hIYTFJqAGp1iwoIfsNTpoq1xZAarog github.com/golangci/go-printf-func-name v0.1.1/go.mod h1:Es64MpWEZbh0UBtTAICOZiB+miW53w/K9Or/4QogJss= github.com/golangci/gofmt v0.0.0-20250106114630-d62b90e6713d h1:viFft9sS/dxoYY0aiOTsLKO2aZQAPT4nlQCsimGcSGE= github.com/golangci/gofmt v0.0.0-20250106114630-d62b90e6713d/go.mod h1:ivJ9QDg0XucIkmwhzCDsqcnxxlDStoTl89jDMIoNxKY= -github.com/golangci/golangci-lint/v2 v2.8.0 h1:wJnr3hJWY3eVzOUcfwbDc2qbi2RDEpvLmQeNFaPSNYA= -github.com/golangci/golangci-lint/v2 v2.8.0/go.mod h1:xl+HafQ9xoP8rzw0z5AwnO5kynxtb80e8u02Ej/47RI= -github.com/golangci/golines v0.14.0 h1:xt9d3RKBjhasA3qpoXs99J2xN2t6eBlpLHt0TrgyyXc= -github.com/golangci/golines v0.14.0/go.mod h1:gf555vPG2Ia7mmy2mzmhVQbVjuK8Orw0maR1G4vVAAQ= -github.com/golangci/misspell v0.7.0 h1:4GOHr/T1lTW0hhR4tgaaV1WS/lJ+ncvYCoFKmqJsj0c= -github.com/golangci/misspell v0.7.0/go.mod h1:WZyyI2P3hxPY2UVHs3cS8YcllAeyfquQcKfdeE9AFVg= +github.com/golangci/golangci-lint/v2 v2.9.0 h1:x5RRwa/jpNEjOnbSQSTam47QBsB50NMzCCUKe4GY/0U= +github.com/golangci/golangci-lint/v2 v2.9.0/go.mod h1:gAPaJitu6HsyiuwJYO+WtKT9WmCpQZHR+gkXlCw1bRY= +github.com/golangci/golines v0.15.0 h1:Qnph25g8Y1c5fdo1X7GaRDGgnMHgnxh4Gk4VfPTtRx0= +github.com/golangci/golines v0.15.0/go.mod h1:AZjXd23tbHMpowhtnGlj9KCNsysj72aeZVVHnVcZx10= +github.com/golangci/misspell v0.8.0 h1:qvxQhiE2/5z+BVRo1kwYA8yGz+lOlu5Jfvtx2b04Jbg= +github.com/golangci/misspell v0.8.0/go.mod h1:WZyyI2P3hxPY2UVHs3cS8YcllAeyfquQcKfdeE9AFVg= github.com/golangci/plugin-module-register v0.1.2 h1:e5WM6PO6NIAEcij3B053CohVp3HIYbzSuP53UAYgOpg= github.com/golangci/plugin-module-register v0.1.2/go.mod h1:1+QGTsKBvAIvPvoY/os+G5eoqxWn70HYDm2uvUyGuVw= github.com/golangci/revgrep v0.8.0 h1:EZBctwbVd0aMeRnNUsFogoyayvKHyxlV3CdUA46FX2s= @@ -196,8 +196,8 @@ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.8/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/pprof v0.0.0-20250820193118-f64d9cf942d6 h1:EEHtgt9IwisQ2AZ4pIsMjahcegHh6rmhqxzIRQIyepY= -github.com/google/pprof v0.0.0-20250820193118-f64d9cf942d6/go.mod h1:I6V7YzU0XDpsHqbsyrghnFZLO1gwK6NPTNvmetQIk9U= +github.com/google/pprof v0.0.0-20260115054156-294ebfa9ad83 h1:z2ogiKUYzX5Is6zr/vP9vJGqPwcdqsWjOt+V8J7+bTc= +github.com/google/pprof v0.0.0-20260115054156-294ebfa9ad83/go.mod h1:MxpfABSjhmINe3F1It9d+8exIHFvUqtLIRCdOGNXqiI= github.com/gordonklaus/ineffassign v0.2.0 h1:Uths4KnmwxNJNzq87fwQQDDnbNb7De00VOk9Nu0TySs= github.com/gordonklaus/ineffassign v0.2.0/go.mod h1:TIpymnagPSexySzs7F9FnO1XFTy8IT3a59vmZp5Y9Lw= github.com/gostaticanalysis/analysisutil v0.7.1 h1:ZMCjoue3DtDWQ5WyU16YbjbQEQ3VuzwxALrpYd+HeKk= @@ -285,8 +285,8 @@ github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWE github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.19 h1:v++JhqYnZuu5jSKrk9RbgF5v4CGUjqRfBm05byFGLdw= github.com/mattn/go-runewidth v0.0.19/go.mod h1:XBkDxAl56ILZc9knddidhrOlY5R/pDhgLpndooCuJAs= -github.com/mgechev/revive v1.13.0 h1:yFbEVliCVKRXY8UgwEO7EOYNopvjb1BFbmYqm9hZjBM= -github.com/mgechev/revive v1.13.0/go.mod h1:efJfeBVCX2JUumNQ7dtOLDja+QKj9mYGgEZA7rt5u+0= +github.com/mgechev/revive v1.14.0 h1:CC2Ulb3kV7JFYt+izwORoS3VT/+Plb8BvslI/l1yZsc= +github.com/mgechev/revive v1.14.0/go.mod h1:MvnujelCZBZCaoDv5B3foPo6WWgULSSFxvfxp7GsPfo= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/moricho/tparallel v0.3.2 h1:odr8aZVFA3NZrNybggMkYO3rgPRcqjeQUlBBFVxKHTI= @@ -301,12 +301,12 @@ github.com/nishanths/exhaustive v0.12.0 h1:vIY9sALmw6T/yxiASewa4TQcFsVYZQQRUQJhK github.com/nishanths/exhaustive v0.12.0/go.mod h1:mEZ95wPIZW+x8kC4TgC+9YCUgiST7ecevsVDTgc2obs= github.com/nishanths/predeclared v0.2.2 h1:V2EPdZPliZymNAn79T8RkNApBjMmVKh5XRpLm/w98Vk= github.com/nishanths/predeclared v0.2.2/go.mod h1:RROzoN6TnGQupbC+lqggsOlcgysk3LMK/HI84Mp280c= -github.com/nunnatsa/ginkgolinter v0.22.0 h1:o9g7JN6efdBxAHhejvPkodEjWsOBze9zDnPePsvC/Qg= -github.com/nunnatsa/ginkgolinter v0.22.0/go.mod h1:zIFAk36fhcHQIiYOGXLbrGTXz7cvpufhRYem6ToCVnY= -github.com/onsi/ginkgo/v2 v2.27.2 h1:LzwLj0b89qtIy6SSASkzlNvX6WktqurSHwkk2ipF/Ns= -github.com/onsi/ginkgo/v2 v2.27.2/go.mod h1:ArE1D/XhNXBXCBkKOLkbsb2c81dQHCRcF5zwn/ykDRo= -github.com/onsi/gomega v1.38.2 h1:eZCjf2xjZAqe+LeWvKb5weQ+NcPwX84kqJ0cZNxok2A= -github.com/onsi/gomega v1.38.2/go.mod h1:W2MJcYxRGV63b418Ai34Ud0hEdTVXq9NW9+Sx6uXf3k= +github.com/nunnatsa/ginkgolinter v0.23.0 h1:x3o4DGYOWbBMP/VdNQKgSj+25aJKx2Pe6lHr8gBcgf8= +github.com/nunnatsa/ginkgolinter v0.23.0/go.mod h1:9qN1+0akwXEccwV1CAcCDfcoBlWXHB+ML9884pL4SZ4= +github.com/onsi/ginkgo/v2 v2.28.1 h1:S4hj+HbZp40fNKuLUQOYLDgZLwNUVn19N3Atb98NCyI= +github.com/onsi/ginkgo/v2 v2.28.1/go.mod h1:CLtbVInNckU3/+gC8LzkGUb9oF+e8W8TdUsxPwvdOgE= +github.com/onsi/gomega v1.39.1 h1:1IJLAad4zjPn2PsnhH70V4DKRFlrCzGBNrNaru+Vf28= +github.com/onsi/gomega v1.39.1/go.mod h1:hL6yVALoTOxeWudERyfppUcZXjMwIMLnuSfruD2lcfg= github.com/otiai10/copy v1.2.0/go.mod h1:rrF5dJ5F0t/EWSYODDu4j9/vEeYHMkc8jt0zJChqQWw= github.com/otiai10/copy v1.14.0 h1:dCI/t1iTdYGtkvCuBG2BgR6KZa83PTclw4U5n2wAllU= github.com/otiai10/copy v1.14.0/go.mod h1:ECfuL02W+/FkTWZWgQqXPWZgW9oeKCSQ5qVfSc4qc4w= @@ -318,8 +318,6 @@ github.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0 github.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g= -github.com/prashantv/gostub v1.1.0/go.mod h1:A5zLQHz7ieHGG7is6LLXLz7I8+3LZzsrV0P1IAHhP5U= github.com/prometheus/client_golang v1.23.2 h1:Je96obch5RDVy3FDMndoUsjAhG5Edi49h0RJWRi/o0o= github.com/prometheus/client_golang v1.23.2/go.mod h1:Tb1a6LWHB3/SPIzCoaDXI4I8UHKeFTEQ1YCr+0Gyqmg= github.com/prometheus/client_model v0.6.2 h1:oBsgwpGs7iVziMvrGhE53c/GrLUsZdHnqNwqPLxwZyk= @@ -359,8 +357,8 @@ github.com/sashamelentyev/interfacebloat v1.1.0 h1:xdRdJp0irL086OyW1H/RTZTr1h/tM github.com/sashamelentyev/interfacebloat v1.1.0/go.mod h1:+Y9yU5YdTkrNvoX0xHc84dxiN1iBi9+G8zZIhPVoNjQ= github.com/sashamelentyev/usestdlibvars v1.29.0 h1:8J0MoRrw4/NAXtjQqTHrbW9NN+3iMf7Knkq057v4XOQ= github.com/sashamelentyev/usestdlibvars v1.29.0/go.mod h1:8PpnjHMk5VdeWlVb4wCdrB8PNbLqZ3wBZTZWkrpZZL8= -github.com/securego/gosec/v2 v2.22.11 h1:tW+weM/hCM/GX3iaCV91d5I6hqaRT2TPsFM1+USPXwg= -github.com/securego/gosec/v2 v2.22.11/go.mod h1:KE4MW/eH0GLWztkbt4/7XpyH0zJBBnu7sYB4l6Wn7Mw= +github.com/securego/gosec/v2 v2.23.0 h1:h4TtF64qFzvnkqvsHC/knT7YC5fqyOCItlVR8+ptEBo= +github.com/securego/gosec/v2 v2.23.0/go.mod h1:qRHEgXLFuYUDkI2T7W7NJAmOkxVhkR0x9xyHOIcMNZ0= 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/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk= @@ -448,8 +446,6 @@ go.augendre.info/arangolint v0.4.0 h1:xSCZjRoS93nXazBSg5d0OGCi9APPLNMmmLrC995tR5 go.augendre.info/arangolint v0.4.0/go.mod h1:l+f/b4plABuFISuKnTGD4RioXiCCgghv2xqst/xOvAA= go.augendre.info/fatcontext v0.9.0 h1:Gt5jGD4Zcj8CDMVzjOJITlSb9cEch54hjRRlN3qDojE= go.augendre.info/fatcontext v0.9.0/go.mod h1:L94brOAT1OOUNue6ph/2HnwxoNlds9aXDF2FcUntbNw= -go.uber.org/automaxprocs v1.6.0 h1:O3y2/QNTOdbF+e/dpXNNW7Rx2hZ4sTIPyybbxyNqTUs= -go.uber.org/automaxprocs v1.6.0/go.mod h1:ifeIMSnPZuznNm6jmdzmU3/bfk01Fe2fotchwEFJ8r8= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= @@ -468,8 +464,8 @@ golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b h1:M2rDM6z3Fhozi9O7NWsxAkg/y golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b/go.mod h1:3//PLf8L/X+8b4vuAfHzxeRUl04Adcb341+IGKfnqS8= golang.org/x/exp/typeparams v0.0.0-20220428152302-39d4317da171/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= golang.org/x/exp/typeparams v0.0.0-20230203172020-98cc5a0785f9/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= -golang.org/x/exp/typeparams v0.0.0-20260112195511-716be5621a96 h1:RMc8anw0hCPcg5CZYN2PEQ8nMwosk461R6vFwPrCFVg= -golang.org/x/exp/typeparams v0.0.0-20260112195511-716be5621a96/go.mod h1:4Mzdyp/6jzw9auFDJ3OMF5qksa7UvPnzKqTVGcb04ms= +golang.org/x/exp/typeparams v0.0.0-20260212183809-81e46e3db34a h1:n3SZDk8iNpMasCwQD7/0dIaCVf3gJiGZ9Rqa094jUN0= +golang.org/x/exp/typeparams v0.0.0-20260212183809-81e46e3db34a/go.mod h1:PqrXSW65cXDZH0k4IeUbhmg/bcAZDbzNz3byBpKCsXo= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= @@ -477,8 +473,8 @@ golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.32.0 h1:9F4d3PHLljb6x//jOyokMv3eX+YDeepZSEo3mFJy93c= -golang.org/x/mod v0.32.0/go.mod h1:SgipZ/3h2Ci89DlEtEXWUk/HteuRin+HHhN+WbNhguU= +golang.org/x/mod v0.33.0 h1:tHFzIWbBifEmbwtGz65eaWyGiGZatSrT9prnU8DbVL8= +golang.org/x/mod v0.33.0/go.mod h1:swjeQEj+6r7fODbD2cqrnje9PnziFuw4bmLbBZFrQ5w= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -489,8 +485,8 @@ golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96b golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.49.0 h1:eeHFmOGUTtaaPSGNmjBKpbng9MulQsJURQUAfUwY++o= -golang.org/x/net v0.49.0/go.mod h1:/ysNB2EvaqvesRkuLAyjI1ycPZlQHM3q01F02UY/MV8= +golang.org/x/net v0.50.0 h1:ucWh9eiCGyDR3vtzso0WMQinm2Dnt8cFMuQa9K33J60= +golang.org/x/net v0.50.0/go.mod h1:UgoSli3F/pBgdJBHCTc+tp3gmrU4XswgGRgtnwWTfyM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -527,8 +523,8 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.33.0 h1:B3njUFyqtHDUI5jMn1YIr5B0IE2U0qck04r6d4KPAxE= -golang.org/x/text v0.33.0/go.mod h1:LuMebE6+rBincTi9+xWTY8TztLzKHc/9C1uBCG27+q8= +golang.org/x/text v0.34.0 h1:oL/Qq0Kdaqxa1KbNeMKwQq0reLCCaFtqu2eNuSeNHbk= +golang.org/x/text v0.34.0/go.mod h1:homfLqTYRFyVYemLBFl5GgL/DWEiH5wcsQ5gSh1yziA= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200329025819-fd4102a86c65/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= @@ -539,8 +535,8 @@ golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.41.0 h1:a9b8iMweWG+S0OBnlU36rzLp20z1Rp10w+IY2czHTQc= -golang.org/x/tools v0.41.0/go.mod h1:XSY6eDqxVNiYgezAVqqCeihT4j1U2CCsqvH3WhQpnlg= +golang.org/x/tools v0.42.0 h1:uNgphsn75Tdz5Ji2q36v/nsFSfR/9BRFvqhGBaJGd5k= +golang.org/x/tools v0.42.0/go.mod h1:Ma6lCIwGZvHK6XtgbswSoWroEkhugApmsXyrUmBhfr0= golang.org/x/tools/go/expect v0.1.1-deprecated h1:jpBZDwmgPhXsKZC6WhL20P4b/wmnpsEAGHaNy0n/rJM= golang.org/x/tools/go/expect v0.1.1-deprecated/go.mod h1:eihoPOH+FgIqa3FpoTwguz/bVUSGBlGQU67vpBeOrBY= golang.org/x/tools/go/packages/packagestest v0.1.1-deprecated h1:1h2MnaIAIXISqTFKdENegdpAgUXz6NrPEsbIeWaBRvM= @@ -557,8 +553,8 @@ gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EV gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -honnef.co/go/tools v0.6.1 h1:R094WgE8K4JirYjBaOpz/AvTyUu/3wbmAoskKN/pxTI= -honnef.co/go/tools v0.6.1/go.mod h1:3puzxxljPCe8RGJX7BIy1plGbxEOZni5mR2aXe3/uk4= +honnef.co/go/tools v0.7.0 h1:w6WUp1VbkqPEgLz4rkBzH/CSU6HkoqNLp6GstyTx3lU= +honnef.co/go/tools v0.7.0/go.mod h1:pm29oPxeP3P82ISxZDgIYeOaf9ta6Pi0EWvCFoLG2vc= mvdan.cc/gofumpt v0.9.2 h1:zsEMWL8SVKGHNztrx6uZrXdp7AX8r421Vvp23sz7ik4= mvdan.cc/gofumpt v0.9.2/go.mod h1:iB7Hn+ai8lPvofHd9ZFGVg2GOr8sBUw1QUWjNbmIL/s= mvdan.cc/unparam v0.0.0-20251027182757-5beb8c8f8f15 h1:ssMzja7PDPJV8FStj7hq9IKiuiKhgz9ErWw+m68e7DI= diff --git a/tools/vendor/github.com/golangci/golangci-lint/v2/pkg/commands/config_verify.go b/tools/vendor/github.com/golangci/golangci-lint/v2/pkg/commands/config_verify.go index 1bbc47d8d..7281e0888 100644 --- a/tools/vendor/github.com/golangci/golangci-lint/v2/pkg/commands/config_verify.go +++ b/tools/vendor/github.com/golangci/golangci-lint/v2/pkg/commands/config_verify.go @@ -38,6 +38,8 @@ func (c *configCommand) executeVerify(cmd *cobra.Command, _ []string) error { return fmt.Errorf("get JSON schema: %w", err) } + c.log.Infof("Verifying the configuration file %q with the JSON Schema from %s", usedConfigFile, schemaURL) + err = validateConfiguration(schemaURL, usedConfigFile) if err != nil { var v *jsonschema.ValidationError @@ -108,8 +110,8 @@ func extractCommitHash(buildInfo BuildInfo) (string, error) { commit := buildInfo.Commit - if strings.HasPrefix(commit, "(") { - c, _, ok := strings.Cut(strings.TrimPrefix(commit, "("), ",") + if after, ok := strings.CutPrefix(commit, "("); ok { + c, _, ok := strings.Cut(after, ",") if !ok { return "", errors.New("commit information not found") } diff --git a/tools/vendor/github.com/golangci/golangci-lint/v2/pkg/commands/run.go b/tools/vendor/github.com/golangci/golangci-lint/v2/pkg/commands/run.go index 93efa6d9c..a9a3495aa 100644 --- a/tools/vendor/github.com/golangci/golangci-lint/v2/pkg/commands/run.go +++ b/tools/vendor/github.com/golangci/golangci-lint/v2/pkg/commands/run.go @@ -25,7 +25,6 @@ import ( "github.com/spf13/cobra" "github.com/spf13/pflag" "github.com/spf13/viper" - "go.uber.org/automaxprocs/maxprocs" "go.yaml.in/yaml/v3" "golang.org/x/mod/sumdb/dirhash" @@ -160,16 +159,8 @@ func (c *runCommand) persistentPreRunE(cmd *cobra.Command, args []string) error return fmt.Errorf("can't load config: %w", err) } - if c.cfg.Run.Concurrency == 0 { - // `runtime.GOMAXPROCS` defaults to the value of `runtime.NumCPU`. - backup := runtime.GOMAXPROCS(0) - - // Automatically set GOMAXPROCS to match Linux container CPU quota. - _, err := maxprocs.Set(maxprocs.Logger(c.log.Infof)) - if err != nil { - runtime.GOMAXPROCS(backup) - } - } else { + // https://go.dev/doc/go1.25#container-aware-gomaxprocs + if c.cfg.Run.Concurrency != 0 { runtime.GOMAXPROCS(c.cfg.Run.Concurrency) } diff --git a/tools/vendor/github.com/golangci/golangci-lint/v2/pkg/config/linters_settings.go b/tools/vendor/github.com/golangci/golangci-lint/v2/pkg/config/linters_settings.go index 6c8554d99..3f7193bd3 100644 --- a/tools/vendor/github.com/golangci/golangci-lint/v2/pkg/config/linters_settings.go +++ b/tools/vendor/github.com/golangci/golangci-lint/v2/pkg/config/linters_settings.go @@ -180,6 +180,9 @@ var defaultLintersSettings = LintersSettings{ SQLBoiler: true, Jet: true, }, + CheckN1: false, + CheckSQLInjection: false, + CheckTxLeak: false, }, Unused: UnusedSettings{ FieldWritesAreUses: true, @@ -1045,7 +1048,12 @@ type UnqueryvetSettings struct { CheckFormatStrings bool `mapstructure:"check-format-strings"` CheckStringBuilder bool `mapstructure:"check-string-builder"` CheckSubqueries bool `mapstructure:"check-subqueries"` + CheckN1 bool `mapstructure:"check-n1"` + CheckSQLInjection bool `mapstructure:"check-sql-injection"` + CheckTxLeak bool `mapstructure:"check-tx-leaks"` SQLBuilders UnqueryvetSQLBuildersSettings `mapstructure:"sql-builders"` + Allow []string `mapstructure:"allow"` + CustomRules []UnqueryvetCustomRule `mapstructure:"custom-rules"` } type UnqueryvetSQLBuildersSettings struct { @@ -1059,6 +1067,15 @@ type UnqueryvetSQLBuildersSettings struct { Jet bool `mapstructure:"jet"` } +type UnqueryvetCustomRule struct { + ID string `mapstructure:"id"` + Pattern string `mapstructure:"pattern"` + Patterns []string `mapstructure:"patterns"` + When string `mapstructure:"when"` + Message string `mapstructure:"message"` + Action string `mapstructure:"action"` +} + type UnusedSettings struct { FieldWritesAreUses bool `mapstructure:"field-writes-are-uses"` PostStatementsAreReads bool `mapstructure:"post-statements-are-reads"` diff --git a/tools/vendor/github.com/golangci/golangci-lint/v2/pkg/config/run.go b/tools/vendor/github.com/golangci/golangci-lint/v2/pkg/config/run.go index dcddf0cb6..358557c06 100644 --- a/tools/vendor/github.com/golangci/golangci-lint/v2/pkg/config/run.go +++ b/tools/vendor/github.com/golangci/golangci-lint/v2/pkg/config/run.go @@ -21,6 +21,7 @@ type Run struct { BuildTags []string `mapstructure:"build-tags"` ModulesDownloadMode string `mapstructure:"modules-download-mode"` + EnableBuildVCS bool `mapstructure:"enable-build-vcs"` ExitCodeIfIssuesFound int `mapstructure:"issues-exit-code"` AnalyzeTests bool `mapstructure:"tests"` diff --git a/tools/vendor/github.com/golangci/golangci-lint/v2/pkg/goformatters/gci/internal/section/standard_list.go b/tools/vendor/github.com/golangci/golangci-lint/v2/pkg/goformatters/gci/internal/section/standard_list.go index f84eb0f33..a7787409e 100644 --- a/tools/vendor/github.com/golangci/golangci-lint/v2/pkg/goformatters/gci/internal/section/standard_list.go +++ b/tools/vendor/github.com/golangci/golangci-lint/v2/pkg/goformatters/gci/internal/section/standard_list.go @@ -1,6 +1,6 @@ package section -// Code generated based on go1.25.0 X:boringcrypto,arenas,synctest,jsonv2. DO NOT EDIT. +// Code generated based on go1.26.0 X:boringcrypto,arenas,jsonv2,runtimesecret. DO NOT EDIT. var standardPackages = map[string]struct{}{ "archive/tar": {}, @@ -31,8 +31,10 @@ var standardPackages = map[string]struct{}{ "crypto/fips140": {}, "crypto/hkdf": {}, "crypto/hmac": {}, + "crypto/hpke": {}, "crypto/md5": {}, "crypto/mlkem": {}, + "crypto/mlkem/mlkemtest": {}, "crypto/pbkdf2": {}, "crypto/rand": {}, "crypto/rc4": {}, @@ -154,6 +156,7 @@ var standardPackages = map[string]struct{}{ "runtime/metrics": {}, "runtime/pprof": {}, "runtime/race": {}, + "runtime/secret": {}, "runtime/trace": {}, "slices": {}, "sort": {}, @@ -165,6 +168,7 @@ var standardPackages = map[string]struct{}{ "syscall": {}, "syscall/js": {}, "testing": {}, + "testing/cryptotest": {}, "testing/fstest": {}, "testing/iotest": {}, "testing/quick": {}, diff --git a/tools/vendor/github.com/golangci/golangci-lint/v2/pkg/golinters/unqueryvet/unqueryvet.go b/tools/vendor/github.com/golangci/golangci-lint/v2/pkg/golinters/unqueryvet/unqueryvet.go index c6aad8860..e2c185869 100644 --- a/tools/vendor/github.com/golangci/golangci-lint/v2/pkg/golinters/unqueryvet/unqueryvet.go +++ b/tools/vendor/github.com/golangci/golangci-lint/v2/pkg/golinters/unqueryvet/unqueryvet.go @@ -12,15 +12,35 @@ func New(settings *config.UnqueryvetSettings) *goanalysis.Linter { cfg := pkgconfig.DefaultSettings() if settings != nil { - // IgnoredFiles, and Severity are explicitly ignored. + // IgnoredFiles, Ignore, Severity, and Rules are explicitly ignored. cfg.CheckSQLBuilders = settings.CheckSQLBuilders cfg.CheckAliasedWildcard = settings.CheckAliasedWildcard cfg.CheckStringConcat = settings.CheckStringConcat cfg.CheckFormatStrings = settings.CheckFormatStrings cfg.CheckStringBuilder = settings.CheckStringBuilder cfg.CheckSubqueries = settings.CheckSubqueries + cfg.N1DetectionEnabled = settings.CheckN1 + cfg.SQLInjectionDetectionEnabled = settings.CheckSQLInjection + cfg.TxLeakDetectionEnabled = settings.CheckTxLeak cfg.IgnoredFunctions = settings.IgnoredFunctions + for _, rule := range settings.CustomRules { + // The field Fix is explicitly ignored. + cfg.CustomRules = append(cfg.CustomRules, pkgconfig.CustomRule{ + ID: rule.ID, + Pattern: rule.Pattern, + Patterns: rule.Patterns, + When: rule.When, + Message: rule.Message, + Severity: "error", + Action: rule.Action, + }) + } + + if len(settings.Allow) > 0 { + cfg.Allow = settings.Allow + } + if len(settings.AllowedPatterns) > 0 { cfg.AllowedPatterns = settings.AllowedPatterns } diff --git a/tools/vendor/github.com/golangci/golangci-lint/v2/pkg/lint/lintersdb/builder_linter.go b/tools/vendor/github.com/golangci/golangci-lint/v2/pkg/lint/lintersdb/builder_linter.go index b1abb6db9..8748047a2 100644 --- a/tools/vendor/github.com/golangci/golangci-lint/v2/pkg/lint/lintersdb/builder_linter.go +++ b/tools/vendor/github.com/golangci/golangci-lint/v2/pkg/lint/lintersdb/builder_linter.go @@ -532,6 +532,7 @@ func (LinterBuilder) Build(cfg *config.Config) ([]*linter.Config, error) { linter.NewConfig(noinlineerr.New()). WithSince("v2.2.0"). WithLoadForGoAnalysis(). + WithAutoFix(). WithURL("https://github.com/AlwxSin/noinlineerr"), linter.NewConfig(nonamedreturns.New(&cfg.Linters.Settings.NoNamedReturns)). @@ -619,7 +620,7 @@ func (LinterBuilder) Build(cfg *config.Config) ([]*linter.Config, error) { linter.NewConfig(swaggo.New()). WithSince("v2.2.0"). WithAutoFix(). - WithURL("https://github.com/swaggo/swaggo"), + WithURL("https://github.com/swaggo/swag"), linter.NewConfig(tagalign.New(&cfg.Linters.Settings.TagAlign)). WithSince("v1.53.0"). diff --git a/tools/vendor/github.com/golangci/golangci-lint/v2/pkg/lint/package.go b/tools/vendor/github.com/golangci/golangci-lint/v2/pkg/lint/package.go index 3127a24b8..1d68efb68 100644 --- a/tools/vendor/github.com/golangci/golangci-lint/v2/pkg/lint/package.go +++ b/tools/vendor/github.com/golangci/golangci-lint/v2/pkg/lint/package.go @@ -230,6 +230,11 @@ func (l *PackageLoader) makeBuildFlags() []string { buildFlags = append(buildFlags, fmt.Sprintf("-mod=%s", l.cfg.Run.ModulesDownloadMode)) } + if !l.cfg.Run.EnableBuildVCS { + // disable collecting VCS information + buildFlags = append(buildFlags, "-buildvcs=false") + } + return buildFlags } diff --git a/tools/vendor/github.com/golangci/golangci-lint/v2/pkg/lint/runner.go b/tools/vendor/github.com/golangci/golangci-lint/v2/pkg/lint/runner.go index ba7750f28..99182ffe3 100644 --- a/tools/vendor/github.com/golangci/golangci-lint/v2/pkg/lint/runner.go +++ b/tools/vendor/github.com/golangci/golangci-lint/v2/pkg/lint/runner.go @@ -59,6 +59,15 @@ func NewRunner(log logutils.Log, cfg *config.Config, goenv *goutil.Env, } } + switch len(enabledLinters) { + case 0: + return nil, errors.New("no linters enabled") + case 1: + if _, ok := enabledLinters["typecheck"]; ok { + return nil, errors.New("no linters enabled") + } + } + formattersCfg := &config.Formatters{ Enable: enabledFormatters, Settings: cfg.Linters.Settings.FormatterSettings, diff --git a/tools/vendor/github.com/golangci/golangci-lint/v2/pkg/result/processors/nolint_filter.go b/tools/vendor/github.com/golangci/golangci-lint/v2/pkg/result/processors/nolint_filter.go index b1ba3be1e..1f45f044e 100644 --- a/tools/vendor/github.com/golangci/golangci-lint/v2/pkg/result/processors/nolint_filter.go +++ b/tools/vendor/github.com/golangci/golangci-lint/v2/pkg/result/processors/nolint_filter.go @@ -37,11 +37,8 @@ func (i *ignoredRange) doesMatch(issue *result.Issue) bool { // only allow selective nolinting of nolintlint nolintFoundForLinter := len(i.linters) == 0 && issue.FromLinter != nolintlint.LinterName - for _, linterName := range i.linters { - if linterName == issue.FromLinter { - nolintFoundForLinter = true - break - } + if slices.Contains(i.linters, issue.FromLinter) { + nolintFoundForLinter = true } if nolintFoundForLinter { diff --git a/tools/vendor/github.com/golangci/golines/LICENSE b/tools/vendor/github.com/golangci/golines/LICENSE index 1fbffdf72..b417faf7e 100644 --- a/tools/vendor/github.com/golangci/golines/LICENSE +++ b/tools/vendor/github.com/golangci/golines/LICENSE @@ -1,5 +1,6 @@ MIT License +Copyright (c) 2025 Golangci Team Copyright (c) 2019 Segment.io, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/tools/vendor/github.com/golangci/golines/shorten/format.go b/tools/vendor/github.com/golangci/golines/shorten/format.go index 6c3abb67a..c177ee573 100644 --- a/tools/vendor/github.com/golangci/golines/shorten/format.go +++ b/tools/vendor/github.com/golangci/golines/shorten/format.go @@ -75,6 +75,8 @@ func (s *Shortener) formatDecl(decl dst.Decl) { // formatStmt formats an AST statement node. // Among other examples, these include assignments, case clauses, // for statements, if statements, and select statements. +// +//nolint:funlen // the number of statements is expected. func (s *Shortener) formatStmt(stmt dst.Stmt, force bool) { stmtType := reflect.TypeOf(stmt) @@ -145,6 +147,12 @@ func (s *Shortener) formatStmt(stmt dst.Stmt, force bool) { case *dst.SwitchStmt: s.formatStmt(st.Body, false) + // Ignored: st.Init + + if st.Tag != nil { + s.formatExpr(st.Tag, shouldShorten, false) + } + case *dst.TypeSwitchStmt: s.formatStmt(st.Body, false) @@ -212,7 +220,7 @@ func (s *Shortener) formatExpr(expr dst.Expr, force, isChain bool) { } case *dst.CompositeLit: - if shouldShorten { + if shouldShorten || annotation.HasRecursive(e) { for i, element := range e.Elts { if i == 0 { element.Decorations().Before = dst.NewLine diff --git a/tools/vendor/github.com/golangci/golines/shorten/internal/annotation/annotation.go b/tools/vendor/github.com/golangci/golines/shorten/internal/annotation/annotation.go index 8491b4e46..0a9c1f0c8 100644 --- a/tools/vendor/github.com/golangci/golines/shorten/internal/annotation/annotation.go +++ b/tools/vendor/github.com/golangci/golines/shorten/internal/annotation/annotation.go @@ -62,6 +62,9 @@ func HasRecursive[T dst.Node](node T) bool { case *dst.FieldList: return slices.ContainsFunc(n.List, HasRecursive) + + case *dst.CompositeLit: + return slices.ContainsFunc(n.Elts, HasRecursive) } return false diff --git a/tools/vendor/github.com/golangci/misspell/.golangci.yml b/tools/vendor/github.com/golangci/misspell/.golangci.yml index 1811db3a0..9e4446f99 100644 --- a/tools/vendor/github.com/golangci/misspell/.golangci.yml +++ b/tools/vendor/github.com/golangci/misspell/.golangci.yml @@ -37,7 +37,7 @@ linters: - tparallel - varnamelen - wrapcheck - - wsl # FIXME(ldez) must be fixed + - wsl # deprecated settings: depguard: diff --git a/tools/vendor/github.com/golangci/misspell/ascii.go b/tools/vendor/github.com/golangci/misspell/ascii.go index 74abe5141..acf5f5334 100644 --- a/tools/vendor/github.com/golangci/misspell/ascii.go +++ b/tools/vendor/github.com/golangci/misspell/ascii.go @@ -7,6 +7,7 @@ func ByteToUpper(x byte) byte { c := b - byte(0x61) d := ^(b - byte(0x7b)) e := (c & d) & (^x & 0x7f) + return x - (e >> 2) } @@ -16,6 +17,7 @@ func ByteToLower(eax byte) byte { ebx := eax&byte(0x7f) + byte(0x25) ebx = ebx&byte(0x7f) + byte(0x1a) ebx = ((ebx & ^eax) >> 2) & byte(0x20) + return eax + ebx } @@ -32,18 +34,21 @@ func StringEqualFold(s1, s2 string) bool { if len(s1) != len(s2) { return false } + for i := range len(s1) { c1 := s1[i] c2 := s2[i] // c1 & c2 if c1 != c2 { c1 |= 'a' - 'A' + c2 |= 'a' - 'A' if c1 != c2 || c1 < 'a' || c1 > 'z' { return false } } } + return true } @@ -53,8 +58,10 @@ func StringHasPrefixFold(s1, s2 string) bool { if len(s1) < len(s2) { return false } + if len(s1) == len(s2) { return StringEqualFold(s1, s2) } + return StringEqualFold(s1[:len(s2)], s2) } diff --git a/tools/vendor/github.com/golangci/misspell/case.go b/tools/vendor/github.com/golangci/misspell/case.go index 533ce4db3..20e33a212 100644 --- a/tools/vendor/github.com/golangci/misspell/case.go +++ b/tools/vendor/github.com/golangci/misspell/case.go @@ -39,6 +39,7 @@ func CaseStyle(word string) WordCase { case upperCount == 1 && lowerCount > 0 && word[0] >= 'A' && word[0] <= 'Z': return CaseTitle } + return CaseUnknown } diff --git a/tools/vendor/github.com/golangci/misspell/mime.go b/tools/vendor/github.com/golangci/misspell/mime.go index 19d49e085..a74a355cb 100644 --- a/tools/vendor/github.com/golangci/misspell/mime.go +++ b/tools/vendor/github.com/golangci/misspell/mime.go @@ -126,6 +126,7 @@ func isTextFile(raw []byte) bool { // allow any text/ type with utf-8 encoding. // DetectContentType sometimes returns charset=utf-16 for XML stuff in which case ignore. mime := http.DetectContentType(raw) + return strings.HasPrefix(mime, "text/") && strings.HasSuffix(mime, "charset=utf-8") } @@ -173,18 +174,23 @@ func ReadTextFile(filename string) (string, error) { // if input is large, read the first 512 bytes to sniff type // if not-text, then exit isText := false + if fstat.Size() > 50000 { var fin *os.File + fin, err = os.Open(filename) if err != nil { return "", fmt.Errorf("unable to open large file %q: %w", filename, err) } defer fin.Close() + buf := make([]byte, 512) + _, err = io.ReadFull(fin, buf) if err != nil { return "", fmt.Errorf("unable to read 512 bytes from %q: %w", filename, err) } + if !isTextFile(buf) { return "", nil } @@ -202,5 +208,6 @@ func ReadTextFile(filename string) (string, error) { if !isText && !isTextFile(raw) { return "", nil } + return string(raw), nil } diff --git a/tools/vendor/github.com/golangci/misspell/notwords.go b/tools/vendor/github.com/golangci/misspell/notwords.go index f694f46dc..4697dcf72 100644 --- a/tools/vendor/github.com/golangci/misspell/notwords.go +++ b/tools/vendor/github.com/golangci/misspell/notwords.go @@ -24,6 +24,7 @@ var ( // TODO: windows style. func RemovePath(s string) string { out := bytes.Buffer{} + var idx int for s != "" { if idx = strings.IndexByte(s, '/'); idx == -1 { @@ -36,6 +37,7 @@ func RemovePath(s string) string { } var chclass string + switch s[idx] { case '/', ' ', '\n', '\t', '\r': chclass = " \n\r\t" @@ -46,6 +48,7 @@ func RemovePath(s string) string { default: out.WriteString(s[:idx+2]) s = s[idx+2:] + continue } @@ -59,6 +62,7 @@ func RemovePath(s string) string { break } } + return out.String() } diff --git a/tools/vendor/github.com/golangci/misspell/replace.go b/tools/vendor/github.com/golangci/misspell/replace.go index f51ac3b3b..6d88c5336 100644 --- a/tools/vendor/github.com/golangci/misspell/replace.go +++ b/tools/vendor/github.com/golangci/misspell/replace.go @@ -42,6 +42,7 @@ func New() *Replacer { Replacements: DictMain, } r.Compile() + return &r } @@ -54,8 +55,10 @@ func (r *Replacer) RemoveRule(ignore []string) { if inArray(ignore, r.Replacements[i]) { continue } + newWords = append(newWords, r.Replacements[i:i+2]...) } + r.engine = nil r.Replacements = newWords } @@ -75,6 +78,7 @@ func (r *Replacer) Compile() { for i := 0; i < len(r.Replacements); i += 2 { r.corrected[r.Replacements[i]] = r.Replacements[i+1] } + r.engine = NewStringReplacer(r.Replacements...) } @@ -86,7 +90,9 @@ func (r *Replacer) ReplaceGo(input string) (string, []Diff) { s.Mode = scanner.ScanIdents | scanner.ScanFloats | scanner.ScanChars | scanner.ScanStrings | scanner.ScanRawStrings | scanner.ScanComments lastPos := 0 output := "" + Loop: + for { switch s.Scan() { case scanner.Comment: @@ -109,19 +115,23 @@ Loop: // no changes, no copies return input, nil } + if lastPos < len(input) { output += input[lastPos:] } + diffs := make([]Diff, 0, 8) buf := bytes.NewBuffer(make([]byte, 0, max(len(input), len(output))+100)) // faster that making a bytes.Buffer and bufio.ReadString outlines := strings.SplitAfter(output, "\n") + inlines := strings.SplitAfter(input, "\n") for i := range inlines { if inlines[i] == outlines[i] { buf.WriteString(outlines[i]) continue } + r.recheckLine(inlines[i], i+1, buf, func(d Diff) { diffs = append(diffs, d) }) @@ -136,16 +146,19 @@ func (r *Replacer) Replace(input string) (string, []Diff) { if input == output { return input, nil } + diffs := make([]Diff, 0, 8) buf := bytes.NewBuffer(make([]byte, 0, max(len(input), len(output))+100)) // faster that making a bytes.Buffer and bufio.ReadString outlines := strings.SplitAfter(output, "\n") + inlines := strings.SplitAfter(input, "\n") for i := range inlines { if inlines[i] == outlines[i] { buf.WriteString(outlines[i]) continue } + r.recheckLine(inlines[i], i+1, buf, func(d Diff) { diffs = append(diffs, d) }) @@ -162,7 +175,9 @@ func (r *Replacer) ReplaceReader(raw io.Reader, w io.Writer, next func(Diff)) er line string lineNum int ) + reader := bufio.NewReader(raw) + for err == nil { lineNum++ line, err = reader.ReadString('\n') @@ -181,6 +196,7 @@ func (r *Replacer) ReplaceReader(raw io.Reader, w io.Writer, next func(Diff)) er // but it can be inaccurate, so we need to double-check r.recheckLine(line, lineNum, w, next) } + return nil } @@ -206,6 +222,7 @@ func (r *Replacer) recheckLine(s string, lineNum int, buf io.Writer, next func(D idx := wordRegexp.FindAllStringIndex(redacted, -1) for _, ab := range idx { word := s[ab[0]:ab[1]] + newword := r.engine.Replace(word) if newword == word { // no replacement done @@ -222,6 +239,7 @@ func (r *Replacer) recheckLine(s string, lineNum int, buf io.Writer, next func(D // word got corrected into something we know io.WriteString(buf, s[first:ab[0]]) io.WriteString(buf, newword) + first = ab[1] next(Diff{ FullLine: s, @@ -230,9 +248,11 @@ func (r *Replacer) recheckLine(s string, lineNum int, buf io.Writer, next func(D Corrected: newword, Column: ab[0], }) + continue } // Word got corrected into something unknown. Ignore it } + io.WriteString(buf, s[first:]) } diff --git a/tools/vendor/github.com/golangci/misspell/stringreplacer.go b/tools/vendor/github.com/golangci/misspell/stringreplacer.go index a03716849..b36fe6576 100644 --- a/tools/vendor/github.com/golangci/misspell/stringreplacer.go +++ b/tools/vendor/github.com/golangci/misspell/stringreplacer.go @@ -99,6 +99,7 @@ func (t *trieNode) add(key, val string, priority int, r *genericReplacer) { t.value = val t.priority = priority } + return } @@ -110,6 +111,7 @@ func (t *trieNode) add(key, val string, priority int, r *genericReplacer) { break } } + switch n { case len(t.prefix): t.next.add(key[n:], val, priority, r) @@ -126,12 +128,14 @@ func (t *trieNode) add(key, val string, priority int, r *genericReplacer) { next: t.next, } } + keyNode := new(trieNode) t.table = make([]*trieNode, r.tableSize) t.table[r.mapping[t.prefix[0]]] = prefixNode t.table[r.mapping[key[0]]] = keyNode t.prefix = "" t.next = nil + keyNode.add(key[1:], val, priority, r) default: // Insert new node after the common section of the prefix. @@ -143,6 +147,7 @@ func (t *trieNode) add(key, val string, priority int, r *genericReplacer) { t.next = next next.add(key[n:], val, priority, r) } + return } @@ -152,7 +157,9 @@ func (t *trieNode) add(key, val string, priority int, r *genericReplacer) { if t.table[m] == nil { t.table[m] = new(trieNode) } + t.table[m].add(key[1:], val, priority, r) + return } @@ -187,6 +194,7 @@ func makeGenericReplacer(oldnew []string) *genericReplacer { } var index byte + for i, b := range r.mapping { if b == 0 { r.mapping[i] = byte(r.tableSize) @@ -201,19 +209,25 @@ func makeGenericReplacer(oldnew []string) *genericReplacer { for i := 0; i < len(oldnew); i += 2 { r.root.add(strings.ToLower(oldnew[i]), oldnew[i+1], len(oldnew)-i, r) } + return r } func (r *genericReplacer) Replace(s string) string { buf := make(appendSliceWriter, 0, len(s)) r.WriteString(&buf, s) + return string(buf) } func (r *genericReplacer) WriteString(w io.Writer, s string) (n int, err error) { sw := getStringWriter(w) - var last, wn int - var prevMatchEmpty bool + + var ( + last, wn int + prevMatchEmpty bool + ) + for i := 0; i <= len(s); { // Fast path: s[i] is not a prefix of any pattern. if i != len(s) && r.root.priority == 0 { @@ -226,6 +240,7 @@ func (r *genericReplacer) WriteString(w io.Writer, s string) (n int, err error) // Ignore the empty match iff the previous loop found the empty match. val, keylen, match := r.lookup(s[i:], prevMatchEmpty) + prevMatchEmpty = match && keylen == 0 if match { orig := s[i : i+keylen] @@ -245,28 +260,37 @@ func (r *genericReplacer) WriteString(w io.Writer, s string) (n int, err error) val = strings.ToUpper(val[:1]) + strings.ToLower(val[1:]) } } + wn, err = sw.WriteString(s[last:i]) n += wn + if err != nil { - return + return n, err } + // debug helper: log.Printf("%d: Going to correct %q with %q", i, s[i:i+keylen], val) wn, err = sw.WriteString(val) n += wn + if err != nil { - return + return n, err } + i += keylen last = i + continue } + i++ } + if last != len(s) { wn, err = sw.WriteString(s[last:]) n += wn } - return + + return n, err } func (r *genericReplacer) lookup(s string, ignoreRoot bool) (val string, keylen int, found bool) { @@ -275,6 +299,7 @@ func (r *genericReplacer) lookup(s string, ignoreRoot bool) (val string, keylen bestPriority := 0 node := &r.root n := 0 + for node != nil { if node.priority > bestPriority && (!ignoreRoot || node != &r.root) { bestPriority = node.priority @@ -286,11 +311,13 @@ func (r *genericReplacer) lookup(s string, ignoreRoot bool) (val string, keylen if s == "" { break } + if node.table != nil { index := r.mapping[ByteToLower(s[0])] if int(index) == r.tableSize { break } + node = node.table[index] s = s[1:] n++ @@ -302,7 +329,8 @@ func (r *genericReplacer) lookup(s string, ignoreRoot bool) (val string, keylen break } } - return + + return val, keylen, found } type appendSliceWriter []byte @@ -332,5 +360,6 @@ func getStringWriter(w io.Writer) io.StringWriter { if !ok { sw = stringWriter{w} } + return sw } diff --git a/tools/vendor/github.com/golangci/misspell/words.go b/tools/vendor/github.com/golangci/misspell/words.go index 64bfd88e5..788682957 100644 --- a/tools/vendor/github.com/golangci/misspell/words.go +++ b/tools/vendor/github.com/golangci/misspell/words.go @@ -19642,6 +19642,7 @@ var DictMain = []string{ "repulican", "republican", "repulisve", "repulsive", "repuslive", "repulsive", + "requiered", "required", "resaurant", "restaurant", "researchs", "researchers", "resembels", "resembles", @@ -26750,6 +26751,7 @@ var DictMain = []string{ "requeim", "requiem", "requime", "requiem", "requred", "required", + "requrie", "require", "resapwn", "respawn", "rescuse", "rescues", "resembe", "resemble", diff --git a/tools/vendor/github.com/mgechev/revive/config/config.go b/tools/vendor/github.com/mgechev/revive/config/config.go index 224644479..1292c45bb 100644 --- a/tools/vendor/github.com/mgechev/revive/config/config.go +++ b/tools/vendor/github.com/mgechev/revive/config/config.go @@ -116,6 +116,8 @@ var allRules = append([]lint.Rule{ &rule.InefficientMapLookupRule{}, &rule.ForbiddenCallInWgGoRule{}, &rule.UnnecessaryIfRule{}, + &rule.EpochNamingRule{}, + &rule.UseSlicesSort{}, }, defaultRules...) // allFormatters is a list of all available formatters to output the linting results. @@ -186,12 +188,8 @@ func actualRuleName(name string) string { } } -func parseConfig(path string, config *lint.Config) error { - file, err := os.ReadFile(path) - if err != nil { - return errors.New("cannot read the config file") - } - err = toml.Unmarshal(file, config) +func parseConfig(data []byte, config *lint.Config) error { + err := toml.Unmarshal(data, config) if err != nil { return fmt.Errorf("cannot parse the config file: %w", err) } @@ -251,7 +249,11 @@ func GetConfig(configPath string) (*lint.Config, error) { switch { case configPath != "": config.Confidence = defaultConfidence - err := parseConfig(configPath, config) + data, err := os.ReadFile(configPath) //nolint:gosec // ignore G304: potential file inclusion via variable + if err != nil { + return nil, errors.New("cannot read the config file") + } + err = parseConfig(data, config) if err != nil { return nil, err } diff --git a/tools/vendor/github.com/mgechev/revive/formatter/friendly.go b/tools/vendor/github.com/mgechev/revive/formatter/friendly.go index de24df887..a9f0efa18 100644 --- a/tools/vendor/github.com/mgechev/revive/formatter/friendly.go +++ b/tools/vendor/github.com/mgechev/revive/formatter/friendly.go @@ -57,8 +57,10 @@ func (f *Friendly) printFriendlyFailure(sb *strings.Builder, failure lint.Failur sb.WriteString("\n\n") } -var errorEmoji = color.RedString("✘") -var warningEmoji = color.YellowString("⚠") +var ( + errorEmoji = color.RedString("✘") + warningEmoji = color.YellowString("⚠") +) func (*Friendly) printHeaderRow(sb *strings.Builder, failure lint.Failure, severity lint.Severity) { emoji := warningEmoji @@ -128,12 +130,15 @@ func table(rows [][]string) string { var buf bytes.Buffer tw := tabwriter.NewWriter(&buf, 0, 0, 2, ' ', 0) for _, row := range rows { - tw.Write([]byte{'\t'}) - for _, col := range row { - tw.Write(append([]byte(col), '\t')) + _, _ = tw.Write([]byte{'\t'}) + for i, col := range row { + _, _ = tw.Write([]byte(col)) + if i < len(row)-1 { + _, _ = tw.Write([]byte{'\t'}) + } } - tw.Write([]byte{'\n'}) + _, _ = tw.Write([]byte{'\n'}) } - tw.Flush() + _ = tw.Flush() return buf.String() } diff --git a/tools/vendor/github.com/mgechev/revive/formatter/json.go b/tools/vendor/github.com/mgechev/revive/formatter/json.go index 292c06b36..7c081f374 100644 --- a/tools/vendor/github.com/mgechev/revive/formatter/json.go +++ b/tools/vendor/github.com/mgechev/revive/formatter/json.go @@ -19,7 +19,8 @@ func (*JSON) Name() string { // jsonObject defines a JSON object of an failure. type jsonObject struct { - Severity lint.Severity `json:"Severity"` + Severity lint.Severity `json:"Severity"` + //nolint:embeddedstructfieldcheck // backward compatibility lint.Failure `json:",inline"` } diff --git a/tools/vendor/github.com/mgechev/revive/formatter/sarif.go b/tools/vendor/github.com/mgechev/revive/formatter/sarif.go index c17764902..03069bb4a 100644 --- a/tools/vendor/github.com/mgechev/revive/formatter/sarif.go +++ b/tools/vendor/github.com/mgechev/revive/formatter/sarif.go @@ -32,13 +32,17 @@ func (*Sarif) Format(failures <-chan lint.Failure, cfg lint.Config) (string, err } buf := new(bytes.Buffer) - sarifLog.PrettyWrite(buf) + err := sarifLog.PrettyWrite(buf) + if err != nil { + return "", err + } return buf.String(), nil } type reviveRunLog struct { *garif.LogFile + run *garif.Run rules map[string]lint.RuleConfig } diff --git a/tools/vendor/github.com/mgechev/revive/formatter/stylish.go b/tools/vendor/github.com/mgechev/revive/formatter/stylish.go index 8185e8b8a..573e5b0ac 100644 --- a/tools/vendor/github.com/mgechev/revive/formatter/stylish.go +++ b/tools/vendor/github.com/mgechev/revive/formatter/stylish.go @@ -2,6 +2,7 @@ package formatter import ( "fmt" + "slices" "github.com/fatih/color" @@ -43,24 +44,27 @@ func (*Stylish) Format(failures <-chan lint.Failure, config lint.Config) (string if currentType == lint.SeverityError { totalErrors++ } - result = append(result, formatFailure(f, lint.Severity(currentType))) + result = append(result, formatFailure(f, currentType)) } fileReport := map[string][][]string{} + var files []string for _, row := range result { if _, ok := fileReport[row[0]]; !ok { fileReport[row[0]] = [][]string{} + files = append(files, row[0]) } fileReport[row[0]] = append(fileReport[row[0]], []string{row[1], row[2], row[3]}) } + slices.Sort(files) output := "" - for filename, val := range fileReport { + for _, filename := range files { c := color.New(color.Underline) output += c.SprintfFunc()(filename + "\n") - output += table(val) + "\n" + output += table(fileReport[filename]) + "\n" } problemsLabel := "problems" diff --git a/tools/vendor/github.com/mgechev/revive/internal/astutils/ast_utils.go b/tools/vendor/github.com/mgechev/revive/internal/astutils/ast_utils.go index fca3ee5a9..597742040 100644 --- a/tools/vendor/github.com/mgechev/revive/internal/astutils/ast_utils.go +++ b/tools/vendor/github.com/mgechev/revive/internal/astutils/ast_utils.go @@ -3,7 +3,7 @@ package astutils import ( "bytes" - "crypto/md5" + "crypto/md5" //nolint:gosec // G501: Blocklisted import crypto/md5: weak cryptographic primitive "encoding/hex" "fmt" "go/ast" @@ -201,14 +201,14 @@ var gofmtConfig = &printer.Config{Tabwidth: 8} func GoFmt(x any) string { buf := bytes.Buffer{} fs := token.NewFileSet() - gofmtConfig.Fprint(&buf, fs, x) + _ = gofmtConfig.Fprint(&buf, fs, x) return buf.String() } // NodeHash yields the MD5 hash of the given AST node. func NodeHash(node ast.Node) string { hasher := func(in string) string { - binHash := md5.Sum([]byte(in)) + binHash := md5.Sum([]byte(in)) //nolint:gosec // G401: Weak cryptographic primitive return hex.EncodeToString(binHash[:]) } str := GoFmt(node) diff --git a/tools/vendor/github.com/mgechev/revive/internal/ifelse/branch.go b/tools/vendor/github.com/mgechev/revive/internal/ifelse/branch.go index 518362781..5acf83840 100644 --- a/tools/vendor/github.com/mgechev/revive/internal/ifelse/branch.go +++ b/tools/vendor/github.com/mgechev/revive/internal/ifelse/branch.go @@ -9,11 +9,12 @@ import ( // Branch contains information about a branch within an if-else chain. type Branch struct { BranchKind - Call // The function called at the end for kind Panic or Exit. + Call // The function called at the end for kind Panic or Exit. + block []ast.Stmt } -// BlockBranch gets the Branch of an ast.BlockStmt. +// BlockBranch gets the Branch of an [ast.BlockStmt]. func BlockBranch(block *ast.BlockStmt) Branch { blockLen := len(block.List) if blockLen == 0 { @@ -25,7 +26,7 @@ func BlockBranch(block *ast.BlockStmt) Branch { return branch } -// StmtBranch gets the Branch of an ast.Stmt. +// StmtBranch gets the Branch of an [ast.Stmt]. func StmtBranch(stmt ast.Stmt) Branch { switch stmt := stmt.(type) { case *ast.ReturnStmt: diff --git a/tools/vendor/github.com/mgechev/revive/lint/file.go b/tools/vendor/github.com/mgechev/revive/lint/file.go index bf6aed452..15b7aa850 100644 --- a/tools/vendor/github.com/mgechev/revive/lint/file.go +++ b/tools/vendor/github.com/mgechev/revive/lint/file.go @@ -235,9 +235,8 @@ func (f *File) disabledIntervals(rules []Rule, mustSpecifyDisableReason bool, fa continue } ruleNames := []string{} - tempNames := strings.Split(match[rulesPos], ",") - for _, name := range tempNames { + for name := range strings.SplitSeq(match[rulesPos], ",") { name = strings.Trim(name, "\n") if name != "" { ruleNames = append(ruleNames, name) @@ -274,7 +273,7 @@ func (f *File) disabledIntervals(rules []Rule, mustSpecifyDisableReason bool, fa return getEnabledDisabledIntervals() } -func (File) filterFailures(failures []Failure, disabledIntervals disabledIntervalsMap) []Failure { +func (*File) filterFailures(failures []Failure, disabledIntervals disabledIntervalsMap) []Failure { result := []Failure{} for _, failure := range failures { fStart := failure.Position.Start.Line diff --git a/tools/vendor/github.com/mgechev/revive/lint/filefilter.go b/tools/vendor/github.com/mgechev/revive/lint/filefilter.go index 9978597f3..3a523f2a5 100644 --- a/tools/vendor/github.com/mgechev/revive/lint/filefilter.go +++ b/tools/vendor/github.com/mgechev/revive/lint/filefilter.go @@ -41,6 +41,7 @@ func ParseFileFilter(rawFilter string) (*FileFilter, error) { return result, nil } +// String returns the original raw filter definition as it appears in the configuration. func (ff *FileFilter) String() string { return ff.raw } // MatchFileName checks if the file name matches the filter. diff --git a/tools/vendor/github.com/mgechev/revive/lint/linter.go b/tools/vendor/github.com/mgechev/revive/lint/linter.go index 2abbb699d..46ae3f9c1 100644 --- a/tools/vendor/github.com/mgechev/revive/lint/linter.go +++ b/tools/vendor/github.com/mgechev/revive/lint/linter.go @@ -37,7 +37,7 @@ func New(reader ReadFile, maxOpenFiles int) Linter { } } -func (l Linter) readFile(path string) (result []byte, err error) { +func (l *Linter) readFile(path string) (result []byte, err error) { if l.fileReadTokens != nil { // "take" a token by writing to the channel. // It will block if no more space in the channel's buffer @@ -162,7 +162,7 @@ func detectGoMod(dir string) (rootDir string, ver *goversion.Version, err error) return "", nil, fmt.Errorf("%q doesn't seem to be part of a Go module", dir) } - mod, err := os.ReadFile(modFileName) + mod, err := os.ReadFile(modFileName) //nolint:gosec // ignore G304: potential file inclusion via variable if err != nil { return "", nil, fmt.Errorf("failed to read %q, got %w", modFileName, err) } @@ -202,7 +202,7 @@ func retrieveModFile(dir string) (string, error) { } // isGenerated reports whether the source file is generated code -// according the rules from https://golang.org/s/generatedcode. +// according to the rules from https://go.dev/s/generatedcode. // This is inherited from the original go lint. func isGenerated(src []byte) bool { sc := bufio.NewScanner(bytes.NewReader(src)) diff --git a/tools/vendor/github.com/mgechev/revive/lint/package.go b/tools/vendor/github.com/mgechev/revive/lint/package.go index cb78cb452..eaaf64134 100644 --- a/tools/vendor/github.com/mgechev/revive/lint/package.go +++ b/tools/vendor/github.com/mgechev/revive/lint/package.go @@ -142,7 +142,7 @@ func (p *Package) TypeCheck() error { return err } -// check function encapsulates the call to go/types.Config.Check method and +// check function encapsulates the call to [go/types.Config.Check] method and // recovers if the called method panics (see issue #59). func check(config *types.Config, n string, fset *token.FileSet, astFiles []*ast.File, info *types.Info) (p *types.Package, err error) { defer func() { diff --git a/tools/vendor/github.com/mgechev/revive/logging/logger.go b/tools/vendor/github.com/mgechev/revive/logging/logger.go index 212419f27..2b4726de6 100644 --- a/tools/vendor/github.com/mgechev/revive/logging/logger.go +++ b/tools/vendor/github.com/mgechev/revive/logging/logger.go @@ -9,7 +9,10 @@ import ( const logFile = "revive.log" -var logger *slog.Logger +var ( + logger *slog.Logger + loggerFile *os.File +) // GetLogger retrieves an instance of an application logger which outputs // to a file if the debug flag is enabled. @@ -21,17 +24,26 @@ func GetLogger() (*slog.Logger, error) { debugModeEnabled := os.Getenv("DEBUG") != "" if !debugModeEnabled { // by default, suppress all logging output - return slog.New(slog.NewTextHandler(io.Discard, nil)), nil // TODO: change to slog.New(slog.DiscardHandler) when we switch to Go 1.24 + return slog.New(slog.DiscardHandler), nil } - fileWriter, err := os.Create(logFile) + var err error + loggerFile, err = os.Create(logFile) if err != nil { return nil, err } - logger = slog.New(slog.NewTextHandler(io.MultiWriter(os.Stderr, fileWriter), nil)) + logger = slog.New(slog.NewTextHandler(io.MultiWriter(os.Stderr, loggerFile), nil)) logger.Info("Logger initialized", "logFile", logFile) return logger, nil } + +// Close closes the logger file if it was opened. +func Close() error { + if loggerFile == nil { + return nil + } + return loggerFile.Close() +} diff --git a/tools/vendor/github.com/mgechev/revive/rule/add_constant.go b/tools/vendor/github.com/mgechev/revive/rule/add_constant.go index 90abd4e62..d0770a104 100644 --- a/tools/vendor/github.com/mgechev/revive/rule/add_constant.go +++ b/tools/vendor/github.com/mgechev/revive/rule/add_constant.go @@ -25,8 +25,7 @@ func newAllowList() allowList { } func (wl allowList) add(kind, list string) { - elems := strings.Split(list, ",") - for _, e := range elems { + for e := range strings.SplitSeq(list, ",") { wl[kind][e] = true } } @@ -247,7 +246,7 @@ func (r *AddConstantRule) Configure(arguments lint.Arguments) error { return fmt.Errorf("invalid argument to the ignoreFuncs parameter of add-constant rule, string expected. Got '%v' (%T)", v, v) } - for _, exclude := range strings.Split(excludes, ",") { + for exclude := range strings.SplitSeq(excludes, ",") { exclude = strings.Trim(exclude, " ") if exclude == "" { return errors.New("invalid argument to the ignoreFuncs parameter of add-constant rule, expected regular expression must not be empty") diff --git a/tools/vendor/github.com/mgechev/revive/rule/banned_characters.go b/tools/vendor/github.com/mgechev/revive/rule/banned_characters.go index 228156bb4..b113c8db9 100644 --- a/tools/vendor/github.com/mgechev/revive/rule/banned_characters.go +++ b/tools/vendor/github.com/mgechev/revive/rule/banned_characters.go @@ -20,10 +20,6 @@ const bannedCharsRuleName = "banned-characters" // Configuration implements the [lint.ConfigurableRule] interface. func (r *BannedCharsRule) Configure(arguments lint.Arguments) error { if len(arguments) > 0 { - err := checkNumberOfArguments(1, arguments, bannedCharsRuleName) - if err != nil { - return err - } list, err := r.getBannedCharsList(arguments) if err != nil { return err diff --git a/tools/vendor/github.com/mgechev/revive/rule/bool_literal_in_expr.go b/tools/vendor/github.com/mgechev/revive/rule/bool_literal_in_expr.go index c510ecc3e..ee713ae96 100644 --- a/tools/vendor/github.com/mgechev/revive/rule/bool_literal_in_expr.go +++ b/tools/vendor/github.com/mgechev/revive/rule/bool_literal_in_expr.go @@ -61,7 +61,7 @@ func (w *lintBoolLiteral) Visit(node ast.Node) ast.Visitor { return w } -func (w lintBoolLiteral) addFailure(node ast.Node, msg string, cat lint.FailureCategory) { +func (w *lintBoolLiteral) addFailure(node ast.Node, msg string, cat lint.FailureCategory) { w.onFailure(lint.Failure{ Confidence: 1, Node: node, diff --git a/tools/vendor/github.com/mgechev/revive/rule/cognitive_complexity.go b/tools/vendor/github.com/mgechev/revive/rule/cognitive_complexity.go index 901fc60be..d9937713e 100644 --- a/tools/vendor/github.com/mgechev/revive/rule/cognitive_complexity.go +++ b/tools/vendor/github.com/mgechev/revive/rule/cognitive_complexity.go @@ -95,7 +95,7 @@ func (v *cognitiveComplexityVisitor) subTreeComplexity(n ast.Node) int { return v.complexity } -// Visit implements the ast.Visitor interface. +// Visit implements the [ast.Visitor] interface. func (v *cognitiveComplexityVisitor) Visit(n ast.Node) ast.Visitor { switch n := n.(type) { case *ast.IfStmt: diff --git a/tools/vendor/github.com/mgechev/revive/rule/confusing_naming.go b/tools/vendor/github.com/mgechev/revive/rule/confusing_naming.go index 83f53a596..ef78b60a7 100644 --- a/tools/vendor/github.com/mgechev/revive/rule/confusing_naming.go +++ b/tools/vendor/github.com/mgechev/revive/rule/confusing_naming.go @@ -70,7 +70,8 @@ func (*ConfusingNamingRule) Name() string { return "confusing-naming" } -// checkMethodName checks if a given method/function name is similar (just case differences) to other method/function of the same struct/file. +// checkMethodName checks if a given method/function name is similar (just case differences) to other method/function +// of the same struct/file. func checkMethodName(holder string, id *ast.Ident, w *lintConfusingNames) { if id.Name == "init" && holder == defaultStructName { // ignore init functions diff --git a/tools/vendor/github.com/mgechev/revive/rule/cyclomatic.go b/tools/vendor/github.com/mgechev/revive/rule/cyclomatic.go index 088c45c85..6025b65e8 100644 --- a/tools/vendor/github.com/mgechev/revive/rule/cyclomatic.go +++ b/tools/vendor/github.com/mgechev/revive/rule/cyclomatic.go @@ -99,7 +99,7 @@ type complexityVisitor struct { Complexity int } -// Visit implements the ast.Visitor interface. +// Visit implements the [ast.Visitor] interface. func (v *complexityVisitor) Visit(n ast.Node) ast.Visitor { switch n := n.(type) { case *ast.FuncDecl, *ast.IfStmt, *ast.ForStmt, *ast.RangeStmt, *ast.CaseClause, *ast.CommClause: diff --git a/tools/vendor/github.com/mgechev/revive/rule/enforce_switch_style.go b/tools/vendor/github.com/mgechev/revive/rule/enforce_switch_style.go index 96093d620..5f2e31223 100644 --- a/tools/vendor/github.com/mgechev/revive/rule/enforce_switch_style.go +++ b/tools/vendor/github.com/mgechev/revive/rule/enforce_switch_style.go @@ -45,12 +45,20 @@ func (r *EnforceSwitchStyleRule) Apply(file *lint.File, _ lint.Arguments) []lint var failures []lint.Failure astFile := file.AST ast.Inspect(astFile, func(n ast.Node) bool { - switchNode, ok := n.(*ast.SwitchStmt) - if !ok { + var body *ast.BlockStmt + var node ast.Node + switch s := n.(type) { + case *ast.SwitchStmt: + body = s.Body + node = s + case *ast.TypeSwitchStmt: + body = s.Body + node = s + default: return true // not a switch statement } - defaultClause, isLast := r.seekDefaultCase(switchNode.Body) + defaultClause, isLast := r.seekDefaultCase(body) hasDefault := defaultClause != nil if !hasDefault && r.allowNoDefault { @@ -59,10 +67,10 @@ func (r *EnforceSwitchStyleRule) Apply(file *lint.File, _ lint.Arguments) []lint if !hasDefault && !r.allowNoDefault { // switch without default - if !r.allBranchesEndWithJumpStmt(switchNode) { + if !r.allBranchesEndWithJumpStmt(body) { failures = append(failures, lint.Failure{ Confidence: 1, - Node: switchNode, + Node: node, Category: lint.FailureCategoryStyle, Failure: "switch must have a default case clause", }) @@ -103,8 +111,8 @@ func (*EnforceSwitchStyleRule) seekDefaultCase(body *ast.BlockStmt) (defaultClau return defaultClause, defaultClause == last } -func (*EnforceSwitchStyleRule) allBranchesEndWithJumpStmt(switchStmt *ast.SwitchStmt) bool { - for _, stmt := range switchStmt.Body.List { +func (*EnforceSwitchStyleRule) allBranchesEndWithJumpStmt(body *ast.BlockStmt) bool { + for _, stmt := range body.List { caseClause := stmt.(*ast.CaseClause) // safe to assume stmt is a case clause caseBody := caseClause.Body diff --git a/tools/vendor/github.com/mgechev/revive/rule/epoch_naming.go b/tools/vendor/github.com/mgechev/revive/rule/epoch_naming.go new file mode 100644 index 000000000..ac5906713 --- /dev/null +++ b/tools/vendor/github.com/mgechev/revive/rule/epoch_naming.go @@ -0,0 +1,149 @@ +package rule + +import ( + "fmt" + "go/ast" + "go/token" + "go/types" + "strings" + + "github.com/mgechev/revive/lint" +) + +// EpochNamingRule lints epoch time variable naming. +type EpochNamingRule struct{} + +// Apply applies the rule to given file. +func (*EpochNamingRule) Apply(file *lint.File, _ lint.Arguments) []lint.Failure { + var failures []lint.Failure + + walker := lintEpochNaming{ + file: file, + onFailure: func(failure lint.Failure) { + failures = append(failures, failure) + }, + } + + if err := file.Pkg.TypeCheck(); err != nil { + return []lint.Failure{ + lint.NewInternalFailure(fmt.Sprintf("Unable to type check file %q: %v", file.Name, err)), + } + } + ast.Walk(walker, file.AST) + + return failures +} + +// Name returns the rule name. +func (*EpochNamingRule) Name() string { + return "epoch-naming" +} + +type lintEpochNaming struct { + file *lint.File + onFailure func(lint.Failure) +} + +var epochUnits = map[string][]string{ + "Unix": {"Sec", "Second", "Seconds"}, + "UnixMilli": {"Milli", "Ms"}, + "UnixMicro": {"Micro", "Microsecond", "Microseconds", "Us"}, + "UnixNano": {"Nano", "Ns"}, +} + +func (w lintEpochNaming) Visit(node ast.Node) ast.Visitor { + switch v := node.(type) { + case *ast.ValueSpec: + // Handle var declarations + valuesLen := len(v.Values) + for i, name := range v.Names { + if i >= valuesLen { + break + } + + w.check(name, v.Values[i]) + } + case *ast.AssignStmt: + // Handle both short variable declarations (:=) and regular assignments (=) + if v.Tok != token.DEFINE && v.Tok != token.ASSIGN { + return w + } + + rhsLen := len(v.Rhs) + + for i, lhs := range v.Lhs { + if i >= rhsLen { + break + } + ident, ok := lhs.(*ast.Ident) + if !ok || ident.Name == "_" { + continue + } + w.check(ident, v.Rhs[i]) + } + } + + return w +} + +func (w lintEpochNaming) check(name *ast.Ident, value ast.Expr) { + call, ok := value.(*ast.CallExpr) + if !ok { + return + } + + selector, ok := call.Fun.(*ast.SelectorExpr) + if !ok { + return + } + + // Check if the receiver is of type time.Time + receiverType := w.file.Pkg.TypeOf(selector.X) + if receiverType == nil { + return + } + if !isTime(receiverType) { + return + } + + methodName := selector.Sel.Name + suffixes, ok := epochUnits[methodName] + if !ok { + return + } + + varName := name.Name + if !hasAnySuffix(varName, suffixes) { + w.onFailure(lint.Failure{ + Confidence: 0.9, + Node: name, + Category: lint.FailureCategoryNaming, + Failure: fmt.Sprintf("var %s should have one of these suffixes: %s", varName, strings.Join(suffixes, ", ")), + }) + } +} + +func isTime(typ types.Type) bool { + named, ok := typ.(*types.Named) + if !ok { + return false + } + + obj := named.Obj() + if obj == nil { + return false + } + + pkg := obj.Pkg() + return pkg != nil && pkg.Path() == "time" && obj.Name() == "Time" +} + +func hasAnySuffix(s string, suffixes []string) bool { + lowerName := strings.ToLower(s) + for _, suffix := range suffixes { + if strings.HasSuffix(lowerName, strings.ToLower(suffix)) { + return true + } + } + return false +} diff --git a/tools/vendor/github.com/mgechev/revive/rule/exported.go b/tools/vendor/github.com/mgechev/revive/rule/exported.go index eb351cf4d..ccc73162e 100644 --- a/tools/vendor/github.com/mgechev/revive/rule/exported.go +++ b/tools/vendor/github.com/mgechev/revive/rule/exported.go @@ -170,15 +170,15 @@ func (w *lintExported) lintFuncDoc(fn *ast.FuncDecl) { case exportedGoDocStatusOK: return // comment is fine case exportedGoDocStatusMissing: - w.addFailuref(fn, status.Confidence(), lint.FailureCategoryComments, + w.addFailuref(fn, status.confidence(), lint.FailureCategoryComments, "exported %s %s should have comment or be unexported", kind, name, ) return } firstCommentLine := w.firstCommentLine(fn.Doc) - w.addFailuref(fn.Doc, status.Confidence(), lint.FailureCategoryComments, - `comment on exported %s %s should be of the form "%s ..."%s`, kind, name, fn.Name.Name, status.CorrectionHint(firstCommentLine), + w.addFailuref(fn.Doc, status.confidence(), lint.FailureCategoryComments, + `comment on exported %s %s should be of the form "%s ..."%s`, kind, name, fn.Name.Name, status.correctionHint(firstCommentLine), ) } @@ -264,8 +264,8 @@ func (w *lintExported) lintTypeDoc(t *ast.TypeSpec, doc *ast.CommentGroup, first if status == exportedGoDocStatusOK { return } - w.addFailuref(doc, status.Confidence(), lint.FailureCategoryComments, - `comment on exported type %v should be of the form "%s ..." (with optional leading article)%s`, t.Name, typeName, status.CorrectionHint(firstCommentLine), + w.addFailuref(doc, status.confidence(), lint.FailureCategoryComments, + `comment on exported type %v should be of the form "%s ..." (with optional leading article)%s`, t.Name, typeName, status.correctionHint(firstCommentLine), ) } @@ -347,8 +347,8 @@ func (w *lintExported) lintValueSpecDoc(vs *ast.ValueSpec, gd *ast.GenDecl, genD if status == exportedGoDocStatusOK { return } - w.addFailuref(doc, status.Confidence(), lint.FailureCategoryComments, - `comment on exported %s %s should be of the form "%s ..."%s`, kind, name, name, status.CorrectionHint(firstCommentLine), + w.addFailuref(doc, status.confidence(), lint.FailureCategoryComments, + `comment on exported %s %s should be of the form "%s ..."%s`, kind, name, name, status.correctionHint(firstCommentLine), ) } @@ -362,14 +362,14 @@ const ( exportedGoDocStatusUnexpected ) -func (gds exportedGoDocStatus) Confidence() float64 { +func (gds exportedGoDocStatus) confidence() float64 { if gds == exportedGoDocStatusUnexpected { return 0.8 } return 1 } -func (gds exportedGoDocStatus) CorrectionHint(firstCommentLine string) string { +func (gds exportedGoDocStatus) correctionHint(firstCommentLine string) string { firstWord := strings.Split(firstCommentLine, " ")[0] switch gds { case exportedGoDocStatusCaseMismatch: @@ -411,14 +411,13 @@ func (w *lintExported) checkGoDocStatus(comment *ast.CommentGroup, name string) // An "interesting line" is a comment line that is neither a directive (e.g. //go:...) or a deprecation comment // (lines from the first line with a prefix // Deprecated: to the end of the comment group) // Empty or spaces-only lines are discarded. -func (lintExported) firstCommentLine(comment *ast.CommentGroup) (result string) { +func (*lintExported) firstCommentLine(comment *ast.CommentGroup) (result string) { if comment == nil { return "" } commentWithoutDirectives := comment.Text() // removes directives from the comment block - lines := strings.Split(commentWithoutDirectives, "\n") - for _, line := range lines { + for line := range strings.SplitSeq(commentWithoutDirectives, "\n") { line := strings.TrimSpace(line) if line == "" { continue // ignore empty lines @@ -501,15 +500,15 @@ func (w *lintExported) lintInterfaceMethod(typeName string, m *ast.Field) { case exportedGoDocStatusOK: return // comment is fine case exportedGoDocStatusMissing: - w.addFailuref(m, status.Confidence(), lint.FailureCategoryComments, + w.addFailuref(m, status.confidence(), lint.FailureCategoryComments, "public interface method %s.%s should be commented", typeName, name, ) return } firstCommentLine := w.firstCommentLine(m.Doc) - w.addFailuref(m.Doc, status.Confidence(), lint.FailureCategoryComments, - `comment on exported interface method %s.%s should be of the form "%s ..."%s`, typeName, name, name, status.CorrectionHint(firstCommentLine), + w.addFailuref(m.Doc, status.confidence(), lint.FailureCategoryComments, + `comment on exported interface method %s.%s should be of the form "%s ..."%s`, typeName, name, name, status.correctionHint(firstCommentLine), ) } diff --git a/tools/vendor/github.com/mgechev/revive/rule/file_header.go b/tools/vendor/github.com/mgechev/revive/rule/file_header.go index 53d7ea9d0..a6538b51c 100644 --- a/tools/vendor/github.com/mgechev/revive/rule/file_header.go +++ b/tools/vendor/github.com/mgechev/revive/rule/file_header.go @@ -3,6 +3,7 @@ package rule import ( "fmt" "regexp" + "strings" "github.com/mgechev/revive/lint" ) @@ -55,7 +56,7 @@ func (r *FileHeaderRule) Apply(file *lint.File, _ lint.Arguments) []lint.Failure if g == nil { return failure } - comment := "" + var comment strings.Builder for _, c := range g.List { text := c.Text if multiRegexp.MatchString(text) { @@ -63,7 +64,7 @@ func (r *FileHeaderRule) Apply(file *lint.File, _ lint.Arguments) []lint.Failure } else if singleRegexp.MatchString(text) { text = text[2:] } - comment += text + comment.WriteString(text) } regex, err := regexp.Compile(r.header) @@ -71,7 +72,7 @@ func (r *FileHeaderRule) Apply(file *lint.File, _ lint.Arguments) []lint.Failure return newInternalFailureError(err) } - if !regex.MatchString(comment) { + if !regex.MatchString(comment.String()) { return failure } return nil diff --git a/tools/vendor/github.com/mgechev/revive/rule/filename_format.go b/tools/vendor/github.com/mgechev/revive/rule/filename_format.go index 200ffbde0..faa24b614 100644 --- a/tools/vendor/github.com/mgechev/revive/rule/filename_format.go +++ b/tools/vendor/github.com/mgechev/revive/rule/filename_format.go @@ -4,6 +4,7 @@ import ( "fmt" "path/filepath" "regexp" + "strings" "unicode" "github.com/mgechev/revive/lint" @@ -31,16 +32,16 @@ func (r *FilenameFormatRule) Apply(file *lint.File, _ lint.Arguments) []lint.Fai } func (*FilenameFormatRule) getMsgForNonASCIIChars(str string) string { - result := "" + var result strings.Builder for _, c := range str { if c <= unicode.MaxASCII { continue } - result += fmt.Sprintf(" Non ASCII character %c (%U) found.", c, c) + result.WriteString(fmt.Sprintf(" Non ASCII character %c (%U) found.", c, c)) } - return result + return result.String() } // Name returns the rule name. diff --git a/tools/vendor/github.com/mgechev/revive/rule/inefficient_map_lookup.go b/tools/vendor/github.com/mgechev/revive/rule/inefficient_map_lookup.go index b6e4bf921..c6944200b 100644 --- a/tools/vendor/github.com/mgechev/revive/rule/inefficient_map_lookup.go +++ b/tools/vendor/github.com/mgechev/revive/rule/inefficient_map_lookup.go @@ -155,6 +155,11 @@ func (w *lintInefficientMapLookup) isRangeOverMapKey(stmt ast.Stmt) bool { return false // not a range } + // Check if we range on the key + if rangeStmt.Key == nil { + return false // no key in range + } + // Check if we range only on key // for key := range ... // for key, _ := range ... diff --git a/tools/vendor/github.com/mgechev/revive/rule/max_control_nesting.go b/tools/vendor/github.com/mgechev/revive/rule/max_control_nesting.go index 5bb11d098..b1ac459dc 100644 --- a/tools/vendor/github.com/mgechev/revive/rule/max_control_nesting.go +++ b/tools/vendor/github.com/mgechev/revive/rule/max_control_nesting.go @@ -112,11 +112,6 @@ func (r *MaxControlNestingRule) Configure(arguments lint.Arguments) error { return nil } - check := checkNumberOfArguments(1, arguments, r.Name()) - if check != nil { - return check - } - maxNesting, ok := arguments[0].(int64) // Alt. non panicking version if !ok { return errors.New(`invalid value passed as argument number to the "max-control-nesting" rule`) diff --git a/tools/vendor/github.com/mgechev/revive/rule/max_public_structs.go b/tools/vendor/github.com/mgechev/revive/rule/max_public_structs.go index c78116d3a..070277229 100644 --- a/tools/vendor/github.com/mgechev/revive/rule/max_public_structs.go +++ b/tools/vendor/github.com/mgechev/revive/rule/max_public_structs.go @@ -25,11 +25,6 @@ func (r *MaxPublicStructsRule) Configure(arguments lint.Arguments) error { return nil } - err := checkNumberOfArguments(1, arguments, r.Name()) - if err != nil { - return err - } - maxStructs, ok := arguments[0].(int64) // Alt. non panicking version if !ok { return errors.New(`invalid value passed as argument number to the "max-public-structs" rule`) diff --git a/tools/vendor/github.com/mgechev/revive/rule/modifies_param.go b/tools/vendor/github.com/mgechev/revive/rule/modifies_param.go index 687ee8446..f35239027 100644 --- a/tools/vendor/github.com/mgechev/revive/rule/modifies_param.go +++ b/tools/vendor/github.com/mgechev/revive/rule/modifies_param.go @@ -29,7 +29,7 @@ func (*ModifiesParamRule) Apply(file *lint.File, _ lint.Arguments) []lint.Failur } w := lintModifiesParamRule{onFailure: onFailure} - ast.Walk(w, file.AST) + ast.Walk(&w, file.AST) return failures } @@ -57,13 +57,13 @@ func retrieveParamNames(pl []*ast.Field) map[string]bool { return result } -func (w lintModifiesParamRule) Visit(node ast.Node) ast.Visitor { +func (w *lintModifiesParamRule) Visit(node ast.Node) ast.Visitor { switch v := node.(type) { case *ast.FuncDecl: w.params = retrieveParamNames(v.Type.Params.List) case *ast.IncDecStmt: if id, ok := v.X.(*ast.Ident); ok { - checkParam(id, &w) + checkParam(id, w) } case *ast.AssignStmt: lhs := v.Lhs @@ -76,7 +76,7 @@ func (w lintModifiesParamRule) Visit(node ast.Node) ast.Visitor { if i < len(v.Rhs) { w.checkModifyingFunction(v.Rhs[i]) } - checkParam(id, &w) + checkParam(id, w) } case *ast.ExprStmt: w.checkModifyingFunction(v.X) diff --git a/tools/vendor/github.com/mgechev/revive/rule/package_directory_mismatch.go b/tools/vendor/github.com/mgechev/revive/rule/package_directory_mismatch.go index 717805473..ea8df9d1e 100644 --- a/tools/vendor/github.com/mgechev/revive/rule/package_directory_mismatch.go +++ b/tools/vendor/github.com/mgechev/revive/rule/package_directory_mismatch.go @@ -77,7 +77,7 @@ func (*PackageDirectoryMismatchRule) buildIgnoreRegex(ignoredDirs []string) (*re } // skipDirs contains directory names that should be unconditionally ignored when checking. -// These entries handle edge cases where filepath.Base might return these values. +// These entries handle edge cases where [filepath.Base] might return these values. var skipDirs = map[string]struct{}{ ".": {}, // Current directory "/": {}, // Root directory @@ -85,7 +85,7 @@ var skipDirs = map[string]struct{}{ } // semanticallyEqual checks if package and directory names are semantically equal to each other. -func (PackageDirectoryMismatchRule) semanticallyEqual(packageName, dirName string) bool { +func (*PackageDirectoryMismatchRule) semanticallyEqual(packageName, dirName string) bool { normDir := normalizePath(dirName) normPkg := normalizePath(packageName) return normDir == normPkg || normDir == "go"+normPkg diff --git a/tools/vendor/github.com/mgechev/revive/rule/redundant_test_main_exit.go b/tools/vendor/github.com/mgechev/revive/rule/redundant_test_main_exit.go index 717969ef6..cd1da59aa 100644 --- a/tools/vendor/github.com/mgechev/revive/rule/redundant_test_main_exit.go +++ b/tools/vendor/github.com/mgechev/revive/rule/redundant_test_main_exit.go @@ -65,6 +65,11 @@ func (w *lintRedundantTestMainExit) Visit(node ast.Node) ast.Visitor { } pkg := id.Name + // skip flag calls because they are commonly used in TestMain + if pkg == "flag" { + return w + } + fn := fc.Sel.Name if isCallToExitFunction(pkg, fn, ce.Args) { w.onFailure(lint.Failure{ diff --git a/tools/vendor/github.com/mgechev/revive/rule/string_format.go b/tools/vendor/github.com/mgechev/revive/rule/string_format.go index b653cb13e..4c7c86554 100644 --- a/tools/vendor/github.com/mgechev/revive/rule/string_format.go +++ b/tools/vendor/github.com/mgechev/revive/rule/string_format.go @@ -81,7 +81,7 @@ type stringFormatSubruleScope struct { field string // (optional) If the argument to be checked is a struct, which member of the struct is checked against the rule (top level members only) } -// Regex inserted to match valid function/struct field identifiers. +// identRegex matches valid function/struct field identifiers. const identRegex = "[_A-Za-z][_A-Za-z0-9]*" var parseStringFormatScope = regexp.MustCompile( @@ -165,17 +165,18 @@ func (r *StringFormatRule) parseArgument(argument any, ruleNum int) (scopes stri return scopes, regex, negated, errorMessage, nil } -// Report an invalid config, this is specifically the user's fault. +// configError reports an invalid config, this is specifically the user's fault. func (*StringFormatRule) configError(msg string, ruleNum, option int) error { return fmt.Errorf("invalid configuration for string-format: %s [argument %d, option %d]", msg, ruleNum, option) } -// Report a general config parsing failure, this may be the user's fault, but it isn't known for certain. +// parseError reports a general config parsing failure, this may be the user's fault, but it isn't known for certain. func (*StringFormatRule) parseError(msg string, ruleNum, option int) error { return fmt.Errorf("failed to parse configuration for string-format: %s [argument %d, option %d]", msg, ruleNum, option) } -// Report a general scope config parsing failure, this may be the user's fault, but it isn't known for certain. +// parseScopeError reports a general scope config parsing failure, this may be the user's fault, +// but it isn't known for certain. func (*StringFormatRule) parseScopeError(msg string, ruleNum, option, scopeNum int) error { return fmt.Errorf("failed to parse configuration for string-format: %s [argument %d, option %d, scope index %d]", msg, ruleNum, option, scopeNum) } @@ -204,7 +205,7 @@ func (w *lintStringFormatRule) Visit(node ast.Node) ast.Visitor { return w } -// Return the name of a call expression in the form of package.Func or Func. +// getCallName returns the name of a call expression in the form of package.Func or Func. func (*lintStringFormatRule) getCallName(call *ast.CallExpr) (callName string, ok bool) { if ident, ok := call.Fun.(*ast.Ident); ok { // Local function call @@ -227,7 +228,8 @@ func (*lintStringFormatRule) getCallName(call *ast.CallExpr) (callName string, o return "", false } -// apply a single format rule to a call expression (should be done after verifying the that the call expression matches the rule's scope). +// apply a single format rule to a call expression +// (should be done after verifying the that the call expression matches the rule's scope). func (r *stringFormatSubrule) apply(call *ast.CallExpr, scope *stringFormatSubruleScope) { if len(call.Args) <= scope.argument { return diff --git a/tools/vendor/github.com/mgechev/revive/rule/struct_tag.go b/tools/vendor/github.com/mgechev/revive/rule/struct_tag.go index 0830a257d..c245f51fc 100644 --- a/tools/vendor/github.com/mgechev/revive/rule/struct_tag.go +++ b/tools/vendor/github.com/mgechev/revive/rule/struct_tag.go @@ -71,7 +71,7 @@ type checkContext struct { isAtLeastGo124 bool } -func (checkCtx checkContext) isUserDefined(key tagKey, opt string) bool { +func (checkCtx *checkContext) isUserDefined(key tagKey, opt string) bool { if checkCtx.userDefined == nil { return false } @@ -105,11 +105,6 @@ func (r *StructTagRule) Configure(arguments lint.Arguments) error { return nil } - err := checkNumberOfArguments(1, arguments, r.Name()) - if err != nil { - return err - } - r.userDefined = map[tagKey][]string{} r.omittedTags = map[tagKey]struct{}{} for _, arg := range arguments { @@ -636,7 +631,7 @@ func checkTOMLTag(checkCtx *checkContext, tag *structtag.Tag, _ *ast.Field) (mes } func checkURLTag(checkCtx *checkContext, tag *structtag.Tag, _ *ast.Field) (message string, succeeded bool) { - var delimiter = "" + var delimiter string for _, opt := range tag.Options { switch opt { case "int", "omitempty", "numbered", "brackets", @@ -808,8 +803,7 @@ func (w lintStructTagRule) addFailuref(n ast.Node, msg string, args ...any) { } func areValidateOpts(opts string) (string, bool) { - parts := strings.Split(opts, "|") - for _, opt := range parts { + for opt := range strings.SplitSeq(opts, "|") { _, ok := validateSingleOptions[opt] if !ok { return opt, false @@ -1003,7 +997,7 @@ var validateSingleOptions = map[string]struct{}{ "validateFn": {}, } -// These are options that are used in expressions of the form: +// validateLHS are options that are used in expressions of the form: // //