Skip to content

Commit 8ef730c

Browse files
authored
docs(README): fix TOC, add empty lines (#1074)
1 parent 7fa1b27 commit 8ef730c

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

README.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,15 @@ Here's how `revive` is different from `golint`:
6666
<!-- TOC -->
6767

6868
- [revive](#revive)
69+
- [Who uses Revive](#who-uses-revive)
6970
- [Installation](#installation)
7071
- [Usage](#usage)
7172
- [Docker](#docker)
7273
- [Bazel](#bazel)
7374
- [Text Editors](#text-editors)
7475
- [GitHub Actions](#github-actions)
7576
- [Continuous Integration](#continuous-integration)
76-
- [Linter Aggregators](#linter-aggregators)
77+
- [Linter aggregators](#linter-aggregators)
7778
- [golangci-lint](#golangci-lint)
7879
- [Command Line Flags](#command-line-flags)
7980
- [Sample Invocations](#sample-invocations)
@@ -82,6 +83,7 @@ Here's how `revive` is different from `golint`:
8283
- [Default Configuration](#default-configuration)
8384
- [Custom Configuration](#custom-configuration)
8485
- [Recommended Configuration](#recommended-configuration)
86+
- [Rule-level file excludes](#rule-level-file-excludes)
8587
- [Available Rules](#available-rules)
8688
- [Configurable rules](#configurable-rules)
8789
- [`var-naming`](#var-naming)
@@ -93,12 +95,13 @@ Here's how `revive` is different from `golint`:
9395
- [Unix](#unix)
9496
- [SARIF](#sarif)
9597
- [Extensibility](#extensibility)
96-
- [Custom Rule](#writing-a-custom-rule)
98+
- [Writing a Custom Rule](#writing-a-custom-rule)
9799
- [Example](#example)
100+
- [Using `revive` as a library](#using-revive-as-a-library)
98101
- [Custom Formatter](#custom-formatter)
99102
- [Speed Comparison](#speed-comparison)
100103
- [golint](#golint)
101-
- [revive](#revive)
104+
- [revive's speed](#revives-speed)
102105
- [Overriding colorization detection](#overriding-colorization-detection)
103106
- [Contributors](#contributors)
104107
- [License](#license)
@@ -125,6 +128,7 @@ Since the default behavior of `revive` is compatible with `golint`, without prov
125128
`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.
126129

127130
### Docker
131+
128132
A volume must be mounted to share the current repository with the container.
129133
Please refer to the [bind mounts Docker documentation](https://docs.docker.com/storage/bind-mounts/)
130134

@@ -174,6 +178,7 @@ If you want to use revive with Bazel, look at the [rules](https://github.com/atl
174178
### Linter aggregators
175179

176180
#### golangci-lint
181+
177182
To enable `revive` in `golangci-lint` you need to add `revive` to the list of enabled linters:
178183

179184
```yaml
@@ -266,6 +271,7 @@ You can document why you disable the linter by adding a trailing text in the dir
266271
```go
267272
//revive:disable Until the code is stable
268273
```
274+
269275
```go
270276
//revive:disable:cyclomatic High complexity score but easy to understand
271277
```
@@ -332,6 +338,7 @@ For example:
332338
[rule.line-length-limit]
333339
Disabled = true
334340
```
341+
335342
When enabling all rules you still need/can provide specific configurations for rules.
336343
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:
337344

@@ -541,7 +548,6 @@ List of all available rules. The rules ported from `golint` are left unchanged a
541548
| [`max-control-nesting`](./RULES_DESCRIPTIONS.md#max-control-nesting) | int (defaults to 5) | Sets restriction for maximum nesting of control structures. | no | no |
542549
| [`comments-density`](./RULES_DESCRIPTIONS.md#comments-density) | int (defaults to 0) | Enforces a minimum comment / code relation | no | no |
543550

544-
545551
## Configurable rules
546552

547553
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
588594
![Unix formatter](/assets/formatter-unix.png)
589595

590596
### SARIF
597+
591598
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/).
592599

593600
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:
631638
A sample rule implementation can be found [here](/rule/argument-limit.go).
632639

633640
#### Using `revive` as a library
641+
634642
If a rule is specific to your use case
635643
(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.
636644

@@ -740,7 +748,7 @@ user 0m57.844s
740748
sys 0m9.146s
741749
```
742750

743-
### revive
751+
### revive's speed
744752

745753
```shell
746754
# no type checking

0 commit comments

Comments
 (0)