Skip to content

Commit 02401fd

Browse files
committed
dockerfile: promote experimental linter rules
This promotes the following linter rules: - CopyIgnoredFile - InvalidDefinitionDescription Signed-off-by: Jonathan A. Sternberg <[email protected]>
1 parent a8e548f commit 02401fd

File tree

5 files changed

+6
-16
lines changed

5 files changed

+6
-16
lines changed

frontend/dockerfile/dockerfile_lint_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ var lintTests = integration.TestFuncs(
5454
)
5555

5656
func testDefinitionDescription(t *testing.T, sb integration.Sandbox) {
57-
dockerfile := []byte(`# check=experimental=InvalidDefinitionDescription
57+
dockerfile := []byte(`
5858
# foo this is the foo
5959
ARG foo=bar
6060
@@ -74,7 +74,7 @@ COPY Dockerfile .
7474
`)
7575
checkLinterWarnings(t, sb, &lintTestParams{Dockerfile: dockerfile})
7676

77-
dockerfile = []byte(`# check=experimental=InvalidDefinitionDescription
77+
dockerfile = []byte(`
7878
# bar this is the bar
7979
ARG foo=bar
8080
# BasE this is the BasE image
@@ -139,7 +139,7 @@ ADD Dockerfile /windy
139139
StreamBuildErrRegexp: regexp.MustCompile(`failed to solve: failed to compute cache key: failed to calculate checksum of ref [^\s]+ "/Dockerfile": not found`),
140140
})
141141

142-
dockerfile = []byte(`# check=experimental=CopyIgnoredFile
142+
dockerfile = []byte(`
143143
FROM scratch
144144
COPY Dockerfile .
145145
ADD Dockerfile /windy
@@ -170,7 +170,7 @@ ADD Dockerfile /windy
170170
},
171171
})
172172

173-
dockerfile = []byte(`# check=skip=all;experimental=CopyIgnoredFile
173+
dockerfile = []byte(`
174174
FROM scratch
175175
COPY Dockerfile .
176176
ADD Dockerfile /windy

frontend/dockerfile/docs/rules/_index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,11 @@ To learn more about how to use build checks, see
100100
<td>FROM --platform flag should not use a constant value</td>
101101
</tr>
102102
<tr>
103-
<td><a href="./copy-ignored-file/">CopyIgnoredFile (experimental)</a></td>
103+
<td><a href="./copy-ignored-file/">CopyIgnoredFile</a></td>
104104
<td>Attempting to Copy file that is excluded by .dockerignore</td>
105105
</tr>
106106
<tr>
107-
<td><a href="./invalid-definition-description/">InvalidDefinitionDescription (experimental)</a></td>
107+
<td><a href="./invalid-definition-description/">InvalidDefinitionDescription</a></td>
108108
<td>Comment for build stage or argument should follow the format: `# <arg/stage name> <description>`. If this is not intended to be a description comment, add an empty line or comment between the instruction and the comment.</td>
109109
</tr>
110110
<tr>

frontend/dockerfile/docs/rules/copy-ignored-file.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ aliases:
66
- /go/dockerfile/rule/copy-ignored-file/
77
---
88

9-
> [!NOTE]
10-
> This check is experimental and is not enabled by default. To enable it, see
11-
> [Experimental checks](https://docs.docker.com/go/build-checks-experimental/).
12-
139
## Output
1410

1511
```text

frontend/dockerfile/docs/rules/invalid-definition-description.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ aliases:
66
- /go/dockerfile/rule/invalid-definition-description/
77
---
88

9-
> [!NOTE]
10-
> This check is experimental and is not enabled by default. To enable it, see
11-
> [Experimental checks](https://docs.docker.com/go/build-checks-experimental/).
12-
139
## Output
1410

1511
```text

frontend/dockerfile/linter/ruleset.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@ var (
163163
Format: func(cmd, file string) string {
164164
return fmt.Sprintf("Attempting to %s file %q that is excluded by .dockerignore", cmd, file)
165165
},
166-
Experimental: true,
167166
}
168167
RuleInvalidDefinitionDescription = LinterRule[func(string, string) string]{
169168
Name: "InvalidDefinitionDescription",
@@ -172,7 +171,6 @@ var (
172171
Format: func(instruction, defName string) string {
173172
return fmt.Sprintf("Comment for %s should follow the format: `# %s <description>`", instruction, defName)
174173
},
175-
Experimental: true,
176174
}
177175
RuleExposeProtoCasing = LinterRule[func(string) string]{
178176
Name: "ExposeProtoCasing",

0 commit comments

Comments
 (0)