Skip to content

Commit

Permalink
Add note in generated docs indicating experimental rule checks
Browse files Browse the repository at this point in the history
Signed-off-by: Talon Bowler <[email protected]>
  • Loading branch information
daghack committed Aug 8, 2024
1 parent 8a7ba6e commit c00dd4a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
4 changes: 4 additions & 0 deletions frontend/dockerfile/docs/rules/copy-ignored-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ description: Attempting to Copy file that is excluded by .dockerignore
aliases:
- /go/dockerfile/rule/copy-ignored-file/
---
> **Note**
>
> This check is experimental.
>
## Output

Expand Down
20 changes: 15 additions & 5 deletions frontend/dockerfile/linter/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@ import (
)

type Rule struct {
Name string
Description string
URL *url.URL
PageName string
URLAlias string
Name string
Description string
URL *url.URL
PageName string
URLAlias string
Experimental bool
}

const tmplStr = `---
Expand All @@ -35,6 +36,11 @@ aliases:
- {{ .Rule.URLAlias }}
{{- end }}
---
{{- if .Rule.Experimental }}
> **Note**
>
> This check is experimental.
{{- end }}
{{ .Content }}
`
Expand Down Expand Up @@ -160,6 +166,10 @@ func listRules() ([]Rule, error) {
}
rule.URL = u
}
case "Experimental":
if basicLit, ok := kv.Value.(*ast.Ident); ok {
rule.Experimental = basicLit.Name == "true"
}
}
}
}
Expand Down

0 comments on commit c00dd4a

Please sign in to comment.