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/src/docs/plugins/go-plugins.mdx
+18-15
Original file line number
Diff line number
Diff line change
@@ -48,29 +48,32 @@ An example linter can be found at [here](https://github.com/golangci/example-plu
48
48
If you're looking for instructions on how to configure your own custom linter, they can be found further down.
49
49
50
50
1. If the project you want to lint does not have one already, copy the [.golangci.yml](https://github.com/golangci/golangci-lint/blob/HEAD/.golangci.yml) to the root directory.
51
-
2. Adjust the YAML to appropriate `linters-settings.custom` entries as so:
51
+
2. Adjust the YAML to appropriate `linters.settings.custom` entries as so:
52
52
```yaml title=.golangci.yml
53
-
linters-settings:
54
-
custom:
55
-
example:
56
-
path: /example.so
57
-
description: The description of the linter
58
-
original-url: github.com/golangci/example-linter
59
-
settings: # Settings are optional.
60
-
one: Foo
61
-
two:
62
-
- name: Bar
63
-
three:
64
-
name: Bar
53
+
version: "2"
54
+
55
+
linters:
56
+
settings:
57
+
custom:
58
+
example:
59
+
path: /example.so
60
+
description: The description of the linter
61
+
original-url: github.com/golangci/example-linter
62
+
settings: # Settings are optional.
63
+
one: Foo
64
+
two:
65
+
- name: Bar
66
+
three:
67
+
name: Bar
65
68
```
66
69
67
70
That is all the configuration that is required to run a custom linter in your project.
68
71
69
72
Custom linters are enabled by default, but abide by the same rules as other linters.
70
73
71
-
If the disable all option is specified either on command line or in `.golang.yml` files `linters.disable-all: true`, custom linters will be disabled;
74
+
If the disable all option is specified either on command line or in `.golangci.yml` files `linters.default: none`, custom linters will be disabled;
72
75
they can be re-enabled by adding them to the `linters.enable` list,
73
76
or providing the enabled option on the command line, `golangci-lint run -Eexample`.
74
77
75
-
The configuration inside the `settings` field of linter have some limitations (there are NOT related to the plugin system itself):
78
+
The configuration inside the `linters.settings` field of linter have some limitations (there are NOT related to the plugin system itself):
76
79
we use Viper to handle the configuration but Viper put all the keys in lowercase, and `.` cannot be used inside a key.
0 commit comments