@@ -26,7 +26,7 @@ var lintTests = integration.TestFuncs(
26
26
testRuleCheckOption ,
27
27
testStageName ,
28
28
testNoEmptyContinuations ,
29
- testSelfConsistentCommandCasing ,
29
+ testConsistentInstructionCasing ,
30
30
testFileConsistentCommandCasing ,
31
31
testDuplicateStageName ,
32
32
testReservedStageName ,
@@ -56,6 +56,7 @@ COPY $bar .
56
56
{
57
57
RuleName : "UndefinedVar" ,
58
58
Description : "Variables should be defined before their use" ,
59
+ URL : "https://docs.docker.com/go/dockerfile/rule/undefined-var/" ,
59
60
Detail : "Usage of undefined variable '$bar'" ,
60
61
Level : 1 ,
61
62
Line : 6 ,
@@ -65,13 +66,15 @@ COPY $bar .
65
66
{
66
67
RuleName : "UndefinedVar" ,
67
68
Description : "Variables should be defined before their use" ,
69
+ URL : "https://docs.docker.com/go/dockerfile/rule/undefined-var/" ,
68
70
Detail : "Usage of undefined variable '$foo'" ,
69
71
Level : 1 ,
70
72
Line : 3 ,
71
73
},
72
74
{
73
75
RuleName : "UndefinedVar" ,
74
76
Description : "Variables should be defined before their use" ,
77
+ URL : "https://docs.docker.com/go/dockerfile/rule/undefined-var/" ,
75
78
Detail : "Usage of undefined variable '$bar'" ,
76
79
Level : 1 ,
77
80
Line : 6 ,
@@ -260,7 +263,7 @@ COPY Dockerfile \
260
263
})
261
264
}
262
265
263
- func testSelfConsistentCommandCasing (t * testing.T , sb integration.Sandbox ) {
266
+ func testConsistentInstructionCasing (t * testing.T , sb integration.Sandbox ) {
264
267
dockerfile := []byte (`
265
268
# warning: 'FROM' should be either lowercased or uppercased
266
269
From scratch as base
@@ -270,9 +273,9 @@ FROM scratch AS base2
270
273
Dockerfile : dockerfile ,
271
274
Warnings : []expectedLintWarning {
272
275
{
273
- RuleName : "SelfConsistentCommandCasing " ,
274
- Description : "Commands should be in consistent casing (all lower or all upper)" ,
275
- URL : "https://docs.docker.com/go/dockerfile/rule/self- consistent-command -casing/" ,
276
+ RuleName : "ConsistentInstructionCasing " ,
277
+ Description : "Instructions should be in consistent casing (all lower or all upper)" ,
278
+ URL : "https://docs.docker.com/go/dockerfile/rule/consistent-instruction -casing/" ,
276
279
Detail : "Command 'From' should be consistently cased" ,
277
280
Level : 1 ,
278
281
Line : 3 ,
@@ -289,9 +292,9 @@ from scratch as base2
289
292
Dockerfile : dockerfile ,
290
293
Warnings : []expectedLintWarning {
291
294
{
292
- RuleName : "SelfConsistentCommandCasing " ,
293
- Description : "Commands should be in consistent casing (all lower or all upper)" ,
294
- URL : "https://docs.docker.com/go/dockerfile/rule/self- consistent-command -casing/" ,
295
+ RuleName : "ConsistentInstructionCasing " ,
296
+ Description : "Instructions should be in consistent casing (all lower or all upper)" ,
297
+ URL : "https://docs.docker.com/go/dockerfile/rule/consistent-instruction -casing/" ,
295
298
Detail : "Command 'frOM' should be consistently cased" ,
296
299
Line : 3 ,
297
300
Level : 1 ,
@@ -435,15 +438,15 @@ FROM scratch AS context
435
438
Warnings : []expectedLintWarning {
436
439
{
437
440
RuleName : "ReservedStageName" ,
438
- Description : "Reserved stage names should not be used to name a stage" ,
441
+ Description : "Reserved words should not be used as stage names " ,
439
442
URL : "https://docs.docker.com/go/dockerfile/rule/reserved-stage-name/" ,
440
443
Detail : "Stage name should not use the same name as reserved stage \" scratch\" " ,
441
444
Level : 1 ,
442
445
Line : 2 ,
443
446
},
444
447
{
445
448
RuleName : "ReservedStageName" ,
446
- Description : "Reserved stage names should not be used to name a stage" ,
449
+ Description : "Reserved words should not be used as stage names " ,
447
450
URL : "https://docs.docker.com/go/dockerfile/rule/reserved-stage-name/" ,
448
451
Detail : "Stage name should not use the same name as reserved stage \" context\" " ,
449
452
Level : 1 ,
541
544
Warnings : []expectedLintWarning {
542
545
{
543
546
RuleName : "MaintainerDeprecated" ,
544
- Description : "The maintainer instruction is deprecated, use a label instead to define an image author" ,
547
+ Description : "The MAINTAINER instruction is deprecated, use a label instead to define an image author" ,
545
548
URL : "https://docs.docker.com/go/dockerfile/rule/maintainer-deprecated/" ,
546
549
Detail : "Maintainer instruction is deprecated in favor of using label" ,
547
550
Level : 1 ,
@@ -575,9 +578,9 @@ FROM ${BAR} AS base
575
578
Level : 1 ,
576
579
},
577
580
{
578
- RuleName : "UndeclaredArgInFrom " ,
581
+ RuleName : "UndefinedArgInFrom " ,
579
582
Description : "FROM command must use declared ARGs" ,
580
- URL : "https://docs.docker.com/go/dockerfile/rule/undeclared -arg-in-from/" ,
583
+ URL : "https://docs.docker.com/go/dockerfile/rule/undefined -arg-in-from/" ,
581
584
Detail : "FROM argument 'BAR' is not declared" ,
582
585
Level : 1 ,
583
586
Line : 4 ,
@@ -618,9 +621,9 @@ COPY Dockerfile .
618
621
Dockerfile : dockerfile ,
619
622
Warnings : []expectedLintWarning {
620
623
{
621
- RuleName : "UndeclaredArgInFrom " ,
624
+ RuleName : "UndefinedArgInFrom " ,
622
625
Description : "FROM command must use declared ARGs" ,
623
- URL : "https://docs.docker.com/go/dockerfile/rule/undeclared -arg-in-from/" ,
626
+ URL : "https://docs.docker.com/go/dockerfile/rule/undefined -arg-in-from/" ,
624
627
Detail : "FROM argument 'BULIDPLATFORM' is not declared (did you mean BUILDPLATFORM?)" ,
625
628
Level : 1 ,
626
629
Line : 2 ,
@@ -641,9 +644,9 @@ COPY Dockerfile .
641
644
Dockerfile : dockerfile ,
642
645
Warnings : []expectedLintWarning {
643
646
{
644
- RuleName : "UndeclaredArgInFrom " ,
647
+ RuleName : "UndefinedArgInFrom " ,
645
648
Description : "FROM command must use declared ARGs" ,
646
- URL : "https://docs.docker.com/go/dockerfile/rule/undeclared -arg-in-from/" ,
649
+ URL : "https://docs.docker.com/go/dockerfile/rule/undefined -arg-in-from/" ,
647
650
Detail : "FROM argument 'MYARCH' is not declared (did you mean MY_ARCH?)" ,
648
651
Level : 1 ,
649
652
Line : 4 ,
@@ -663,9 +666,9 @@ COPY Dockerfile .
663
666
Dockerfile : dockerfile ,
664
667
Warnings : []expectedLintWarning {
665
668
{
666
- RuleName : "UndeclaredArgInFrom " ,
669
+ RuleName : "UndefinedArgInFrom " ,
667
670
Description : "FROM command must use declared ARGs" ,
668
- URL : "https://docs.docker.com/go/dockerfile/rule/undeclared -arg-in-from/" ,
671
+ URL : "https://docs.docker.com/go/dockerfile/rule/undefined -arg-in-from/" ,
669
672
Detail : "FROM argument 'version' is not declared" ,
670
673
Level : 1 ,
671
674
Line : 3 ,
@@ -905,13 +908,15 @@ FROM a AS c
905
908
{
906
909
RuleName : "LegacyKeyValueFormat" ,
907
910
Description : "Legacy key/value format with whitespace separator should not be used" ,
911
+ URL : "https://docs.docker.com/go/dockerfile/rule/legacy-key-value-format/" ,
908
912
Detail : "\" ENV key=value\" should be used instead of legacy \" ENV key value\" format" ,
909
913
Line : 3 ,
910
914
Level : 1 ,
911
915
},
912
916
{
913
917
RuleName : "LegacyKeyValueFormat" ,
914
918
Description : "Legacy key/value format with whitespace separator should not be used" ,
919
+ URL : "https://docs.docker.com/go/dockerfile/rule/legacy-key-value-format/" ,
915
920
Detail : "\" LABEL key=value\" should be used instead of legacy \" LABEL key value\" format" ,
916
921
Line : 4 ,
917
922
Level : 1 ,
0 commit comments