@@ -28,7 +28,6 @@ var lintTests = integration.TestFuncs(
28
28
testStageName ,
29
29
testNoEmptyContinuation ,
30
30
testConsistentInstructionCasing ,
31
- testFileConsistentCommandCasing ,
32
31
testDuplicateStageName ,
33
32
testReservedStageName ,
34
33
testJSONArgsRecommended ,
@@ -97,19 +96,19 @@ copy Dockerfile .
97
96
` )
98
97
checkLinterWarnings (t , sb , & lintTestParams {Dockerfile : dockerfile })
99
98
100
- dockerfile = []byte (`#check=skip=FileConsistentCommandCasing ,FromAsCasing
99
+ dockerfile = []byte (`#check=skip=ConsistentInstructionCasing ,FromAsCasing
101
100
FROM scratch as base
102
101
copy Dockerfile .
103
102
` )
104
103
checkLinterWarnings (t , sb , & lintTestParams {Dockerfile : dockerfile })
105
104
106
- dockerfile = []byte (`#check=skip=FileConsistentCommandCasing ,FromAsCasing;error=true
105
+ dockerfile = []byte (`#check=skip=ConsistentInstructionCasing ,FromAsCasing;error=true
107
106
FROM scratch as base
108
107
copy Dockerfile .
109
108
` )
110
109
checkLinterWarnings (t , sb , & lintTestParams {Dockerfile : dockerfile })
111
110
112
- dockerfile = []byte (`#check=skip=FileConsistentCommandCasing
111
+ dockerfile = []byte (`#check=skip=ConsistentInstructionCasing
113
112
FROM scratch as base
114
113
copy Dockerfile .
115
114
` )
@@ -127,7 +126,7 @@ copy Dockerfile .
127
126
},
128
127
})
129
128
130
- dockerfile = []byte (`#check=skip=FileConsistentCommandCasing ;error=true
129
+ dockerfile = []byte (`#check=skip=ConsistentInstructionCasing ;error=true
131
130
FROM scratch as base
132
131
copy Dockerfile .
133
132
` )
@@ -168,7 +167,7 @@ copy Dockerfile .
168
167
UnmarshalBuildErr : "lint violation found for rules: FromAsCasing" ,
169
168
BuildErrLocation : 2 ,
170
169
FrontendAttrs : map [string ]string {
171
- "build-arg:BUILDKIT_DOCKERFILE_CHECK" : "skip=FileConsistentCommandCasing ;error=true" ,
170
+ "build-arg:BUILDKIT_DOCKERFILE_CHECK" : "skip=ConsistentInstructionCasing ;error=true" ,
172
171
},
173
172
})
174
173
@@ -275,52 +274,50 @@ FROM scratch AS base2
275
274
Warnings : []expectedLintWarning {
276
275
{
277
276
RuleName : "ConsistentInstructionCasing" ,
278
- Description : "Instructions should be in consistent casing (all lower or all upper )" ,
277
+ Description : "All commands within the Dockerfile should use the same casing (either upper or lower )" ,
279
278
URL : "https://docs.docker.com/go/dockerfile/rule/consistent-instruction-casing/" ,
280
- Detail : "Command 'From' should be consistently cased " ,
279
+ Detail : "Command 'From' should match the case of the command majority (uppercase) " ,
281
280
Level : 1 ,
282
281
Line : 3 ,
283
282
},
284
283
},
285
284
})
286
285
287
286
dockerfile = []byte (`
288
- # warning: 'FROM' should be either lowercased or uppercased
289
- frOM scratch as base
290
- from scratch as base2
287
+ FROM scratch
288
+ # warning: 'copy' should match command majority's casing (uppercase)
289
+ copy Dockerfile /foo
290
+ COPY Dockerfile /bar
291
291
` )
292
+
292
293
checkLinterWarnings (t , sb , & lintTestParams {
293
294
Dockerfile : dockerfile ,
294
295
Warnings : []expectedLintWarning {
295
296
{
296
297
RuleName : "ConsistentInstructionCasing" ,
297
- Description : "Instructions should be in consistent casing (all lower or all upper )" ,
298
+ Description : "All commands within the Dockerfile should use the same casing (either upper or lower )" ,
298
299
URL : "https://docs.docker.com/go/dockerfile/rule/consistent-instruction-casing/" ,
299
- Detail : "Command 'frOM ' should be consistently cased " ,
300
- Line : 3 ,
300
+ Detail : "Command 'copy ' should match the case of the command majority (uppercase) " ,
301
+ Line : 4 ,
301
302
Level : 1 ,
302
303
},
303
304
},
304
305
})
305
- }
306
306
307
- func testFileConsistentCommandCasing (t * testing.T , sb integration.Sandbox ) {
308
- dockerfile := []byte (`
309
- FROM scratch
310
- # warning: 'copy' should match command majority's casing (uppercase)
311
- copy Dockerfile /foo
312
- COPY Dockerfile /bar
307
+ dockerfile = []byte (`
308
+ # warning: 'frOM' should be either lowercased or uppercased
309
+ frOM scratch as base
310
+ from scratch as base2
313
311
` )
314
-
315
312
checkLinterWarnings (t , sb , & lintTestParams {
316
313
Dockerfile : dockerfile ,
317
314
Warnings : []expectedLintWarning {
318
315
{
319
- RuleName : "FileConsistentCommandCasing " ,
316
+ RuleName : "ConsistentInstructionCasing " ,
320
317
Description : "All commands within the Dockerfile should use the same casing (either upper or lower)" ,
321
- URL : "https://docs.docker.com/go/dockerfile/rule/file- consistent-command -casing/" ,
322
- Detail : "Command 'copy ' should match the case of the command majority (uppercase )" ,
323
- Line : 4 ,
318
+ URL : "https://docs.docker.com/go/dockerfile/rule/consistent-instruction -casing/" ,
319
+ Detail : "Command 'frOM ' should match the case of the command majority (lowercase )" ,
320
+ Line : 3 ,
324
321
Level : 1 ,
325
322
},
326
323
},
@@ -336,9 +333,9 @@ copy Dockerfile /bar
336
333
Dockerfile : dockerfile ,
337
334
Warnings : []expectedLintWarning {
338
335
{
339
- RuleName : "FileConsistentCommandCasing " ,
336
+ RuleName : "ConsistentInstructionCasing " ,
340
337
Description : "All commands within the Dockerfile should use the same casing (either upper or lower)" ,
341
- URL : "https://docs.docker.com/go/dockerfile/rule/file- consistent-command -casing/" ,
338
+ URL : "https://docs.docker.com/go/dockerfile/rule/consistent-instruction -casing/" ,
342
339
Detail : "Command 'COPY' should match the case of the command majority (lowercase)" ,
343
340
Line : 4 ,
344
341
Level : 1 ,
@@ -357,9 +354,9 @@ COPY Dockerfile /baz
357
354
Dockerfile : dockerfile ,
358
355
Warnings : []expectedLintWarning {
359
356
{
360
- RuleName : "FileConsistentCommandCasing " ,
357
+ RuleName : "ConsistentInstructionCasing " ,
361
358
Description : "All commands within the Dockerfile should use the same casing (either upper or lower)" ,
362
- URL : "https://docs.docker.com/go/dockerfile/rule/file- consistent-command -casing/" ,
359
+ URL : "https://docs.docker.com/go/dockerfile/rule/consistent-instruction -casing/" ,
363
360
Detail : "Command 'from' should match the case of the command majority (uppercase)" ,
364
361
Line : 3 ,
365
362
Level : 1 ,
@@ -378,9 +375,9 @@ copy Dockerfile /baz
378
375
Dockerfile : dockerfile ,
379
376
Warnings : []expectedLintWarning {
380
377
{
381
- RuleName : "FileConsistentCommandCasing " ,
378
+ RuleName : "ConsistentInstructionCasing " ,
382
379
Description : "All commands within the Dockerfile should use the same casing (either upper or lower)" ,
383
- URL : "https://docs.docker.com/go/dockerfile/rule/file- consistent-command -casing/" ,
380
+ URL : "https://docs.docker.com/go/dockerfile/rule/consistent-instruction -casing/" ,
384
381
Detail : "Command 'FROM' should match the case of the command majority (lowercase)" ,
385
382
Line : 3 ,
386
383
Level : 1 ,
0 commit comments