diff --git a/.golangci.yml b/.golangci.yml index 1ffc195..3d44da7 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -11,8 +11,10 @@ linters: - varcheck # WARN [runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused. - deadcode # WARN [runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused. - structcheck # WARN [runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused. + - goerr113 # WARN [lintersdb] The name "goerr113" is deprecated. The linter has been renamed to: err113. + - gomnd # WARN The linter 'gomnd' is deprecated (since v1.58.0) due to: The linter has been renamed. Replaced by mnd. + - execinquery # WARN The linter 'execinquery' is deprecated (since v1.58.0) due to: The repository of the linter has been archived by the owner. - wsl - - goerr113 - lll - godot - nlreturn diff --git a/aqua/imports/golangci-lint.yaml b/aqua/imports/golangci-lint.yaml index 096f739..b466aff 100644 --- a/aqua/imports/golangci-lint.yaml +++ b/aqua/imports/golangci-lint.yaml @@ -1,2 +1,2 @@ packages: - - name: golangci/golangci-lint@v1.57.2 + - name: golangci/golangci-lint@v1.58.1 diff --git a/pkg/checkrepo/handler.go b/pkg/checkrepo/handler.go index 88a250f..87ff5c2 100644 --- a/pkg/checkrepo/handler.go +++ b/pkg/checkrepo/handler.go @@ -77,15 +77,15 @@ func CheckRedirect(ctx context.Context, afs afero.Fs, httpClient *http.Client, p } defer resp.Body.Close() - if resp.StatusCode < 300 { //nolint:gomnd + if resp.StatusCode < 300 { //nolint:mnd return nil, nil //nolint:nilnil } - if resp.StatusCode >= 500 { //nolint:gomnd + if resp.StatusCode >= 500 { //nolint:mnd return nil, logerr.WithFields(errors.New("http status code >= 500"), logrus.Fields{ //nolint:wrapcheck "http_status_code": resp.StatusCode, }) } - if resp.StatusCode >= 400 { //nolint:gomnd + if resp.StatusCode >= 400 { //nolint:mnd return nil, logerr.WithFields(errors.New("http status code >= 400"), logrus.Fields{ //nolint:wrapcheck "http_status_code": resp.StatusCode, }) @@ -136,7 +136,7 @@ func getRepoFromLocation(location string) (string, string, error) { // // b := strings.Split(location, "/") - if len(b) != 3 { //nolint:gomnd + if len(b) != 3 { //nolint:mnd return "", "", errors.New("location path format must be //") } return b[1], b[2], nil diff --git a/pkg/cli/mv.go b/pkg/cli/mv.go index c5e6231..b903ff6 100644 --- a/pkg/cli/mv.go +++ b/pkg/cli/mv.go @@ -20,7 +20,7 @@ func (runner *Runner) newMVCommand() *cli.Command { func (runner *Runner) moveAction(c *cli.Context) error { args := c.Args().Slice() - if len(args) != 2 { //nolint:gomnd + if len(args) != 2 { //nolint:mnd return errors.New("invalid arguments") } return mv.Move(c.Context, afero.NewOsFs(), args[0], args[1]) //nolint:wrapcheck diff --git a/pkg/create-pr-new-pkg/api.go b/pkg/create-pr-new-pkg/api.go index 60545a9..640325c 100644 --- a/pkg/create-pr-new-pkg/api.go +++ b/pkg/create-pr-new-pkg/api.go @@ -95,7 +95,7 @@ func getDesc(rgFile io.Reader) (string, error) { func getBody(pkgName, desc string) string { pkg := strings.Split(pkgName, "/") - if len(pkg) >= 2 { //nolint:gomnd + if len(pkg) >= 2 { //nolint:mnd repo := pkg[0] + "/" + pkg[1] return fmt.Sprintf(`[%s](https://github.com/%s): %s`, pkgName, repo, desc) } diff --git a/pkg/mv/package_ast.go b/pkg/mv/package_ast.go index 0e91a80..d8613d2 100644 --- a/pkg/mv/package_ast.go +++ b/pkg/mv/package_ast.go @@ -39,7 +39,7 @@ func editPackageYAML(afs afero.Fs, pkgYAMLPath string, oldPackageName, newPackag if !updated { return nil } - if err := afero.WriteFile(afs, pkgYAMLPath, []byte(file.String()), 0o644); err != nil { //nolint:gomnd + if err := afero.WriteFile(afs, pkgYAMLPath, []byte(file.String()), 0o644); err != nil { //nolint:mnd return fmt.Errorf("write registry.yaml: %w", err) } return nil diff --git a/pkg/mv/registry_ast.go b/pkg/mv/registry_ast.go index 4f98175..12d9aa6 100644 --- a/pkg/mv/registry_ast.go +++ b/pkg/mv/registry_ast.go @@ -55,7 +55,7 @@ func editRegistry(afs afero.Fs, newRegistryYAMLPath, oldPackageName, newPackageN up = true } if up { - if err := afero.WriteFile(afs, newRegistryYAMLPath, []byte(file.String()), 0o644); err != nil { //nolint:gomnd + if err := afero.WriteFile(afs, newRegistryYAMLPath, []byte(file.String()), 0o644); err != nil { //nolint:mnd return fmt.Errorf("write registry.yaml: %w", err) } return nil diff --git a/pkg/patchchecksum/patch.go b/pkg/patchchecksum/patch.go index f1b0360..af05bf9 100644 --- a/pkg/patchchecksum/patch.go +++ b/pkg/patchchecksum/patch.go @@ -52,7 +52,7 @@ func PatchChecksum(ctx context.Context, logE *logrus.Entry, configFilePath strin }).WithError(err).Error("patch a checksum config") } } - if err := os.WriteFile(configFilePath, []byte(file.String()+"\n"), 0o644); err != nil { //nolint:gosec,gomnd + if err := os.WriteFile(configFilePath, []byte(file.String()+"\n"), 0o644); err != nil { //nolint:gosec,mnd return fmt.Errorf("write the configuration file: %w", err) } return nil @@ -146,7 +146,7 @@ func patchChecksumOfPkg(ctx context.Context, logE *logrus.Entry, ghClient GitHub func listReleaseAssets(ctx context.Context, logE *logrus.Entry, ghClient GitHubClient, pkgInfo *registry.PackageInfo, releaseID int64) []*github.ReleaseAsset { opts := &github.ListOptions{ - PerPage: 100, //nolint:gomnd + PerPage: 100, //nolint:mnd } var arr []*github.ReleaseAsset for range 10 {