Skip to content

Commit

Permalink
sets the InvalidDefinitionDescription check to be experimental
Browse files Browse the repository at this point in the history
Signed-off-by: Talon Bowler <[email protected]>
  • Loading branch information
daghack committed Oct 9, 2024
1 parent 62bda5c commit 534fcef
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions frontend/dockerfile/dockerfile_lint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ var lintTests = integration.TestFuncs(
)

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

dockerfile = []byte(`
dockerfile = []byte(`# check=experimental=InvalidDefinitionDescription
# bar this is the bar
ARG foo=bar
# BasE this is the BasE image
Expand Down
2 changes: 1 addition & 1 deletion frontend/dockerfile/docs/rules/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ To learn more about how to use build checks, see
<td>Attempting to Copy file that is excluded by .dockerignore</td>
</tr>
<tr>
<td><a href="./invalid-definition-description/">InvalidDefinitionDescription</a></td>
<td><a href="./invalid-definition-description/">InvalidDefinitionDescription (experimental)</a></td>
<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>
</tr>
</tbody>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ aliases:
- /go/dockerfile/rule/invalid-definition-description/
---

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

```text
Expand Down
1 change: 1 addition & 0 deletions frontend/dockerfile/linter/ruleset.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,5 +172,6 @@ var (
Format: func(instruction, defName string) string {
return fmt.Sprintf("Comment for %s should follow the format: `# %s <description>`", instruction, defName)
},
Experimental: true,
}
)

0 comments on commit 534fcef

Please sign in to comment.