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
@@ -125,6 +128,7 @@ Since the default behavior of `revive` is compatible with `golint`, without prov
125
128
`revive` supports a `-config` flag whose value should correspond to a TOML file describing which rules to use for `revive`'s linting. If not provided, `revive` will try to use a global config file (assumed to be located at `$HOME/revive.toml`). Otherwise, if no configuration TOML file is found then `revive` uses a built-in set of default linting rules.
126
129
127
130
### Docker
131
+
128
132
A volume must be mounted to share the current repository with the container.
129
133
Please refer to the [bind mounts Docker documentation](https://docs.docker.com/storage/bind-mounts/)
130
134
@@ -174,6 +178,7 @@ If you want to use revive with Bazel, look at the [rules](https://github.com/atl
174
178
### Linter aggregators
175
179
176
180
#### golangci-lint
181
+
177
182
To enable `revive` in `golangci-lint` you need to add `revive` to the list of enabled linters:
178
183
179
184
```yaml
@@ -266,6 +271,7 @@ You can document why you disable the linter by adding a trailing text in the dir
266
271
```go
267
272
//revive:disable Until the code is stable
268
273
```
274
+
269
275
```go
270
276
//revive:disable:cyclomatic High complexity score but easy to understand
271
277
```
@@ -332,6 +338,7 @@ For example:
332
338
[rule.line-length-limit]
333
339
Disabled = true
334
340
```
341
+
335
342
When enabling all rules you still need/can provide specific configurations for rules.
336
343
The following file is an example configuration where all rules are enabled, except for those that are explicitly disabled, and some rules are configured with particular arguments:
337
344
@@ -541,7 +548,6 @@ List of all available rules. The rules ported from `golint` are left unchanged a
541
548
|[`max-control-nesting`](./RULES_DESCRIPTIONS.md#max-control-nesting)| int (defaults to 5) | Sets restriction for maximum nesting of control structures. | no | no |
542
549
|[`comments-density`](./RULES_DESCRIPTIONS.md#comments-density)| int (defaults to 0) | Enforces a minimum comment / code relation | no | no |
543
550
544
-
545
551
## Configurable rules
546
552
547
553
Here you can find how you can configure some existing rules:
@@ -588,6 +594,7 @@ The unix formatter produces the same output as the default formatter but surroun
588
594

589
595
590
596
### SARIF
597
+
591
598
The `sarif` formatter produces outputs in SARIF, for _Static Analysis Results Interchange Format_, a standard JSON-based format for the output of static analysis tools defined and promoted by [OASIS](https://www.oasis-open.org/).
592
599
593
600
Current supported version of the standard is [SARIF-v2.1.0](https://docs.oasis-open.org/sarif/sarif/v2.1.0/csprd01/sarif-v2.1.0-csprd01.html
@@ -631,6 +638,7 @@ With the snippet above we:
631
638
A sample rule implementation can be found [here](/rule/argument-limit.go).
632
639
633
640
#### Using `revive` as a library
641
+
634
642
If a rule is specific to your use case
635
643
(i.e. it is not a good candidate to be added to `revive`'s rule set) you can add it to your linter using `revive` as a linting engine.
0 commit comments