2022-03-18 23:25:50 +02:00
|
|
|
run:
|
2024-08-18 21:08:55 +02:00
|
|
|
go: "1.23"
|
2023-06-05 19:47:54 +02:00
|
|
|
timeout: 5m
|
2019-10-10 13:42:31 +02:00
|
|
|
linters:
|
2020-12-29 17:40:21 +02:00
|
|
|
enable:
|
2024-05-12 18:21:13 +02:00
|
|
|
- copyloopvar
|
2020-12-29 17:40:21 +02:00
|
|
|
- thelper
|
2021-04-25 19:20:49 +02:00
|
|
|
- gofumpt
|
2024-05-12 18:17:31 +02:00
|
|
|
- bodyclose
|
2021-04-25 19:20:49 +02:00
|
|
|
- tparallel
|
|
|
|
- unconvert
|
|
|
|
- unparam
|
|
|
|
- wastedassign
|
2021-05-25 21:49:49 +02:00
|
|
|
- revive
|
2021-11-21 16:10:54 +02:00
|
|
|
- forbidigo
|
2021-11-23 15:18:09 +02:00
|
|
|
- tagliatelle
|
2022-04-14 03:39:59 +02:00
|
|
|
- misspell
|
2023-06-05 19:47:54 +02:00
|
|
|
- depguard
|
2023-12-17 20:34:28 +02:00
|
|
|
- testifylint
|
2024-02-17 20:34:22 +02:00
|
|
|
- gocritic
|
2024-05-12 19:11:11 +02:00
|
|
|
- nolintlint
|
2021-11-21 16:10:54 +02:00
|
|
|
linters-settings:
|
2024-05-13 15:05:12 +02:00
|
|
|
gocritic:
|
|
|
|
disabled-checks:
|
|
|
|
- appendAssign
|
2023-11-30 04:11:46 +02:00
|
|
|
staticcheck:
|
|
|
|
checks:
|
|
|
|
- all
|
|
|
|
- "-SA1019"
|
2021-11-21 16:10:54 +02:00
|
|
|
forbidigo:
|
|
|
|
forbid:
|
|
|
|
- 'ioutil\.*'
|
2021-11-23 15:18:09 +02:00
|
|
|
tagliatelle:
|
|
|
|
case:
|
|
|
|
use-field-name: false
|
|
|
|
rules:
|
|
|
|
yaml: snake
|
|
|
|
json: snake
|
2023-06-05 19:47:54 +02:00
|
|
|
depguard:
|
|
|
|
rules:
|
|
|
|
main:
|
|
|
|
deny:
|
|
|
|
- pkg: "github.com/pkg/errors"
|
|
|
|
desc: "use stdlib instead"
|
chore: fix all existing lint issues (#4637)
The PR fixes lint issues, pins `golangci-lint` to `v1.56.2`, disables
`only-new-issues`, and enables `fail-on-issues` in the lint workflow.
After this, all new lint issues will fail CI.
The full log of fixed lint issues:
```sh
❯ golangci-lint run
cmd/docs.go:24:14: unused-parameter: parameter 'cmd' seems to be unused, consider removing or renaming it as _ (revive)
RunE: func(cmd *cobra.Command, args []string) error {
^
cmd/man.go:26:14: unused-parameter: parameter 'cmd' seems to be unused, consider removing or renaming it as _ (revive)
RunE: func(cmd *cobra.Command, args []string) error {
^
cmd/healthcheck.go:36:14: unused-parameter: parameter 'cmd' seems to be unused, consider removing or renaming it as _ (revive)
RunE: func(cmd *cobra.Command, args []string) error {
^
cmd/build.go:72:33: unused-parameter: parameter 'cmd' seems to be unused, consider removing or renaming it as _ (revive)
RunE: timedRunE("build", func(cmd *cobra.Command, args []string) error {
^
cmd/schema.go:29:14: unused-parameter: parameter 'cmd' seems to be unused, consider removing or renaming it as _ (revive)
RunE: func(cmd *cobra.Command, args []string) error {
^
internal/pipe/nix/nix_test.go:547:5: error-is-as: second argument to require.ErrorAs should not be *error (testifylint)
require.ErrorAs(t, err, &tt.expectDefaultErrorIs)
^
internal/pipe/nix/nix_test.go:556:5: error-is-as: second argument to require.ErrorAs should not be *error (testifylint)
require.ErrorAs(t, err, &tt.expectRunErrorIs)
^
internal/pipe/nix/nix_test.go:567:5: error-is-as: second argument to require.ErrorAs should not be *error (testifylint)
require.ErrorAs(t, err, &tt.expectPublishErrorIs)
^
internal/pipe/winget/winget_test.go:709:5: error-is-as: second argument to require.ErrorAs should not be *error (testifylint)
require.ErrorAs(t, err, &tt.expectPublishErrorIs)
^
internal/pipe/winget/winget_test.go:728:5: error-is-as: second argument to require.ErrorAs should not be *error (testifylint)
require.ErrorAs(t, err, &tt.expectPublishErrorIs)
^
internal/pipe/docker/docker_test.go:56:29: unused-parameter: parameter 'use' seems to be unused, consider removing or renaming it as _ (revive)
return func(t *testing.T, use string) {
^
internal/gio/safe_test.go:23:4: go-require: require must only be used in the goroutine running the test function (testifylint)
require.Equal(t, 1, s)
^
internal/gio/safe_test.go:24:4: go-require: require must only be used in the goroutine running the test function (testifylint)
require.NoError(t, err)
^
internal/pipe/gomod/gomod_proxy_test.go:126:3: useless-assert: asserting of the same variable (testifylint)
require.Equal(t, ctx.ModulePath, ctx.ModulePath)
^
internal/pipe/gomod/gomod_proxy_test.go:152:3: useless-assert: asserting of the same variable (testifylint)
require.Equal(t, ctx.ModulePath, ctx.ModulePath)
^
internal/pipe/gomod/gomod_proxy_test.go:178:3: useless-assert: asserting of the same variable (testifylint)
require.Equal(t, ctx.ModulePath, ctx.ModulePath)
^
internal/pipe/gomod/gomod_proxy_test.go:239:3: useless-assert: asserting of the same variable (testifylint)
require.Equal(t, ctx.ModulePath, ctx.ModulePath)
^
internal/artifact/artifact_test.go:638:46: unused-parameter: parameter 'a' seems to be unused, consider removing or renaming it as _ (revive)
require.EqualError(t, artifacts.Visit(func(a *Artifact) error {
^
internal/pipe/milestone/milestone.go:79: File is not `gofumpt`-ed (gofumpt)
internal/http/http_test.go:217:19: unused-parameter: parameter 'k' seems to be unused, consider removing or renaming it as _ (revive)
assetOpen = func(k string, a *artifact.Artifact) (*asset, error) {
^
internal/middleware/logging/logging_test.go:12:37: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
require.NoError(t, Log("foo", func(ctx *context.Context) error {
^
internal/middleware/logging/logging_test.go:16:40: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
require.NoError(t, PadLog("foo", func(ctx *context.Context) error {
^
internal/pipe/chocolatey/chocolatey_test.go:277:15: unused-parameter: parameter 'cmd' seems to be unused, consider removing or renaming it as _ (revive)
exec: func(cmd string, args ...string) ([]byte, error) {
^
internal/client/gitlab.go:325: File is not `gofumpt`-ed (gofumpt)
internal/pipe/linkedin/client_test.go:58:77: unused-parameter: parameter 'req' seems to be unused, consider removing or renaming it as _ (revive)
server := httptest.NewServer(http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) {
^
internal/middleware/errhandler/error_test.go:15:34: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
require.NoError(t, Handle(func(ctx *context.Context) error {
^
internal/middleware/errhandler/error_test.go:21:34: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
require.NoError(t, Handle(func(ctx *context.Context) error {
^
internal/middleware/errhandler/error_test.go:27:32: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
require.Error(t, Handle(func(ctx *context.Context) error {
^
internal/middleware/errhandler/error_test.go:36:37: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
require.NoError(t, memo.Wrap(func(ctx *context.Context) error {
^
internal/middleware/errhandler/error_test.go:42:37: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
require.NoError(t, memo.Wrap(func(ctx *context.Context) error {
^
internal/middleware/errhandler/error_test.go:48:37: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
require.NoError(t, memo.Wrap(func(ctx *context.Context) error {
^
internal/pipe/ko/ko.go:175:29: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
build.WithBaseImages(func(ctx stdctx.Context, s string) (name.Reference, build.Result, error) {
^
```
2024-02-19 13:49:39 +02:00
|
|
|
testifylint:
|
|
|
|
enable-all: true
|
|
|
|
disable:
|
|
|
|
- error-is-as # false positive
|