Skip to content

Commit bd42c92

Browse files
authored
docs: improve wording about formatter as linter (#6006)
1 parent 2731071 commit bd42c92

File tree

1 file changed

+5
-3
lines changed
  • docs/content/docs/configuration

1 file changed

+5
-3
lines changed

docs/content/docs/configuration/cli.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,13 @@ weight: 1
1414
{{< /cards >}}
1515

1616
> [!NOTE]
17-
> 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).
17+
> This command executes enabled linters, and the formatters defined in [`formatters`](/docs/configuration/file/#formatters-configuration),
18+
> but it does not format the code.
1819
>
19-
> You don't need to run [`golangci-lint fmt`](/docs/configuration/cli/#fmt) before [`golangci-lint run`](/docs/configuration/cli/#run)
20+
> To only format code, use [`golangci-lint fmt`](/docs/configuration/cli/#fmt).
21+
> To apply both linter fixes and formatting, use `golangci-lint run --fix`.
2022
>
21-
> 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).
23+
> 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).
2224
>
2325
> 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).
2426

0 commit comments

Comments
 (0)