docs: add link on linter without configuration (#4843)

This commit is contained in:
Ludovic Fernandez 2024-07-03 13:29:53 +02:00 committed by GitHub
parent c5998e14b8
commit 7745be9bca
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 9 additions and 7 deletions

View File

@ -36,7 +36,7 @@ Which runs all the linters and tests.
## Create or update parameters for docs
Add your new or updated parameters to `.golangci.reference.yml` so they will be shown in the docs
Add your new or updated parameters to `.golangci.next.reference.yml` so they will be shown in the docs
## Submit a pull request

View File

@ -2,7 +2,7 @@
title: Linters
---
import { FaGithub, FaGitlab } from "react-icons/fa";
import { FaGithub, FaGitlab, FaArrowUp, FaCog } from "react-icons/fa";
To see a list of supported linters and which linters are enabled/disabled:

View File

@ -90,10 +90,12 @@ func getLintersListMarkdown(enabled bool) string {
}
func getName(lc *types.LinterWrapper) string {
name := lc.Name
name := spanWithID(listItemPrefix+lc.Name, "", "")
if hasSettings(lc.Name) {
name = fmt.Sprintf("[%[1]s](#%[2]s \"%[1]s configuration\")", name, lc.Name)
if hasSettings(lc.Name) && lc.Deprecation == nil {
name += fmt.Sprintf("[%[1]s&nbsp;%[2]s](#%[1]s \"%[1]s configuration\")", lc.Name, "<FaCog size={'0.8rem'} />")
} else {
name += fmt.Sprintf("%[1]s[%[2]s](#%[2]s \"%[2]s has no configuration\")", spanWithID(lc.Name, "", ""), lc.Name)
}
if lc.OriginalURL != "" {
@ -102,7 +104,7 @@ func getName(lc *types.LinterWrapper) string {
icon = "<FaGitlab size={'0.8rem'} />"
}
name = fmt.Sprintf("%s&nbsp;[%s](%s)", name, spanWithID(listItemPrefix+lc.Name, lc.Name+" repository", icon), lc.OriginalURL)
name += fmt.Sprintf("&nbsp;[%s](%s)", span(lc.Name+" repository", icon), lc.OriginalURL)
}
if lc.Deprecation == nil {
@ -322,7 +324,7 @@ func getLintersSettingSections(node, nextNode *yaml.Node) (string, error) {
_, _ = fmt.Fprintln(builder, "```")
_, _ = fmt.Fprintln(builder)
_, _ = fmt.Fprintf(builder, "[%s](#%s)\n\n", span("Back to the top", "🔼"), listItemPrefix+nextNode.Content[i].Value)
_, _ = fmt.Fprintf(builder, "[%s](#%s)\n\n", span("Back to the top", "<FaArrowUp />"), listItemPrefix+nextNode.Content[i].Value)
_, _ = fmt.Fprintln(builder)
}