From 534fcef2dd00d162b7fa9d67612db692b8fcda2c Mon Sep 17 00:00:00 2001 From: Talon Bowler Date: Wed, 9 Oct 2024 06:58:36 -0700 Subject: [PATCH] sets the InvalidDefinitionDescription check to be experimental Signed-off-by: Talon Bowler --- frontend/dockerfile/dockerfile_lint_test.go | 4 ++-- frontend/dockerfile/docs/rules/_index.md | 2 +- .../dockerfile/docs/rules/invalid-definition-description.md | 4 ++++ frontend/dockerfile/linter/ruleset.go | 1 + 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/frontend/dockerfile/dockerfile_lint_test.go b/frontend/dockerfile/dockerfile_lint_test.go index bc327e0bb2ba..be42a14394f9 100644 --- a/frontend/dockerfile/dockerfile_lint_test.go +++ b/frontend/dockerfile/dockerfile_lint_test.go @@ -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 @@ -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 diff --git a/frontend/dockerfile/docs/rules/_index.md b/frontend/dockerfile/docs/rules/_index.md index 932ce1813a6a..0938ace3dfe8 100644 --- a/frontend/dockerfile/docs/rules/_index.md +++ b/frontend/dockerfile/docs/rules/_index.md @@ -104,7 +104,7 @@ To learn more about how to use build checks, see Attempting to Copy file that is excluded by .dockerignore - InvalidDefinitionDescription + InvalidDefinitionDescription (experimental) Comment for build stage or argument should follow the format: `# `. If this is not intended to be a description comment, add an empty line or comment between the instruction and the comment. diff --git a/frontend/dockerfile/docs/rules/invalid-definition-description.md b/frontend/dockerfile/docs/rules/invalid-definition-description.md index 3e9044c417f0..23d353c03c6f 100644 --- a/frontend/dockerfile/docs/rules/invalid-definition-description.md +++ b/frontend/dockerfile/docs/rules/invalid-definition-description.md @@ -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 diff --git a/frontend/dockerfile/linter/ruleset.go b/frontend/dockerfile/linter/ruleset.go index 2a776aa88ecc..63cc0013ef2b 100644 --- a/frontend/dockerfile/linter/ruleset.go +++ b/frontend/dockerfile/linter/ruleset.go @@ -172,5 +172,6 @@ var ( Format: func(instruction, defName string) string { return fmt.Sprintf("Comment for %s should follow the format: `# %s `", instruction, defName) }, + Experimental: true, } )