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: README.md
+18-15Lines changed: 18 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -192,31 +192,34 @@ To enable `revive` in `golangci-lint` you need to add `revive` to the list of en
192
192
193
193
```yaml
194
194
# golangci-lint configuration file
195
+
version: "2"
195
196
linters:
196
197
enable:
197
198
- revive
198
199
```
199
-
Then `revive` can be configured by adding an entry to the `linters-settings` section of the configuration, for example:
200
+
201
+
Then `revive` can be configured by adding an entry to the `linters.settings` section of the configuration, for example:
200
202
201
203
```yaml
202
204
# golangci-lint configuration file
203
-
linters-settings:
204
-
revive:
205
-
ignore-generated-header: true
206
-
severity: warning
207
-
rules:
208
-
- name: atomic
209
-
- name: line-length-limit
210
-
severity: error
211
-
arguments: [80]
212
-
- name: unhandled-error
213
-
arguments : ["fmt.Printf", "myFunction"]
205
+
linters:
206
+
settings:
207
+
revive:
208
+
severity: warning
209
+
rules:
210
+
- name: atomic
211
+
- name: line-length-limit
212
+
severity: error
213
+
arguments: [80]
214
+
- name: unhandled-error
215
+
arguments: ["fmt.Printf", "myFunction"]
214
216
```
215
217
216
-
The above configuration enables three rules of `revive`: _atomic_, _line-length-limit_ and _unhandled-error_ and pass some arguments to the last two.
217
-
The [Configuration](#configuration) section of this document provides details on how to configure `revive`. Note that while `revive` configuration is in TOML, that of `golangci-lint` is in YAML.
218
+
The above configuration enables three rules of `revive`: _atomic_, _line-length-limit_ and _unhandled-error_ and passes some arguments to the last two.
219
+
The [Configuration](#configuration) section of this document provides details on how to configure `revive`. Note that while `revive` configuration is in TOML, that of `golangci-lint` is in YAML or JSON.
220
+
See the [golangci-lint website](https://golangci-lint.run/usage/linters/#revive) for more information about configuring `revive`.
218
221
219
-
Please notice that if no particular configuration is provided, `revive` will behave as `go-lint` does, i.e. all `go-lint` rules are enabled (the [Available Rules table](#available-rules) details what are the `go-lint` rules). When a configuration is provided, only rules in the configuration are enabled.
222
+
Please notice that if no particular configuration is provided, `revive` will behave as `golint` does, i.e. all `golint` rules are enabled (the [Available Rules table](#available-rules) details what are the `golint` rules). When a configuration is provided, only rules in the configuration are enabled.
0 commit comments