Skip to content

Commit 7745be9

Browse files
authored
docs: add link on linter without configuration (#4843)
1 parent c5998e1 commit 7745be9

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

docs/src/docs/contributing/workflow.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Which runs all the linters and tests.
3636

3737
## Create or update parameters for docs
3838

39-
Add your new or updated parameters to `.golangci.reference.yml` so they will be shown in the docs
39+
Add your new or updated parameters to `.golangci.next.reference.yml` so they will be shown in the docs
4040

4141
## Submit a pull request
4242

docs/src/docs/usage/linters.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Linters
33
---
44

5-
import { FaGithub, FaGitlab } from "react-icons/fa";
5+
import { FaGithub, FaGitlab, FaArrowUp, FaCog } from "react-icons/fa";
66

77
To see a list of supported linters and which linters are enabled/disabled:
88

scripts/website/expand_templates/linters.go

+7-5
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,12 @@ func getLintersListMarkdown(enabled bool) string {
9090
}
9191

9292
func getName(lc *types.LinterWrapper) string {
93-
name := lc.Name
93+
name := spanWithID(listItemPrefix+lc.Name, "", "")
9494

95-
if hasSettings(lc.Name) {
96-
name = fmt.Sprintf("[%[1]s](#%[2]s \"%[1]s configuration\")", name, lc.Name)
95+
if hasSettings(lc.Name) && lc.Deprecation == nil {
96+
name += fmt.Sprintf("[%[1]s&nbsp;%[2]s](#%[1]s \"%[1]s configuration\")", lc.Name, "<FaCog size={'0.8rem'} />")
97+
} else {
98+
name += fmt.Sprintf("%[1]s[%[2]s](#%[2]s \"%[2]s has no configuration\")", spanWithID(lc.Name, "", ""), lc.Name)
9799
}
98100

99101
if lc.OriginalURL != "" {
@@ -102,7 +104,7 @@ func getName(lc *types.LinterWrapper) string {
102104
icon = "<FaGitlab size={'0.8rem'} />"
103105
}
104106

105-
name = fmt.Sprintf("%s&nbsp;[%s](%s)", name, spanWithID(listItemPrefix+lc.Name, lc.Name+" repository", icon), lc.OriginalURL)
107+
name += fmt.Sprintf("&nbsp;[%s](%s)", span(lc.Name+" repository", icon), lc.OriginalURL)
106108
}
107109

108110
if lc.Deprecation == nil {
@@ -322,7 +324,7 @@ func getLintersSettingSections(node, nextNode *yaml.Node) (string, error) {
322324

323325
_, _ = fmt.Fprintln(builder, "```")
324326
_, _ = fmt.Fprintln(builder)
325-
_, _ = fmt.Fprintf(builder, "[%s](#%s)\n\n", span("Back to the top", "🔼"), listItemPrefix+nextNode.Content[i].Value)
327+
_, _ = fmt.Fprintf(builder, "[%s](#%s)\n\n", span("Back to the top", "<FaArrowUp />"), listItemPrefix+nextNode.Content[i].Value)
326328
_, _ = fmt.Fprintln(builder)
327329
}
328330

0 commit comments

Comments
 (0)