@@ -18,7 +18,7 @@ func TestSeverity_multiple(t *testing.T) {
18
18
files := fsutils .NewFiles (lineCache , "" )
19
19
log := logutils .NewStderrLog (logutils .DebugKeyEmpty )
20
20
21
- opts := SeverityOptions {
21
+ opts := & config. Severity {
22
22
Default : "error" ,
23
23
Rules : []config.SeverityRule {
24
24
{
@@ -134,7 +134,7 @@ func TestSeverity_pathPrefix(t *testing.T) {
134
134
files := fsutils .NewFiles (lineCache , pathPrefix )
135
135
log := logutils .NewStderrLog (logutils .DebugKeyEmpty )
136
136
137
- opts := SeverityOptions {
137
+ opts := & config. Severity {
138
138
Default : "error" ,
139
139
Rules : []config.SeverityRule {
140
140
{
@@ -181,7 +181,7 @@ func TestSeverity_pathPrefix(t *testing.T) {
181
181
}
182
182
183
183
func TestSeverity_text (t * testing.T ) {
184
- opts := SeverityOptions {
184
+ opts := & config. Severity {
185
185
Rules : []config.SeverityRule {
186
186
{
187
187
BaseRule : config.BaseRule {
@@ -219,12 +219,12 @@ func TestSeverity_onlyDefault(t *testing.T) {
219
219
files := fsutils .NewFiles (lineCache , "" )
220
220
log := logutils .NewStderrLog (logutils .DebugKeyEmpty )
221
221
222
- opts := SeverityOptions {
222
+ opts := config. Severity {
223
223
Default : "info" ,
224
224
Rules : []config.SeverityRule {},
225
225
}
226
226
227
- p := NewSeverity (log , files , opts )
227
+ p := NewSeverity (log , files , & opts )
228
228
229
229
cases := []issueTestCase {
230
230
{Path : "ssl.go" , Text : "ssl" , Linter : "gosec" },
@@ -258,7 +258,7 @@ func TestSeverity_onlyDefault(t *testing.T) {
258
258
}
259
259
260
260
func TestSeverity_empty (t * testing.T ) {
261
- p := NewSeverity (nil , nil , SeverityOptions {})
261
+ p := NewSeverity (nil , nil , & config. Severity {})
262
262
263
263
processAssertSame (t , p , newIssueFromTextTestCase ("test" ))
264
264
}
@@ -267,7 +267,7 @@ func TestSeverity_caseSensitive(t *testing.T) {
267
267
lineCache := fsutils .NewLineCache (fsutils .NewFileCache ())
268
268
files := fsutils .NewFiles (lineCache , "" )
269
269
270
- opts := SeverityOptions {
270
+ opts := & config. Severity {
271
271
Default : "error" ,
272
272
Rules : []config.SeverityRule {
273
273
{
@@ -318,13 +318,13 @@ func TestSeverity_transform(t *testing.T) {
318
318
319
319
testCases := []struct {
320
320
desc string
321
- opts SeverityOptions
321
+ opts * config. Severity
322
322
issue * result.Issue
323
323
expected * result.Issue
324
324
}{
325
325
{
326
326
desc : "apply severity from rule" ,
327
- opts : SeverityOptions {
327
+ opts : & config. Severity {
328
328
Default : "error" ,
329
329
Rules : []config.SeverityRule {
330
330
{
@@ -347,7 +347,7 @@ func TestSeverity_transform(t *testing.T) {
347
347
},
348
348
{
349
349
desc : "apply severity from default" ,
350
- opts : SeverityOptions {
350
+ opts : & config. Severity {
351
351
Default : "error" ,
352
352
Rules : []config.SeverityRule {
353
353
{
@@ -370,7 +370,7 @@ func TestSeverity_transform(t *testing.T) {
370
370
},
371
371
{
372
372
desc : "severity from rule override severity from linter" ,
373
- opts : SeverityOptions {
373
+ opts : & config. Severity {
374
374
Default : "error" ,
375
375
Rules : []config.SeverityRule {
376
376
{
@@ -394,7 +394,7 @@ func TestSeverity_transform(t *testing.T) {
394
394
},
395
395
{
396
396
desc : "severity from default override severity from linter" ,
397
- opts : SeverityOptions {
397
+ opts : & config. Severity {
398
398
Default : "error" ,
399
399
Rules : []config.SeverityRule {
400
400
{
@@ -418,7 +418,7 @@ func TestSeverity_transform(t *testing.T) {
418
418
},
419
419
{
420
420
desc : "keep severity from linter as rule" ,
421
- opts : SeverityOptions {
421
+ opts : & config. Severity {
422
422
Default : "error" ,
423
423
Rules : []config.SeverityRule {
424
424
{
@@ -442,7 +442,7 @@ func TestSeverity_transform(t *testing.T) {
442
442
},
443
443
{
444
444
desc : "keep severity from linter as default" ,
445
- opts : SeverityOptions {
445
+ opts : & config. Severity {
446
446
Default : severityFromLinter ,
447
447
Rules : []config.SeverityRule {
448
448
{
@@ -466,7 +466,7 @@ func TestSeverity_transform(t *testing.T) {
466
466
},
467
467
{
468
468
desc : "keep severity from linter as default (without rule)" ,
469
- opts : SeverityOptions {
469
+ opts : & config. Severity {
470
470
Default : severityFromLinter ,
471
471
},
472
472
issue : & result.Issue {
0 commit comments