From 8d015327254c9c5fc35b9142e7ada868f44ee8e3 Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Mon, 24 Jun 2024 17:56:33 +0200 Subject: [PATCH 01/10] chore: add FaLink --- docs/src/docs/usage/linters.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/docs/usage/linters.mdx b/docs/src/docs/usage/linters.mdx index 00fe3280bfc8..360f3dd90b64 100644 --- a/docs/src/docs/usage/linters.mdx +++ b/docs/src/docs/usage/linters.mdx @@ -2,7 +2,7 @@ title: Linters --- -import { FaGithub, FaGitlab } from "react-icons/fa"; +import { FaGithub, FaGitlab, FaLink } from "react-icons/fa"; To see a list of supported linters and which linters are enabled/disabled: From 799adf7381391c876f35cc3f0d84d64ee79ba428 Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Mon, 24 Jun 2024 17:58:45 +0200 Subject: [PATCH 02/10] docs: add link on linter without configuration --- scripts/website/expand_templates/linters.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/website/expand_templates/linters.go b/scripts/website/expand_templates/linters.go index 1b1e302395fe..1f49f9eb24f9 100644 --- a/scripts/website/expand_templates/linters.go +++ b/scripts/website/expand_templates/linters.go @@ -94,6 +94,8 @@ func getName(lc *types.LinterWrapper) string { if hasSettings(lc.Name) { name = fmt.Sprintf("[%[1]s](#%[2]s \"%[1]s configuration\")", name, lc.Name) + } else { + name = fmt.Sprintf("%s %s", lc.Name, "[](#"+listItemPrefix+lc.Name+")") } if lc.OriginalURL != "" { From 60069abd3693c16708eaca5fcdce8db289b7c66d Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Mon, 24 Jun 2024 18:12:04 +0200 Subject: [PATCH 03/10] docs: without icon --- docs/src/docs/usage/linters.mdx | 2 +- scripts/website/expand_templates/linters.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/src/docs/usage/linters.mdx b/docs/src/docs/usage/linters.mdx index 360f3dd90b64..00fe3280bfc8 100644 --- a/docs/src/docs/usage/linters.mdx +++ b/docs/src/docs/usage/linters.mdx @@ -2,7 +2,7 @@ title: Linters --- -import { FaGithub, FaGitlab, FaLink } from "react-icons/fa"; +import { FaGithub, FaGitlab } from "react-icons/fa"; To see a list of supported linters and which linters are enabled/disabled: diff --git a/scripts/website/expand_templates/linters.go b/scripts/website/expand_templates/linters.go index 1f49f9eb24f9..470d84d388ee 100644 --- a/scripts/website/expand_templates/linters.go +++ b/scripts/website/expand_templates/linters.go @@ -95,7 +95,7 @@ func getName(lc *types.LinterWrapper) string { if hasSettings(lc.Name) { name = fmt.Sprintf("[%[1]s](#%[2]s \"%[1]s configuration\")", name, lc.Name) } else { - name = fmt.Sprintf("%s %s", lc.Name, "[](#"+listItemPrefix+lc.Name+")") + name = fmt.Sprintf("%s [%s](#%s)", spanWithID(lc.Name, "", ""), name, lc.Name) } if lc.OriginalURL != "" { From ad83cb9d4c71d4996c8c230fd52c79bc9aec4b3a Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Mon, 24 Jun 2024 18:17:52 +0200 Subject: [PATCH 04/10] fix: back to the top link when the repo icon is not on the same line as the title --- scripts/website/expand_templates/linters.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/website/expand_templates/linters.go b/scripts/website/expand_templates/linters.go index 470d84d388ee..778c64d31311 100644 --- a/scripts/website/expand_templates/linters.go +++ b/scripts/website/expand_templates/linters.go @@ -104,7 +104,12 @@ func getName(lc *types.LinterWrapper) string { icon = "" } - name = fmt.Sprintf("%s [%s](%s)", name, spanWithID(listItemPrefix+lc.Name, lc.Name+" repository", icon), lc.OriginalURL) + name = fmt.Sprintf("%s%s [%s](%s)", + spanWithID(listItemPrefix+lc.Name, "", ""), + name, + span(lc.Name+" repository", icon), + lc.OriginalURL, + ) } if lc.Deprecation == nil { From 569f77c61c286add4de3018473490f2fe9b4e856 Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Mon, 24 Jun 2024 18:27:24 +0200 Subject: [PATCH 05/10] fix: back to the top link when no repo --- scripts/website/expand_templates/linters.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/scripts/website/expand_templates/linters.go b/scripts/website/expand_templates/linters.go index 778c64d31311..aec66621a265 100644 --- a/scripts/website/expand_templates/linters.go +++ b/scripts/website/expand_templates/linters.go @@ -90,12 +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) + name += fmt.Sprintf("[%[1]s](#%[1]s \"%[1]s configuration\")", lc.Name) } else { - name = fmt.Sprintf("%s [%s](#%s)", spanWithID(lc.Name, "", ""), name, lc.Name) + name += fmt.Sprintf("%[1]s[%[2]s](#%[2]s)", spanWithID(lc.Name, "", ""), lc.Name) } if lc.OriginalURL != "" { @@ -104,9 +104,7 @@ func getName(lc *types.LinterWrapper) string { icon = "" } - name = fmt.Sprintf("%s%s [%s](%s)", - spanWithID(listItemPrefix+lc.Name, "", ""), - name, + name += fmt.Sprintf(" [%s](%s)", span(lc.Name+" repository", icon), lc.OriginalURL, ) From 62eada9fa18143824d0bd5e972277240b486839d Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Mon, 24 Jun 2024 18:30:43 +0200 Subject: [PATCH 06/10] chore: format --- scripts/website/expand_templates/linters.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/scripts/website/expand_templates/linters.go b/scripts/website/expand_templates/linters.go index aec66621a265..443c4b7b9e04 100644 --- a/scripts/website/expand_templates/linters.go +++ b/scripts/website/expand_templates/linters.go @@ -104,10 +104,7 @@ func getName(lc *types.LinterWrapper) string { icon = "" } - name += fmt.Sprintf(" [%s](%s)", - span(lc.Name+" repository", icon), - lc.OriginalURL, - ) + name += fmt.Sprintf(" [%s](%s)", span(lc.Name+" repository", icon), lc.OriginalURL) } if lc.Deprecation == nil { From 95957a54de64d3b972d4b142c0f80cb703f96b84 Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Mon, 24 Jun 2024 18:35:56 +0200 Subject: [PATCH 07/10] docs: add title when no configuration --- scripts/website/expand_templates/linters.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/website/expand_templates/linters.go b/scripts/website/expand_templates/linters.go index 443c4b7b9e04..500ad91386d3 100644 --- a/scripts/website/expand_templates/linters.go +++ b/scripts/website/expand_templates/linters.go @@ -95,7 +95,7 @@ func getName(lc *types.LinterWrapper) string { if hasSettings(lc.Name) { name += fmt.Sprintf("[%[1]s](#%[1]s \"%[1]s configuration\")", lc.Name) } else { - name += fmt.Sprintf("%[1]s[%[2]s](#%[2]s)", spanWithID(lc.Name, "", ""), lc.Name) + name += fmt.Sprintf("%[1]s[%[2]s](#%[2]s \"%[2]s has no configuration\")", spanWithID(lc.Name, "", ""), lc.Name) } if lc.OriginalURL != "" { From 3fcc9ef5ccbf3444966ac026907a0068c670677a Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Wed, 26 Jun 2024 08:14:35 +0200 Subject: [PATCH 08/10] docs: next --- docs/src/docs/contributing/workflow.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/docs/contributing/workflow.mdx b/docs/src/docs/contributing/workflow.mdx index 531196b76e70..e534a27a9502 100644 --- a/docs/src/docs/contributing/workflow.mdx +++ b/docs/src/docs/contributing/workflow.mdx @@ -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 From 2b8e3f04504cc0b7474b840627695d87b8ff7ade Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Wed, 26 Jun 2024 08:33:42 +0200 Subject: [PATCH 09/10] chore: replace emoji by icon --- docs/src/docs/usage/linters.mdx | 2 +- scripts/website/expand_templates/linters.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/src/docs/usage/linters.mdx b/docs/src/docs/usage/linters.mdx index 00fe3280bfc8..a717d54b21af 100644 --- a/docs/src/docs/usage/linters.mdx +++ b/docs/src/docs/usage/linters.mdx @@ -2,7 +2,7 @@ title: Linters --- -import { FaGithub, FaGitlab } from "react-icons/fa"; +import { FaGithub, FaGitlab, FaArrowUp } from "react-icons/fa"; To see a list of supported linters and which linters are enabled/disabled: diff --git a/scripts/website/expand_templates/linters.go b/scripts/website/expand_templates/linters.go index 500ad91386d3..e79d250c06b9 100644 --- a/scripts/website/expand_templates/linters.go +++ b/scripts/website/expand_templates/linters.go @@ -324,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", ""), listItemPrefix+nextNode.Content[i].Value) _, _ = fmt.Fprintln(builder) } From 185e85cb55edc0b17c9bbd28dbf7a97d8f066efd Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Wed, 26 Jun 2024 09:03:22 +0200 Subject: [PATCH 10/10] docs: add an icon to display if a linter has a confiiguration or not --- docs/src/docs/usage/linters.mdx | 2 +- scripts/website/expand_templates/linters.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/src/docs/usage/linters.mdx b/docs/src/docs/usage/linters.mdx index a717d54b21af..d820b3327420 100644 --- a/docs/src/docs/usage/linters.mdx +++ b/docs/src/docs/usage/linters.mdx @@ -2,7 +2,7 @@ title: Linters --- -import { FaGithub, FaGitlab, FaArrowUp } 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: diff --git a/scripts/website/expand_templates/linters.go b/scripts/website/expand_templates/linters.go index e79d250c06b9..465f35e4b101 100644 --- a/scripts/website/expand_templates/linters.go +++ b/scripts/website/expand_templates/linters.go @@ -92,8 +92,8 @@ func getLintersListMarkdown(enabled bool) string { func getName(lc *types.LinterWrapper) string { name := spanWithID(listItemPrefix+lc.Name, "", "") - if hasSettings(lc.Name) { - name += fmt.Sprintf("[%[1]s](#%[1]s \"%[1]s configuration\")", lc.Name) + if hasSettings(lc.Name) && lc.Deprecation == nil { + name += fmt.Sprintf("[%[1]s %[2]s](#%[1]s \"%[1]s configuration\")", lc.Name, "") } else { name += fmt.Sprintf("%[1]s[%[2]s](#%[2]s \"%[2]s has no configuration\")", spanWithID(lc.Name, "", ""), lc.Name) }