Skip to content

Commit 534fcef

Browse files
committed
sets the InvalidDefinitionDescription check to be experimental
Signed-off-by: Talon Bowler <[email protected]>
1 parent 62bda5c commit 534fcef

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

frontend/dockerfile/dockerfile_lint_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ var lintTests = integration.TestFuncs(
5050
)
5151

5252
func testDefinitionDescription(t *testing.T, sb integration.Sandbox) {
53-
dockerfile := []byte(`
53+
dockerfile := []byte(`# check=experimental=InvalidDefinitionDescription
5454
# foo this is the foo
5555
ARG foo=bar
5656
@@ -70,7 +70,7 @@ COPY Dockerfile .
7070
`)
7171
checkLinterWarnings(t, sb, &lintTestParams{Dockerfile: dockerfile})
7272

73-
dockerfile = []byte(`
73+
dockerfile = []byte(`# check=experimental=InvalidDefinitionDescription
7474
# bar this is the bar
7575
ARG foo=bar
7676
# BasE this is the BasE image

frontend/dockerfile/docs/rules/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ To learn more about how to use build checks, see
104104
<td>Attempting to Copy file that is excluded by .dockerignore</td>
105105
</tr>
106106
<tr>
107-
<td><a href="./invalid-definition-description/">InvalidDefinitionDescription</a></td>
107+
<td><a href="./invalid-definition-description/">InvalidDefinitionDescription (experimental)</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
</tbody>

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

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

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

1014
```text

frontend/dockerfile/linter/ruleset.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,5 +172,6 @@ var (
172172
Format: func(instruction, defName string) string {
173173
return fmt.Sprintf("Comment for %s should follow the format: `# %s <description>`", instruction, defName)
174174
},
175+
Experimental: true,
175176
}
176177
)

0 commit comments

Comments
 (0)