You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/content/docs/configuration/cli.md
+6-2Lines changed: 6 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,9 +14,13 @@ weight: 1
14
14
{{< /cards >}}
15
15
16
16
> [!NOTE]
17
-
> 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).
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.
18
19
>
19
-
> 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).
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`.
22
+
>
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).
20
24
>
21
25
> 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).
0 commit comments