Skip to content

Commit

Permalink
chore(deps): update dependency golangci/golangci-lint to v1.58.1 (#694)
Browse files Browse the repository at this point in the history
* chore(deps): update dependency golangci/golangci-lint to v1.58.1

* fix: fix lint errors

* style: format by prettier

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Shunsuke Suzuki <[email protected]>
  • Loading branch information
renovate[bot] and suzuki-shunsuke authored May 12, 2024
1 parent 0139c12 commit da2fe2a
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 12 deletions.
4 changes: 3 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion aqua/imports/golangci-lint.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
packages:
- name: golangci/golangci-lint@v1.57.2
- name: golangci/golangci-lint@v1.58.1
8 changes: 4 additions & 4 deletions pkg/checkrepo/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
})
Expand Down Expand Up @@ -136,7 +136,7 @@ func getRepoFromLocation(location string) (string, string, error) {

// /<repo_owner>/<repo_name>
b := strings.Split(location, "/")
if len(b) != 3 { //nolint:gomnd
if len(b) != 3 { //nolint:mnd
return "", "", errors.New("location path format must be /<repo_owner>/<repo_name>")
}
return b[1], b[2], nil
Expand Down
2 changes: 1 addition & 1 deletion pkg/cli/mv.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pkg/create-pr-new-pkg/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:/%s): %s`, pkgName, repo, desc)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/mv/package_ast.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pkg/mv/registry_ast.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions pkg/patchchecksum/patch.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit da2fe2a

Please sign in to comment.