From 46e84491768a0e49565c3b35560da364b207e2a5 Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Thu, 14 Aug 2025 05:39:15 +0200 Subject: [PATCH 1/2] docs: improve wording about formatter as linter --- docs/content/docs/configuration/cli.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/content/docs/configuration/cli.md b/docs/content/docs/configuration/cli.md index 02f459d46667..bef000f201c7 100644 --- a/docs/content/docs/configuration/cli.md +++ b/docs/content/docs/configuration/cli.md @@ -14,9 +14,7 @@ weight: 1 {{< /cards >}} > [!NOTE] -> The formatters explicitly defined in the configuration section [`formatters`](/docs/configuration/file/#formatters-configuration) are automatically run by the command [`golangci-lint run`](/docs/configuration/cli/#run). -> -> You don't need to run [`golangci-lint fmt`](/docs/configuration/cli/#fmt) before [`golangci-lint run`](/docs/configuration/cli/#run) +> The formatters explicitly defined in the configuration section [`formatters`](/docs/configuration/file/#formatters-configuration) are automatically run (as linter) by the command [`golangci-lint run`](/docs/configuration/cli/#run). > > But the formatters cannot be enabled or disabled inside the `linters` section or the flags `-E/--enable`, `-D/--disable` of the command [`golangci-lint run`](/docs/configuration/cli/#run). > From 89c873cdc51162a7b6c5f6f7e8a48553b3325433 Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Thu, 14 Aug 2025 12:47:57 +0200 Subject: [PATCH 2/2] review --- docs/content/docs/configuration/cli.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/content/docs/configuration/cli.md b/docs/content/docs/configuration/cli.md index bef000f201c7..84547c3e512e 100644 --- a/docs/content/docs/configuration/cli.md +++ b/docs/content/docs/configuration/cli.md @@ -14,9 +14,13 @@ weight: 1 {{< /cards >}} > [!NOTE] -> The formatters explicitly defined in the configuration section [`formatters`](/docs/configuration/file/#formatters-configuration) are automatically run (as linter) by the command [`golangci-lint run`](/docs/configuration/cli/#run). +> This command executes enabled linters, and the formatters defined in [`formatters`](/docs/configuration/file/#formatters-configuration), +> but it does not format the code. > -> But the formatters cannot be enabled or disabled inside the `linters` section or the flags `-E/--enable`, `-D/--disable` of the command [`golangci-lint run`](/docs/configuration/cli/#run). +> To only format code, use [`golangci-lint fmt`](/docs/configuration/cli/#fmt). +> To apply both linter fixes and formatting, use `golangci-lint run --fix`. +> +> The formatters cannot be enabled or disabled inside the [`linters`](/docs/configuration/file/#linters-configuration) section or the flags `-E/--enable`, `-D/--disable` of the command [`golangci-lint run`](/docs/configuration/cli/#run). > > The formatters can be enabled/disabled by defining them inside the [`formatters`](/docs/configuration/file/#formatters-configuration) section or by using the flags `-E/--enable`, `-D/--disable` of command [`golangci-lint fmt`](/docs/configuration/cli/#fmt).