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
1. Allow govet to work in 2 modes: fast and slow. Default is slow.
In fast mode golangci-lint runs `go install -i` and `go test -i`
for analyzed packages. But it's fast only when:
- go >= 1.10
- it's repeated run or $GOPATH/pkg or `go env GOCACHE` is cached
between CI builds
In slow mode we load program from source code like for another linters
and do it only once for all linters.
3. Patch govet code to warn about any troubles with the type
information. Default behaviour of govet was to hide such warnings.
Fail analysis if there are any troubles with type loading: it will
prevent false-positives and false-negatives from govet.
4. Describe almost all options in .golangci.example.yml and
include it into README. Describe when to use slow or fast mode of govet.
5. Speed up govet: reuse AST parsing: it's already parsed once by
golangci-lint.
For "slow" runs (when we run at least one slow linter) speedup by
not loading type information second time.
6. Improve logging, debug logging
Copy file name to clipboardExpand all lines: README.md
+154-3
Original file line number
Diff line number
Diff line change
@@ -84,7 +84,7 @@ GolangCI-Lint can be used with zero configuration. By default the following lint
84
84
```
85
85
$ golangci-lint linters
86
86
Enabled by default linters:
87
-
govet: Vet examines Go source code and reports suspicious constructs, such as Printf calls whose arguments do not align with the format string [fast: true]
87
+
govet: Vet examines Go source code and reports suspicious constructs, such as Printf calls whose arguments do not align with the format string [fast: false]
88
88
errcheck: Errcheck is a program for checking for unchecked errors in go programs. These unchecked errors can be critical bugs in some cases [fast: false]
89
89
staticcheck: Staticcheck is a go vet on steroids, applying a ton of static analysis checks [fast: false]
90
90
unused: Checks Go code for unused constants, variables, functions and types [fast: false]
@@ -310,10 +310,161 @@ To see which config file is being used and where it was sourced from run golangc
310
310
Config options inside the file are identical to command-line options.
311
311
You can configure specific linters' options only within the config file (not the command-line).
312
312
313
-
There is a [`.golangci.yml`](https://github.com/golangci/golangci-lint/blob/master/.golangci.example.yml) example config file with all supported options.
313
+
There is a [`.golangci.yml`](https://github.com/golangci/golangci-lint/blob/master/.golangci.example.yml) example
314
+
config file with all supported options, their description and default value:
315
+
```yaml
316
+
# This file contains all available configuration options
317
+
# with their default values.
318
+
319
+
# options for analysis running
320
+
run:
321
+
# default concurrency is a available CPU number
322
+
concurrency: 4
323
+
324
+
# timeout for analysis, e.g. 30s, 5m, default is 1m
325
+
deadline: 1m
326
+
327
+
# exit code when at least one issue was found, default is 1
328
+
issues-exit-code: 1
329
+
330
+
# include test files or not, default is true
331
+
tests: true
332
+
333
+
# list of build tags, all linters use it. Default is empty list.
334
+
build-tags:
335
+
- mytag
336
+
337
+
# which dirs to skip: they won't be analyzed;
338
+
# can use regexp here: generated.*, regexp is applied on full path;
339
+
# default value is empty list, but next dirs are always skipped independently
Copy file name to clipboardExpand all lines: README.md.tmpl
+6-2
Original file line number
Diff line number
Diff line change
@@ -200,10 +200,14 @@ To see which config file is being used and where it was sourced from run golangc
200
200
Config options inside the file are identical to command-line options.
201
201
You can configure specific linters' options only within the config file (not the command-line).
202
202
203
-
There is a [`.golangci.yml`](https://github.com/golangci/golangci-lint/blob/master/.golangci.example.yml) example config file with all supported options.
203
+
There is a [`.golangci.yml`](https://github.com/golangci/golangci-lint/blob/master/.golangci.example.yml) example
204
+
config file with all supported options, their description and default value:
205
+
```yaml
206
+
{{.GolangciYamlExample}}
207
+
```
204
208
205
209
It's a [.golangci.yml](https://github.com/golangci/golangci-lint/blob/master/.golangci.yml) config file of this repo: we enable more linters
0 commit comments