Skip to content

Commit e779094

Browse files
committed
dockerfile: fix lint rules links in index
Signed-off-by: CrazyMax <[email protected]>
1 parent 5760de7 commit e779094

File tree

3 files changed

+19
-19
lines changed

3 files changed

+19
-19
lines changed

frontend/dockerfile/docs/rules/_index.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -29,59 +29,59 @@ $ docker build --check .
2929
</thead>
3030
<tbody>
3131
<tr>
32-
<td><a href="./stage-name-casing.md">StageNameCasing</a></td>
32+
<td><a href="./stage-name-casing/">StageNameCasing</a></td>
3333
<td>Stage names should be lowercase</td>
3434
</tr>
3535
<tr>
36-
<td><a href="./from-as-casing.md">FromAsCasing</a></td>
36+
<td><a href="./from-as-casing/">FromAsCasing</a></td>
3737
<td>The 'as' keyword should match the case of the 'from' keyword</td>
3838
</tr>
3939
<tr>
40-
<td><a href="./no-empty-continuations.md">NoEmptyContinuations</a></td>
40+
<td><a href="./no-empty-continuations/">NoEmptyContinuations</a></td>
4141
<td>Empty continuation lines will become errors in a future release</td>
4242
</tr>
4343
<tr>
44-
<td><a href="./consistent-instruction-casing.md">ConsistentInstructionCasing</a></td>
44+
<td><a href="./consistent-instruction-casing/">ConsistentInstructionCasing</a></td>
4545
<td>Instructions should be in consistent casing (all lower or all upper)</td>
4646
</tr>
4747
<tr>
48-
<td><a href="./file-consistent-command-casing.md">FileConsistentCommandCasing</a></td>
48+
<td><a href="./file-consistent-command-casing/">FileConsistentCommandCasing</a></td>
4949
<td>All commands within the Dockerfile should use the same casing (either upper or lower)</td>
5050
</tr>
5151
<tr>
52-
<td><a href="./duplicate-stage-name.md">DuplicateStageName</a></td>
52+
<td><a href="./duplicate-stage-name/">DuplicateStageName</a></td>
5353
<td>Stage names should be unique</td>
5454
</tr>
5555
<tr>
56-
<td><a href="./reserved-stage-name.md">ReservedStageName</a></td>
56+
<td><a href="./reserved-stage-name/">ReservedStageName</a></td>
5757
<td>Reserved words should not be used as stage names</td>
5858
</tr>
5959
<tr>
60-
<td><a href="./json-args-recommended.md">JSONArgsRecommended</a></td>
60+
<td><a href="./json-args-recommended/">JSONArgsRecommended</a></td>
6161
<td>JSON arguments recommended for ENTRYPOINT/CMD to prevent unintended behavior related to OS signals</td>
6262
</tr>
6363
<tr>
64-
<td><a href="./maintainer-deprecated.md">MaintainerDeprecated</a></td>
64+
<td><a href="./maintainer-deprecated/">MaintainerDeprecated</a></td>
6565
<td>The MAINTAINER instruction is deprecated, use a label instead to define an image author</td>
6666
</tr>
6767
<tr>
68-
<td><a href="./undefined-arg-in-from.md">UndefinedArgInFrom</a></td>
68+
<td><a href="./undefined-arg-in-from/">UndefinedArgInFrom</a></td>
6969
<td>FROM command must use declared ARGs</td>
7070
</tr>
7171
<tr>
72-
<td><a href="./workdir-relative-path.md">WorkdirRelativePath</a></td>
72+
<td><a href="./workdir-relative-path/">WorkdirRelativePath</a></td>
7373
<td>Relative workdir without an absolute workdir declared within the build can have unexpected results if the base image changes</td>
7474
</tr>
7575
<tr>
76-
<td><a href="./undefined-var.md">UndefinedVar</a></td>
76+
<td><a href="./undefined-var/">UndefinedVar</a></td>
7777
<td>Variables should be defined before their use</td>
7878
</tr>
7979
<tr>
80-
<td><a href="./multiple-instructions-disallowed.md">MultipleInstructionsDisallowed</a></td>
80+
<td><a href="./multiple-instructions-disallowed/">MultipleInstructionsDisallowed</a></td>
8181
<td>Multiple instructions of the same type should not be used in the same stage</td>
8282
</tr>
8383
<tr>
84-
<td><a href="./legacy-key-value-format.md">LegacyKeyValueFormat</a></td>
84+
<td><a href="./legacy-key-value-format/">LegacyKeyValueFormat</a></td>
8585
<td>Legacy key/value format with whitespace separator should not be used</td>
8686
</tr>
8787
</tbody>

frontend/dockerfile/linter/docs/_index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ $ docker build --check .
3030
<tbody>
3131
{{- range .Rules }}
3232
<tr>
33-
<td><a href="./{{.Filename}}">{{.Name}}</a></td>
34-
<td>{{.Description}}</td>
33+
<td><a href="./{{ .PageName }}/">{{ .Name }}</a></td>
34+
<td>{{ .Description }}</td>
3535
</tr>
3636
{{- end }}
3737
</tbody>

frontend/dockerfile/linter/generate.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ type Rule struct {
2323
Name string
2424
Description string
2525
URL *url.URL
26-
Filename string
26+
PageName string
2727
URLAlias string
2828
}
2929

@@ -82,7 +82,7 @@ func genRuleDoc(rule Rule, tmpl *template.Template) (bool, error) {
8282
if err != nil {
8383
return false, err
8484
}
85-
outputfile, err := os.Create(path.Join(destDir, rule.Filename))
85+
outputfile, err := os.Create(path.Join(destDir, rule.PageName+".md"))
8686
if err != nil {
8787
return false, err
8888
}
@@ -144,7 +144,7 @@ func listRules() ([]Rule, error) {
144144
case "Name":
145145
if basicLit, ok := kv.Value.(*ast.BasicLit); ok {
146146
rule.Name = strings.Trim(basicLit.Value, `"`)
147-
rule.Filename = fmt.Sprintf("%s.md", camelToKebab(rule.Name))
147+
rule.PageName = camelToKebab(rule.Name)
148148
}
149149
case "Description":
150150
if basicLit, ok := kv.Value.(*ast.BasicLit); ok {

0 commit comments

Comments
 (0)