@@ -191,15 +191,15 @@ ENV git_key=
191
191
{
192
192
RuleName : "SecretsUsedInArgOrEnv" ,
193
193
Description : "Sensitive data should not be used in the ARG or ENV commands" ,
194
- Detail : `Do not use ARG or ENV instructions for sensitive data (ARG "super_duper_secret_token ")` ,
194
+ Detail : `Do not use ARG or ENV instructions for sensitive data (ARG "auth ")` ,
195
195
URL : "https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/" ,
196
196
Level : 1 ,
197
197
Line : 6 ,
198
198
},
199
199
{
200
200
RuleName : "SecretsUsedInArgOrEnv" ,
201
201
Description : "Sensitive data should not be used in the ARG or ENV commands" ,
202
- Detail : `Do not use ARG or ENV instructions for sensitive data (ARG "auth ")` ,
202
+ Detail : `Do not use ARG or ENV instructions for sensitive data (ARG "super_duper_secret_token ")` ,
203
203
URL : "https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/" ,
204
204
Level : 1 ,
205
205
Line : 6 ,
@@ -1388,6 +1388,9 @@ func checkUnmarshal(t *testing.T, sb integration.Sandbox, lintTest *lintTestPara
1388
1388
// sort by line number in ascending order
1389
1389
firstRange := lintResults .Warnings [i ].Location .Ranges [0 ]
1390
1390
secondRange := lintResults .Warnings [j ].Location .Ranges [0 ]
1391
+ if firstRange .Start .Line == secondRange .Start .Line {
1392
+ return lintResults .Warnings [i ].Detail < lintResults .Warnings [j ].Detail
1393
+ }
1391
1394
return firstRange .Start .Line < secondRange .Start .Line
1392
1395
})
1393
1396
// Compare expectedLintWarning with actual lint results
@@ -1477,6 +1480,9 @@ func checkProgressStream(t *testing.T, sb integration.Sandbox, lintTest *lintTes
1477
1480
} else if len (w2 .Range ) == 0 {
1478
1481
return false
1479
1482
}
1483
+ if w1 .Range [0 ].Start .Line == w2 .Range [0 ].Start .Line {
1484
+ return string (w1 .Short ) < string (w2 .Short )
1485
+ }
1480
1486
return w1 .Range [0 ].Start .Line < w2 .Range [0 ].Start .Line
1481
1487
})
1482
1488
for i , w := range warnings {
@@ -1487,6 +1493,9 @@ func checkProgressStream(t *testing.T, sb integration.Sandbox, lintTest *lintTes
1487
1493
func checkLinterWarnings (t * testing.T , sb integration.Sandbox , lintTest * lintTestParams ) {
1488
1494
t .Helper ()
1489
1495
sort .Slice (lintTest .Warnings , func (i , j int ) bool {
1496
+ if lintTest .Warnings [i ].Line == lintTest .Warnings [j ].Line {
1497
+ return lintTest .Warnings [i ].Detail < lintTest .Warnings [j ].Detail
1498
+ }
1490
1499
return lintTest .Warnings [i ].Line < lintTest .Warnings [j ].Line
1491
1500
})
1492
1501
0 commit comments