Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): update dependency golangci/golangci-lint to v1.58.0 #2847

Merged
merged 3 commits into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ linters:
- 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.
- ifshort # WARN [runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner.
- 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.
- 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
24 changes: 12 additions & 12 deletions aqua/aqua-checksums.json
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
{
"checksums": [
{
"id": "github_release/github.com/golangci/golangci-lint/v1.57.2/golangci-lint-1.57.2-darwin-amd64.tar.gz",
"checksum": "83157F5378D259D51C88E310E88513BD80BD42E497974A1BBE51B82931F229C7",
"id": "github_release/github.com/golangci/golangci-lint/v1.58.0/golangci-lint-1.58.0-darwin-amd64.tar.gz",
"checksum": "53FD0E562119D7190F7AFA0E4AE054C4B3BF7B0BA104C51D0558EDCEAE83688A",
"algorithm": "sha256"
},
{
"id": "github_release/github.com/golangci/golangci-lint/v1.57.2/golangci-lint-1.57.2-darwin-arm64.tar.gz",
"checksum": "0D6F10544FC0B5BD94B9EEB20D89646B9C19B52A98DCA1CA62F94C08AC641B98",
"id": "github_release/github.com/golangci/golangci-lint/v1.58.0/golangci-lint-1.58.0-darwin-arm64.tar.gz",
"checksum": "7338B4371045D5618FE2B6C2258CCD6EA14FB9822065D4FE48FF40B13DBA1029",
"algorithm": "sha256"
},
{
"id": "github_release/github.com/golangci/golangci-lint/v1.57.2/golangci-lint-1.57.2-linux-amd64.tar.gz",
"checksum": "391483DAA5D58D037832BA2FAC709FDB5DF0C67471C0D7698D1F67CBFA5F10F0",
"id": "github_release/github.com/golangci/golangci-lint/v1.58.0/golangci-lint-1.58.0-linux-amd64.tar.gz",
"checksum": "2E6AB34A3B0B8D35DC49D8E4E84D37CE631F55FCC549B944B0CC14F7F276971C",
"algorithm": "sha256"
},
{
"id": "github_release/github.com/golangci/golangci-lint/v1.57.2/golangci-lint-1.57.2-linux-arm64.tar.gz",
"checksum": "9E079E19B3D81E357D2ACC90518C6A86A533E26A74AF1E5EADF8DFCD640B66EE",
"id": "github_release/github.com/golangci/golangci-lint/v1.58.0/golangci-lint-1.58.0-linux-arm64.tar.gz",
"checksum": "32E5B3DD259F1ECABD5C4997CABAC9B01E120366CFFD67811EAC9F1955899F8F",
"algorithm": "sha256"
},
{
"id": "github_release/github.com/golangci/golangci-lint/v1.57.2/golangci-lint-1.57.2-windows-amd64.zip",
"checksum": "10C1AB7EB4A99F8B292A8F910BC78A50E9547A4FFE7444FCDDC68F722ADF6612",
"id": "github_release/github.com/golangci/golangci-lint/v1.58.0/golangci-lint-1.58.0-windows-amd64.zip",
"checksum": "245E9BC6F4878414ED0E4CC53CB94BD441CF0BE7E18CBF84D409CC9AC61AB901",
"algorithm": "sha256"
},
{
"id": "github_release/github.com/golangci/golangci-lint/v1.57.2/golangci-lint-1.57.2-windows-arm64.zip",
"checksum": "F88AC03FAA185DA6547BEAB8A91983DB2767E2E154323518F592F7E24772CA9E",
"id": "github_release/github.com/golangci/golangci-lint/v1.58.0/golangci-lint-1.58.0-windows-arm64.zip",
"checksum": "5F629A5D0FB6F9A1ABCFDE89CE1EAA8CD69F79F51B0A14A6A8B6AA1D9236F755",
"algorithm": "sha256"
},
{
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.0
2 changes: 1 addition & 1 deletion cmd/gen-jsonschema/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func gen(input interface{}, p string) error {
if err != nil {
return fmt.Errorf("mashal schema as JSON: %w", err)
}
if err := os.WriteFile(p, []byte(strings.ReplaceAll(string(b), "http://json-schema.org", "https://json-schema.org")+"\n"), 0o644); err != nil { //nolint:gosec,gomnd
if err := os.WriteFile(p, []byte(strings.ReplaceAll(string(b), "http://json-schema.org", "https://json-schema.org")+"\n"), 0o644); err != nil { //nolint:gosec,mnd
return fmt.Errorf("write JSON Schema to %s: %w", p, err)
}
return nil
Expand Down
2 changes: 1 addition & 1 deletion pkg/asset/arch.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,6 @@ func SetArch(assetName, lowAssetName string, assetInfo *AssetInfo) {
}
if assetInfo.Arch == "" {
assetInfo.Arch = "amd64"
assetInfo.Score = -2 //nolint:gomnd
assetInfo.Score = -2 //nolint:mnd
}
}
2 changes: 1 addition & 1 deletion pkg/asset/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ func ParseAssetInfos(pkgInfo *registry.PackageInfo, assetInfos []*AssetInfo) { /
}
}
}
if len(overrides) == 2 { //nolint:gomnd
if len(overrides) == 2 { //nolint:mnd
// amd64, arm64
supportedEnvs = []string{goos}
asset1 := overrides[0]
Expand Down
4 changes: 2 additions & 2 deletions pkg/cargo/versions.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func getCrate(ctx context.Context, client *http.Client, uri string) (*CratePaylo
return nil, 0, fmt.Errorf("send a HTTP request: %w", err)
}
defer resp.Body.Close()
if resp.StatusCode >= 300 { //nolint:gomnd
if resp.StatusCode >= 300 { //nolint:mnd
return nil, resp.StatusCode, errors.ErrHTTPStatusCodeIsGreaterEqualThan300
}
payload := &CratePayload{}
Expand All @@ -92,7 +92,7 @@ func listInstallableVersions(ctx context.Context, client *http.Client, uri strin
return nil, 0, fmt.Errorf("send a HTTP request: %w", err)
}
defer resp.Body.Close()
if resp.StatusCode >= 300 { //nolint:gomnd
if resp.StatusCode >= 300 { //nolint:mnd
return nil, resp.StatusCode, errors.ErrHTTPStatusCodeIsGreaterEqualThan300
}
payload := &Payload{}
Expand Down
2 changes: 1 addition & 1 deletion pkg/checksum/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
)

func showFileContent(logE *logrus.Entry, content string) {
if len(content) > 10000 { //nolint:gomnd
if len(content) > 10000 { //nolint:mnd
content = content[:10000]
logE.Error("Checksum isn't found in a checksum file. Checksum file content (10000):\n" + content)
return
Expand Down
4 changes: 2 additions & 2 deletions pkg/controller/exec/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func (c *Controller) install(ctx context.Context, logE *logrus.Entry, findResult
logE.WithFields(logrus.Fields{
"retry_count": i + 1,
}).Debug("command isn't found. wait for lazy install")
if err := wait(ctx, 10*time.Millisecond); err != nil { //nolint:gomnd
if err := wait(ctx, 10*time.Millisecond); err != nil { //nolint:mnd
return err
}
}
Expand Down Expand Up @@ -147,7 +147,7 @@ func (c *Controller) execCommandWithRetry(ctx context.Context, logE *logrus.Entr
return err
}
logE.WithError(err).WithField("retry_count", i+1).Debug("the process isn't started. retry")
if err := wait(ctx, 10*time.Millisecond); err != nil { //nolint:gomnd
if err := wait(ctx, 10*time.Millisecond); err != nil { //nolint:mnd
return err
}
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/controller/generate-registry/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func (c *Controller) getPackageInfo(ctx context.Context, logE *logrus.Entry, arg
pkgInfo.Name = pkgName
return pkgInfo, nil
}
if len(splitPkgNames) != 2 { //nolint:gomnd
if len(splitPkgNames) != 2 { //nolint:mnd
pkgInfo.Name = pkgName
}
pkgInfo.RepoOwner = splitPkgNames[0]
Expand Down Expand Up @@ -201,7 +201,7 @@ func (c *Controller) patchRelease(logE *logrus.Entry, pkgInfo *registry.PackageI

func (c *Controller) listReleaseAssets(ctx context.Context, logE *logrus.Entry, 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
2 changes: 1 addition & 1 deletion pkg/controller/generate-registry/version_overrides.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func (c *Controller) listReleases(ctx context.Context, logE *logrus.Entry, pkgIn
repoOwner := pkgInfo.RepoOwner
repoName := pkgInfo.RepoName
opt := &github.ListOptions{
PerPage: 100, //nolint:gomnd
PerPage: 100, //nolint:mnd
}

if limit != 0 && limit < 100 {
Expand Down
4 changes: 2 additions & 2 deletions pkg/cosign/verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ func (v *Verifier) exec(ctx context.Context, args []string) (string, error) {

func wait(ctx context.Context, logE *logrus.Entry, retryCount int) error {
randGenerator := rand.New(rand.NewSource(time.Now().UnixNano())) //nolint:gosec
waitTime := time.Duration(randGenerator.Intn(1000)) * time.Millisecond //nolint:gomnd
waitTime := time.Duration(randGenerator.Intn(1000)) * time.Millisecond //nolint:mnd
logE.WithFields(logrus.Fields{
"retry_count": retryCount,
"wait_time": waitTime,
Expand All @@ -170,7 +170,7 @@ func (v *Verifier) verify(ctx context.Context, logE *logrus.Entry, param *ParamV
if _, err := v.exec(ctx, args); err == nil {
return nil
}
if i == 4 { //nolint:gomnd
if i == 4 { //nolint:mnd
// skip last wait
break
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/download/github_archive.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func (dl *Downloader) getReadCloserFromGitHubArchive(ctx context.Context, file *
}
u, _, err := dl.github.GetArchiveLink(ctx, file.RepoOwner, file.RepoName, github.Tarball, &github.RepositoryContentGetOptions{
Ref: file.Version,
}, 2) //nolint:gomnd
}, 2) //nolint:mnd
if err != nil {
return nil, 0, fmt.Errorf("git an archive link with GitHub API: %w", err)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/fuzzyfinder/package.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func (p *Package) Preview(w int) string {
return fmt.Sprintf("%s\n\n%s\n%s",
p.PackageInfo.GetName(),
p.PackageInfo.GetLink(),
formatPreview(p.PackageInfo.Description, w/2-8)) //nolint:gomnd
formatPreview(p.PackageInfo.Description, w/2-8)) //nolint:mnd
}

func (p *Package) Item() string {
Expand Down
2 changes: 1 addition & 1 deletion pkg/fuzzyfinder/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func (v *Version) Preview(w int) string {
s += "\n" + v.URL
}
if v.URL != "" {
s += "\n" + formatPreview(v.Description, w/2-8) //nolint:gomnd
s += "\n" + formatPreview(v.Description, w/2-8) //nolint:mnd
}
return s
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/installpackage/check_file.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func (is *Installer) checkFilesWrap(ctx context.Context, logE *logrus.Entry, par
if err != nil {
logerr.WithError(logE, err).Warn("traverse the content of unarchived package")
} else {
if len(paths) > 30 { //nolint:gomnd
if len(paths) > 30 { //nolint:mnd
logE.Errorf("executable files aren't found\nFiles in the unarchived package (Only 30 files are shown):\n%s\n ", strings.Join(paths[:30], "\n"))
} else {
logE.Errorf("executable files aren't found\nFiles in the unarchived package:\n%s\n ", strings.Join(paths, "\n"))
Expand Down
2 changes: 1 addition & 1 deletion pkg/installpackage/wait_exe.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func (is *Installer) WaitExe(ctx context.Context, logE *logrus.Entry, exePath st
logE.WithFields(logrus.Fields{
"retry_count": i + 1,
}).Debug("command isn't found. wait for lazy install")
if err := timer.Wait(ctx, 10*time.Millisecond); err != nil { //nolint:gomnd
if err := timer.Wait(ctx, 10*time.Millisecond); err != nil { //nolint:mnd
return fmt.Errorf("wait: %w", logerr.WithFields(err, logE.Data))
}
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/slsa/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func NewExecutor(executor CommandExecutor, param *config.Param) *ExecutorImpl {

func wait(ctx context.Context, logE *logrus.Entry, retryCount int) error {
randGenerator := rand.New(rand.NewSource(time.Now().UnixNano())) //nolint:gosec
waitTime := time.Duration(randGenerator.Intn(1000)) * time.Millisecond //nolint:gomnd
waitTime := time.Duration(randGenerator.Intn(1000)) * time.Millisecond //nolint:mnd
logE.WithFields(logrus.Fields{
"retry_count": retryCount,
"wait_time": waitTime,
Expand Down Expand Up @@ -76,7 +76,7 @@ func (e *ExecutorImpl) Verify(ctx context.Context, logE *logrus.Entry, param *Pa
if _, err := e.exec(ctx, args); err == nil {
return nil
}
if i == 4 { //nolint:gomnd
if i == 4 { //nolint:mnd
break
}
if err := wait(ctx, logE, i+1); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/versiongetter/github_release.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func (g *GitHubReleaseVersionGetter) Get(ctx context.Context, logE *logrus.Entry
candidates := []*Release{}

opt := &github.ListOptions{
PerPage: 30, //nolint:gomnd
PerPage: 30, //nolint:mnd
}
for {
releases, resp, err := g.gh.ListReleases(ctx, repoOwner, repoName, opt)
Expand Down
2 changes: 1 addition & 1 deletion pkg/versiongetter/github_tag.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func (g *GitHubTagVersionGetter) Get(ctx context.Context, logE *logrus.Entry, pk
repoOwner := pkg.RepoOwner
repoName := pkg.RepoName
opt := &github.ListOptions{
PerPage: 30, //nolint:gomnd
PerPage: 30, //nolint:mnd
}

var respToLog *github.Response
Expand Down