Skip to content

Commit 6d6f2fc

Browse files
committed
feat: exclusion presets shortcode
1 parent 869b7f2 commit 6d6f2fc

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

docs/content/docs/linters/false-positives.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,4 +166,4 @@ Use `//nolint` instead of `// nolint` because directives should have no space by
166166
Some exclusions are considered common.
167167
To help golangci-lint users, those common exclusions are provided through presets.
168168

169-
{.ExclusionPresets}
169+
{{% exclusion-presets %}}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{{- /*
2+
Creates a table of exclusion presets.
3+
4+
@example {{% exclusion-presets %}}
5+
*/ -}}
6+
7+
{{- $presets := index $.Site.Data.exclusion_presets -}}
8+
9+
{{ range $key, $values := $presets }}
10+
### Preset {{ print "`" $key "`" }}
11+
12+
<table>
13+
<thead>
14+
<tr>
15+
<th>Linter</th>
16+
<th>Issue Text</th>
17+
</tr>
18+
</thead>
19+
<tbody>
20+
{{- range $i, $value := $values -}}
21+
<tr>
22+
<td>{{ index $value "linters" 0 }}</td>
23+
<td><code>{{ index $value "text" }}</code></td>
24+
</tr>
25+
{{- end -}}
26+
</tbody>
27+
</table>
28+
{{ end }}

0 commit comments

Comments
 (0)