golangci-lint/.golangci.example.yml
Denis Isaev 2b587b63d6
Load AST for fast linters in different way.
Use build.Import instead of manual parser.ParseFile and paths traversal. It allows:
1. support build tags for all linters.
2. analyze files only for current GOOS/GOARCH: less false-positives.
3. analyze xtest packages (*_test) by golint: upstream golint and
gometalinter can't do it! And don't break analysis on the first xtest
package like it was before.
4. proper handling of xtest packages for linters like goconst where
package boundary is important: less false-positives is expected.

Also:
1. reuse AST parsing for golint and goconst: minor speedup.
2. allow to specify path (not only name) regexp for --skip-files and
--skip-dirs
3. add more default exclude filters for golint about commits:
`(comment on exported (method|function)|should have( a package)?
    comment|comment should be of the form)`
4. print skipped dir in verbose (-v) mode
5. refactor per-linter tests: declare arguments in comments, run only
one linter and in combination with slow linter
2018-06-10 23:46:24 +03:00

67 lines
1.0 KiB
YAML

run:
concurrency: 4
deadline: 1m
issues-exit-code: 1
tests: true
build-tags:
- mytag
skip-dirs:
- src/external_libs
- autogenerated_by_my_lib
skip-files:
- ".*\\.pb\\.go$"
- lib/bad.go
output:
format: colored-line-number
print-issued-lines: true
print-linter-name: true
linters-settings:
errcheck:
check-type-assertions: false
check-blank: false
govet:
check-shadowing: true
golint:
min-confidence: 0.8
gofmt:
simplify: true
gocyclo:
min-complexity: 10
maligned:
suggest-new: true
dupl:
threshold: 50
goconst:
min-len: 3
min-occurrences: 3
depguard:
list-type: blacklist
include-go-root: false
packages:
- github.com/davecgh/go-spew/spew
linters:
enable:
- megacheck
- vet
enable-all: true
disable:
maligned
disable-all: false
presets:
- bugs
- unused
fast: false
issues:
exclude:
- abcdef
exclude-use-default: true
max-per-linter: 0
max-same: 0
new: false
new-from-rev: ""
new-from-patch: ""