docs: add link on linter without configuration (#4843)
This commit is contained in:
parent
c5998e14b8
commit
7745be9bca
@ -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
|
||||
|
||||
|
@ -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:
|
||||
|
||||
|
@ -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 %[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 [%s](%s)", name, spanWithID(listItemPrefix+lc.Name, lc.Name+" repository", icon), lc.OriginalURL)
|
||||
name += fmt.Sprintf(" [%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)
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user