Skip to content

Commit

Permalink
Merge branch 'master' into lint-cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: Talon James Bowler <talon.bowler@docker.com>
  • Loading branch information
daghack committed Jun 10, 2024
2 parents ff10dcc + 7da4d59 commit b4c1b71
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
28 changes: 14 additions & 14 deletions frontend/dockerfile/docs/rules/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,59 +29,59 @@ $ docker build --check .
</thead>
<tbody>
<tr>
<td><a href="./stage-name-casing.md">StageNameCasing</a></td>
<td><a href="./stage-name-casing/">StageNameCasing</a></td>
<td>Stage names should be lowercase</td>
</tr>
<tr>
<td><a href="./from-as-casing.md">FromAsCasing</a></td>
<td><a href="./from-as-casing/">FromAsCasing</a></td>
<td>The 'as' keyword should match the case of the 'from' keyword</td>
</tr>
<tr>
<td><a href="./no-empty-continuation.md">NoEmptyContinuation</a></td>
<td><a href="./no-empty-continuation/">NoEmptyContinuation</a></td>
<td>Empty continuation lines will become errors in a future release</td>
</tr>
<tr>
<td><a href="./consistent-instruction-casing.md">ConsistentInstructionCasing</a></td>
<td><a href="./consistent-instruction-casing/">ConsistentInstructionCasing</a></td>
<td>Instructions should be in consistent casing (all lower or all upper)</td>
</tr>
<tr>
<td><a href="./file-consistent-command-casing.md">FileConsistentCommandCasing</a></td>
<td><a href="./file-consistent-command-casing/">FileConsistentCommandCasing</a></td>
<td>All commands within the Dockerfile should use the same casing (either upper or lower)</td>
</tr>
<tr>
<td><a href="./duplicate-stage-name.md">DuplicateStageName</a></td>
<td><a href="./duplicate-stage-name/">DuplicateStageName</a></td>
<td>Stage names should be unique</td>
</tr>
<tr>
<td><a href="./reserved-stage-name.md">ReservedStageName</a></td>
<td><a href="./reserved-stage-name/">ReservedStageName</a></td>
<td>Reserved words should not be used as stage names</td>
</tr>
<tr>
<td><a href="./json-args-recommended.md">JSONArgsRecommended</a></td>
<td><a href="./json-args-recommended/">JSONArgsRecommended</a></td>
<td>JSON arguments recommended for ENTRYPOINT/CMD to prevent unintended behavior related to OS signals</td>
</tr>
<tr>
<td><a href="./maintainer-deprecated.md">MaintainerDeprecated</a></td>
<td><a href="./maintainer-deprecated/">MaintainerDeprecated</a></td>
<td>The MAINTAINER instruction is deprecated, use a label instead to define an image author</td>
</tr>
<tr>
<td><a href="./undefined-arg-in-from.md">UndefinedArgInFrom</a></td>
<td><a href="./undefined-arg-in-from/">UndefinedArgInFrom</a></td>
<td>FROM command must use declared ARGs</td>
</tr>
<tr>
<td><a href="./workdir-relative-path.md">WorkdirRelativePath</a></td>
<td><a href="./workdir-relative-path/">WorkdirRelativePath</a></td>
<td>Relative workdir without an absolute workdir declared within the build can have unexpected results if the base image changes</td>
</tr>
<tr>
<td><a href="./undefined-var.md">UndefinedVar</a></td>
<td><a href="./undefined-var/">UndefinedVar</a></td>
<td>Variables should be defined before their use</td>
</tr>
<tr>
<td><a href="./multiple-instructions-disallowed.md">MultipleInstructionsDisallowed</a></td>
<td><a href="./multiple-instructions-disallowed/">MultipleInstructionsDisallowed</a></td>
<td>Multiple instructions of the same type should not be used in the same stage</td>
</tr>
<tr>
<td><a href="./legacy-key-value-format.md">LegacyKeyValueFormat</a></td>
<td><a href="./legacy-key-value-format/">LegacyKeyValueFormat</a></td>
<td>Legacy key/value format with whitespace separator should not be used</td>
</tr>
</tbody>
Expand Down
4 changes: 2 additions & 2 deletions frontend/dockerfile/linter/docs/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ $ docker build --check .
<tbody>
{{- range .Rules }}
<tr>
<td><a href="./{{.Filename}}">{{.Name}}</a></td>
<td>{{.Description}}</td>
<td><a href="./{{ .PageName }}/">{{ .Name }}</a></td>
<td>{{ .Description }}</td>
</tr>
{{- end }}
</tbody>
Expand Down
6 changes: 3 additions & 3 deletions frontend/dockerfile/linter/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type Rule struct {
Name string
Description string
URL *url.URL
Filename string
PageName string
URLAlias string
}

Expand Down Expand Up @@ -82,7 +82,7 @@ func genRuleDoc(rule Rule, tmpl *template.Template) (bool, error) {
if err != nil {
return false, err
}
outputfile, err := os.Create(path.Join(destDir, rule.Filename))
outputfile, err := os.Create(path.Join(destDir, rule.PageName+".md"))
if err != nil {
return false, err
}
Expand Down Expand Up @@ -144,7 +144,7 @@ func listRules() ([]Rule, error) {
case "Name":
if basicLit, ok := kv.Value.(*ast.BasicLit); ok {
rule.Name = strings.Trim(basicLit.Value, `"`)
rule.Filename = fmt.Sprintf("%s.md", camelToKebab(rule.Name))
rule.PageName = camelToKebab(rule.Name)
}
case "Description":
if basicLit, ok := kv.Value.(*ast.BasicLit); ok {
Expand Down

0 comments on commit b4c1b71

Please sign in to comment.