Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export default function GlobalStyle() {
font-weight: 400;
}
span.inline-code,
code.inline-code {
display: inline-block;
vertical-align: middle;
Expand Down
36 changes: 20 additions & 16 deletions scripts/website/expand_templates/exclusions.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,26 @@ import (

const exclusionTmpl = `{{- $tick := "` + "`" + `" -}}
{{- range $name, $rules := . }}
### {{ $tick }}{{ $name }}{{ $tick }}
{{ range $rule := $rules }}
{{ $tick }}{{ range $linter := $rule.Linters }}{{ $linter }}{{ end }}{{ $tick }}:
{{ if $rule.Path -}}
- Path: {{ $tick }}{{ $rule.Path }}{{ $tick }}
{{ end -}}
{{ if $rule.PathExcept -}}
- Path Except: {{ $tick }}{{ $rule.PathExcept }}{{ $tick }}
{{ end -}}
{{ if $rule.Text -}}
- Text: {{ $tick }}{{ $rule.Text }}{{ $tick }}
{{ end -}}
{{ if $rule.Source -}}
- Source: {{ $tick }}{{ $rule.Source }}{{ $tick }}
{{ end -}}
{{ end }}{{ end }}`
### Preset {{ $tick }}{{ $name }}{{ $tick }}

<table>
<thead>
<tr>
<th>Linter</th>
<th>Issue Text</th>
</tr>
</thead>
<tbody>
{{- range $rule := $rules }}
<tr>
<td>{{ range $linter := $rule.Linters }}{{ $linter }}{{ end }}</td>
<td><span class="inline-code">{{ if $rule.Text }}{{ $rule.Text }}{{ end }}</span></td>
</tr>
{{- end }}
</tbody>
</table>

{{ end }}`

func getExclusionPresets() (string, error) {
linterExclusionPresets, err := readJSONFile[map[string][]types.ExcludeRule](filepath.Join("assets", "exclusion-presets.json"))
Expand Down
Loading