Skip to content

Commit d8ba426

Browse files
🌱 Bump github.com/golangci/golangci-lint from 1.59.1 to 1.60.1 in /tools (#4301)
1 parent 07ff61e commit d8ba426

11 files changed

+102
-107
lines changed

checks/evaluation/branch_protection.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -371,33 +371,33 @@ func computeFinalScore(scores []levelScore) (int, error) {
371371
return int(score), nil
372372
}
373373

374-
func info(dl checker.DetailLogger, doLogging bool, desc string, args ...interface{}) {
374+
func info(dl checker.DetailLogger, doLogging bool, msg string) {
375375
if !doLogging {
376376
return
377377
}
378378

379379
dl.Info(&checker.LogMessage{
380-
Text: fmt.Sprintf(desc, args...),
380+
Text: msg,
381381
})
382382
}
383383

384-
func debug(dl checker.DetailLogger, doLogging bool, desc string, args ...interface{}) {
384+
func debug(dl checker.DetailLogger, doLogging bool, msg string) {
385385
if !doLogging {
386386
return
387387
}
388388

389389
dl.Debug(&checker.LogMessage{
390-
Text: fmt.Sprintf(desc, args...),
390+
Text: msg,
391391
})
392392
}
393393

394-
func warn(dl checker.DetailLogger, doLogging bool, desc string, args ...interface{}) {
394+
func warn(dl checker.DetailLogger, doLogging bool, msg string) {
395395
if !doLogging {
396396
return
397397
}
398398

399399
dl.Warn(&checker.LogMessage{
400-
Text: fmt.Sprintf(desc, args...),
400+
Text: msg,
401401
})
402402
}
403403

checks/raw/dangerous_workflow_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -171,15 +171,15 @@ func TestGithubDangerousWorkflow(t *testing.T) {
171171
dw, err := DangerousWorkflow(req)
172172

173173
if !errCmp(err, tt.expected.err) {
174-
t.Errorf(cmp.Diff(err, tt.expected.err, cmpopts.EquateErrors()))
174+
t.Error(cmp.Diff(err, tt.expected.err, cmpopts.EquateErrors()))
175175
}
176176
if tt.expected.err != nil {
177177
return
178178
}
179179

180180
nb := len(dw.Workflows)
181181
if nb != tt.expected.nb {
182-
t.Errorf(cmp.Diff(nb, tt.expected.nb))
182+
t.Error(cmp.Diff(nb, tt.expected.nb))
183183
}
184184
})
185185
}

checks/raw/pinned_dependencies_test.go

+11-11
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ func TestGithubWorkflowPinning(t *testing.T) {
9696

9797
_, err = validateGitHubActionWorkflow(p, content, &r)
9898
if !errCmp(err, tt.err) {
99-
t.Errorf(cmp.Diff(err, tt.err, cmpopts.EquateErrors()))
99+
t.Error(cmp.Diff(err, tt.err, cmpopts.EquateErrors()))
100100
}
101101

102102
if err != nil {
@@ -251,7 +251,7 @@ func TestNonGithubWorkflowPinning(t *testing.T) {
251251

252252
_, err = validateGitHubActionWorkflow(p, content, &r)
253253
if !errCmp(err, tt.err) {
254-
t.Errorf(cmp.Diff(err, tt.err, cmpopts.EquateErrors()))
254+
t.Error(cmp.Diff(err, tt.err, cmpopts.EquateErrors()))
255255
}
256256

257257
if err != nil {
@@ -307,7 +307,7 @@ func TestGithubWorkflowPkgManagerPinning(t *testing.T) {
307307

308308
_, err = validateGitHubWorkflowIsFreeOfInsecureDownloads(p, content, &r)
309309
if !errCmp(err, tt.err) {
310-
t.Errorf(cmp.Diff(err, tt.err, cmpopts.EquateErrors()))
310+
t.Error(cmp.Diff(err, tt.err, cmpopts.EquateErrors()))
311311
}
312312

313313
if err != nil {
@@ -400,7 +400,7 @@ func TestDockerfilePinning(t *testing.T) {
400400
var r checker.PinningDependenciesData
401401
_, err = validateDockerfilesPinning(filepath.Join("testdata", tt.filename), content, &r)
402402
if !errCmp(err, tt.err) {
403-
t.Errorf(cmp.Diff(err, tt.err, cmpopts.EquateErrors()))
403+
t.Error(cmp.Diff(err, tt.err, cmpopts.EquateErrors()))
404404
}
405405

406406
if err != nil {
@@ -727,7 +727,7 @@ func TestDockerfileInsecureDownloadsBrokenCommands(t *testing.T) {
727727
var r checker.PinningDependenciesData
728728
_, err = validateDockerfileInsecureDownloads(tt.filename, content, &r)
729729
if !strings.Contains(err.Error(), tt.err.Error()) {
730-
t.Errorf(cmp.Diff(err, tt.err, cmpopts.EquateErrors()))
730+
t.Error(cmp.Diff(err, tt.err, cmpopts.EquateErrors()))
731731
}
732732
})
733733
}
@@ -1329,7 +1329,7 @@ func TestDockerfilePinningWithoutHash(t *testing.T) {
13291329
var r checker.PinningDependenciesData
13301330
_, err = validateDockerfilesPinning(tt.filename, content, &r)
13311331
if !errCmp(err, tt.err) {
1332-
t.Errorf(cmp.Diff(err, tt.err, cmpopts.EquateErrors()))
1332+
t.Error(cmp.Diff(err, tt.err, cmpopts.EquateErrors()))
13331333
}
13341334

13351335
if err != nil {
@@ -1441,7 +1441,7 @@ func TestDockerfileScriptDownload(t *testing.T) {
14411441
var r checker.PinningDependenciesData
14421442
_, err = validateDockerfileInsecureDownloads(tt.filename, content, &r)
14431443
if !errCmp(err, tt.err) {
1444-
t.Errorf(cmp.Diff(err, tt.err, cmpopts.EquateErrors()))
1444+
t.Error(cmp.Diff(err, tt.err, cmpopts.EquateErrors()))
14451445
}
14461446

14471447
if err != nil {
@@ -1495,7 +1495,7 @@ func TestDockerfileScriptDownloadInfo(t *testing.T) {
14951495
var r checker.PinningDependenciesData
14961496
_, err = validateDockerfileInsecureDownloads(tt.filename, content, &r)
14971497
if !errCmp(err, tt.err) {
1498-
t.Errorf(cmp.Diff(err, tt.err, cmpopts.EquateErrors()))
1498+
t.Error(cmp.Diff(err, tt.err, cmpopts.EquateErrors()))
14991499
}
15001500

15011501
if err != nil {
@@ -1578,7 +1578,7 @@ func TestShellScriptDownload(t *testing.T) {
15781578
_, err = validateShellScriptIsFreeOfInsecureDownloads(tt.filename, content, &r)
15791579

15801580
if !errCmp(err, tt.err) {
1581-
t.Errorf(cmp.Diff(err, tt.err, cmpopts.EquateErrors()))
1581+
t.Error(cmp.Diff(err, tt.err, cmpopts.EquateErrors()))
15821582
}
15831583

15841584
if err != nil {
@@ -1632,7 +1632,7 @@ func TestShellScriptDownloadPinned(t *testing.T) {
16321632
_, err = validateShellScriptIsFreeOfInsecureDownloads(tt.filename, content, &r)
16331633

16341634
if !errCmp(err, tt.err) {
1635-
t.Errorf(cmp.Diff(err, tt.err, cmpopts.EquateErrors()))
1635+
t.Error(cmp.Diff(err, tt.err, cmpopts.EquateErrors()))
16361636
}
16371637

16381638
if err != nil {
@@ -1700,7 +1700,7 @@ func TestGitHubWorkflowRunDownload(t *testing.T) {
17001700

17011701
_, err = validateGitHubWorkflowIsFreeOfInsecureDownloads(p, content, &r)
17021702
if !errCmp(err, tt.err) {
1703-
t.Errorf(cmp.Diff(err, tt.err, cmpopts.EquateErrors()))
1703+
t.Error(cmp.Diff(err, tt.err, cmpopts.EquateErrors()))
17041704
}
17051705

17061706
if err != nil {

cron/internal/format/json_raw_results.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ func addDependencyUpdateToolRawResults(r *jsonScorecardRawResult,
189189
URL: t.URL,
190190
Desc: t.Desc,
191191
}
192-
if t.Files != nil && len(t.Files) > 0 {
192+
if len(t.Files) > 0 {
193193
for _, f := range t.Files {
194194
jt.Files = append(jt.Files, jsonFile{
195195
Path: f.Path,

cron/internal/format/schema_gen_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ func Test_GenerateBQSchema(t *testing.T) {
7474
}
7575

7676
if !cmp.Equal(result, expected.String()) {
77-
t.Errorf(cmp.Diff(result, expected.String()))
77+
t.Error(cmp.Diff(result, expected.String()))
7878
}
7979
})
8080
}
@@ -129,7 +129,7 @@ func Test_GenerateJSONSchema(t *testing.T) {
129129
result := GenerateJSONSchema(tt.structure)
130130

131131
if !cmp.Equal(result, expected.String()) {
132-
t.Errorf(cmp.Diff(result, expected.String()))
132+
t.Error(cmp.Diff(result, expected.String()))
133133
}
134134
})
135135
}

finding/finding_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ func Test_FromBytes(t *testing.T) {
167167

168168
content, err := os.ReadFile(tt.path)
169169
if err != nil {
170-
t.Fatalf(err.Error())
170+
t.Fatal(err.Error())
171171
}
172172

173173
r, err := FromBytes(content, tt.id)

finding/probe_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ func Test_probeFromBytes(t *testing.T) {
110110

111111
content, err := os.ReadFile(tt.path)
112112
if err != nil {
113-
t.Fatalf(err.Error())
113+
t.Fatal(err.Error())
114114
}
115115

116116
r, err := probeFromBytes(content, tt.id)

pkg/scorecard/json_raw_results_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1280,7 +1280,7 @@ func TestScorecardResult_AsRawJSON(t *testing.T) {
12801280
return
12811281
}
12821282
if gotWriter := writer.String(); gotWriter != tt.wantWriter {
1283-
t.Errorf(cmp.Diff(gotWriter, tt.wantWriter))
1283+
t.Error(cmp.Diff(gotWriter, tt.wantWriter))
12841284
}
12851285
})
12861286
}

remediation/remediations_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ func TestCreateDockerfilePinningRemediation(t *testing.T) {
133133
t.Parallel()
134134
got := CreateDockerfilePinningRemediation(&tt.dep, stubDigester{})
135135
if !cmp.Equal(got, tt.expected) {
136-
t.Errorf(cmp.Diff(got, tt.expected))
136+
t.Error(cmp.Diff(got, tt.expected))
137137
}
138138
})
139139
}
@@ -185,7 +185,7 @@ func TestCreateWorkflowPinningRemediation(t *testing.T) {
185185
}
186186
got := r.CreateWorkflowPinningRemediation(tt.filepath)
187187
if !cmp.Equal(got, tt.expected) {
188-
t.Errorf(cmp.Diff(got, tt.expected))
188+
t.Error(cmp.Diff(got, tt.expected))
189189
}
190190
})
191191
}

0 commit comments

Comments
 (0)