diff --git a/frontend/dockerfile/dockerfile2llb/convert.go b/frontend/dockerfile/dockerfile2llb/convert.go index 3664f3ad979f..2ff6edb25f02 100644 --- a/frontend/dockerfile/dockerfile2llb/convert.go +++ b/frontend/dockerfile/dockerfile2llb/convert.go @@ -276,10 +276,10 @@ func toDispatchState(ctx context.Context, dt []byte, opt ConvertOpt) (*dispatchS // The `dockerfile.Warnings` *should* only contain warnings about empty continuation // lines, but we'll check the warning message to be sure, so that we don't accidentally // process warnings that are not related to empty continuation lines twice. - if warning.URL == linter.RuleNoEmptyContinuations.URL { + if warning.URL == linter.RuleNoEmptyContinuation.URL { location := []parser.Range{*warning.Location} - msg := linter.RuleNoEmptyContinuations.Format() - lint.Run(&linter.RuleNoEmptyContinuations, location, msg) + msg := linter.RuleNoEmptyContinuation.Format() + lint.Run(&linter.RuleNoEmptyContinuation, location, msg) } } diff --git a/frontend/dockerfile/dockerfile_lint_test.go b/frontend/dockerfile/dockerfile_lint_test.go index 9a17d7178e5a..1e30ddacb3d4 100644 --- a/frontend/dockerfile/dockerfile_lint_test.go +++ b/frontend/dockerfile/dockerfile_lint_test.go @@ -25,7 +25,7 @@ import ( var lintTests = integration.TestFuncs( testRuleCheckOption, testStageName, - testNoEmptyContinuations, + testNoEmptyContinuation, testConsistentInstructionCasing, testFileConsistentCommandCasing, testDuplicateStageName, @@ -237,7 +237,7 @@ from scratch as base2 }) } -func testNoEmptyContinuations(t *testing.T, sb integration.Sandbox) { +func testNoEmptyContinuation(t *testing.T, sb integration.Sandbox) { dockerfile := []byte(` FROM scratch # warning: empty continuation line @@ -252,9 +252,9 @@ COPY Dockerfile \ Dockerfile: dockerfile, Warnings: []expectedLintWarning{ { - RuleName: "NoEmptyContinuations", + RuleName: "NoEmptyContinuation", Description: "Empty continuation lines will become errors in a future release", - URL: "https://docs.docker.com/go/dockerfile/rule/no-empty-continuations/", + URL: "https://docs.docker.com/go/dockerfile/rule/no-empty-continuation/", Detail: "Empty continuation line", Level: 1, Line: 6, diff --git a/frontend/dockerfile/docs/rules/_index.md b/frontend/dockerfile/docs/rules/_index.md index 6fcee3d1eff5..ab8e41d54e19 100644 --- a/frontend/dockerfile/docs/rules/_index.md +++ b/frontend/dockerfile/docs/rules/_index.md @@ -37,7 +37,7 @@ $ docker build --check . The 'as' keyword should match the case of the 'from' keyword - NoEmptyContinuations + NoEmptyContinuation Empty continuation lines will become errors in a future release diff --git a/frontend/dockerfile/docs/rules/no-empty-continuations.md b/frontend/dockerfile/docs/rules/no-empty-continuation.md similarity index 92% rename from frontend/dockerfile/docs/rules/no-empty-continuations.md rename to frontend/dockerfile/docs/rules/no-empty-continuation.md index 78283cd47eaa..4636eabf5d7f 100644 --- a/frontend/dockerfile/docs/rules/no-empty-continuations.md +++ b/frontend/dockerfile/docs/rules/no-empty-continuation.md @@ -1,8 +1,8 @@ --- -title: NoEmptyContinuations +title: NoEmptyContinuation description: Empty continuation lines will become errors in a future release aliases: - - /go/dockerfile/rule/no-empty-continuations/ + - /go/dockerfile/rule/no-empty-continuation/ --- ## Output diff --git a/frontend/dockerfile/linter/docs/NoEmptyContinuations.md b/frontend/dockerfile/linter/docs/NoEmptyContinuation.md similarity index 100% rename from frontend/dockerfile/linter/docs/NoEmptyContinuations.md rename to frontend/dockerfile/linter/docs/NoEmptyContinuation.md diff --git a/frontend/dockerfile/linter/linter.go b/frontend/dockerfile/linter/linter.go index 9a4de80e9a0a..bb33a14229b3 100644 --- a/frontend/dockerfile/linter/linter.go +++ b/frontend/dockerfile/linter/linter.go @@ -92,7 +92,7 @@ func (rule *LinterRule[F]) Run(warn LintWarnFunc, location []parser.Range, txt . } func LintFormatShort(rulename, msg string, startLine int) string { - return fmt.Sprintf("Lint Rule '%s': %s (line %d)", rulename, msg, startLine) + return fmt.Sprintf("%s: %s (line %d)", rulename, msg, startLine) } type LintWarnFunc func(rulename, description, url, fmtmsg string, location []parser.Range) diff --git a/frontend/dockerfile/linter/ruleset.go b/frontend/dockerfile/linter/ruleset.go index 6c26dd32f853..40b3b643cf39 100644 --- a/frontend/dockerfile/linter/ruleset.go +++ b/frontend/dockerfile/linter/ruleset.go @@ -21,10 +21,10 @@ var ( return fmt.Sprintf("'%s' and '%s' keywords' casing do not match", as, from) }, } - RuleNoEmptyContinuations = LinterRule[func() string]{ - Name: "NoEmptyContinuations", + RuleNoEmptyContinuation = LinterRule[func() string]{ + Name: "NoEmptyContinuation", Description: "Empty continuation lines will become errors in a future release", - URL: "https://docs.docker.com/go/dockerfile/rule/no-empty-continuations/", + URL: "https://docs.docker.com/go/dockerfile/rule/no-empty-continuation/", Format: func() string { return "Empty continuation line" }, diff --git a/frontend/dockerfile/parser/parser.go b/frontend/dockerfile/parser/parser.go index 8af3918acba4..99fdb961fdb3 100644 --- a/frontend/dockerfile/parser/parser.go +++ b/frontend/dockerfile/parser/parser.go @@ -338,7 +338,7 @@ func Parse(rwc io.Reader) (*Result, error) { warnings = append(warnings, Warning{ Short: "Empty continuation line found in: " + line, Detail: [][]byte{[]byte("Empty continuation lines will become errors in a future release")}, - URL: "https://docs.docker.com/go/dockerfile/rule/no-empty-continuations/", + URL: "https://docs.docker.com/go/dockerfile/rule/no-empty-continuation/", Location: &Range{Start: Position{Line: currentLine}, End: Position{Line: currentLine}}, }) }