Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add link on linter without configuration #4843

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
2 changes: 1 addition & 1 deletion docs/src/docs/contributing/workflow.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion docs/src/docs/usage/linters.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
12 changes: 7 additions & 5 deletions scripts/website/expand_templates/linters.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 != "" {
Expand All @@ -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 {
Expand Down Expand Up @@ -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)
}

Expand Down
Loading