mirror of
https://github.com/scratchfoundation/golangci-lint.git
synced 2025-08-01 08:58:56 -04:00
doc: improve documentation about debugging. (#3434)
This commit is contained in:
parent
ab8a120755
commit
cca68dcffe
2 changed files with 24 additions and 15 deletions
docs/src/docs/contributing
|
@ -4,12 +4,21 @@ title: Debugging
|
|||
|
||||
You can see a verbose output of linter by using `-v` option.
|
||||
|
||||
If you would like to see more detailed logs you can set environment variable `GL_DEBUG` to debug `golangci-lint`.
|
||||
It's value is a list of debug tags. For example, `GL_DEBUG=loader,gocritic golangci-lint run`.
|
||||
Existing debug tags:
|
||||
```bash
|
||||
golangci-lint run -v
|
||||
```
|
||||
|
||||
1. `gocritic` - debug `go-critic` linter;
|
||||
2. `env` - debug `go env` command;
|
||||
3. `loader` - debug packages loading (including `go/packages` internal debugging);
|
||||
4. `autogen_exclude` - debug a filter excluding autogenerated source code;
|
||||
5. `nolint` - debug a filter excluding issues by `//nolint` comments.
|
||||
If you would like to see more detailed logs you can use the environment variable `GL_DEBUG`.
|
||||
Its value is a list of debug tags.
|
||||
|
||||
The existing debug tags are documented in the following file: https://github.com/golangci/golangci-lint/blob/master/pkg/logutils/logutils.go
|
||||
|
||||
For example:
|
||||
|
||||
```bash
|
||||
GL_DEBUG="loader,gocritic" golangci-lint run
|
||||
```
|
||||
|
||||
```bash
|
||||
GL_DEBUG="loader,env" golangci-lint run
|
||||
```
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue