I cannot get "exclude-use-default" in the configuration file to work. Passing this flag on the commandline works fine, but it seems to be ignored when put into the configuration file.
% cat .golangci.yml
exclude-use-default: false
3.
% go version && go env
go version go1.11.4 linux/amd64
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/redacted/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/redacted/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/lib/go-1.11"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go-1.11/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build829172362=/tmp/go-build -gno-record-gcc-switches"
4.
% ~/go/bin/golangci-lint -v run --enable-all ./...
INFO [config_reader] Config search paths: [./ /home/redacted/go/src/test /home/redacted/go/src /home/redacted/go /home/redacted /home /]
INFO [config_reader] Used config file .golangci.yml
INFO [lintersdb] Active 31 linters: [deadcode depguard dupl errcheck gochecknoglobals gochecknoinits goconst gocritic gocyclo gofmt goimports golint gosec gosimple govet ineffassign interfacer lll maligned misspell nakedret prealloc scopelint staticcheck structcheck stylecheck typecheck unconvert unparam unused varcheck]
INFO [lintersdb] Optimized sublinters [staticcheck gosimple unused stylecheck] into metalinter megacheck
INFO [loader] Go packages loading at mode load deps types and syntax took 495.256548ms
INFO [loader] SSA repr building timing: packages building 5.393507ms, total 39.802646ms
INFO [runner] worker.1 took 1.816816ms with stages: dupl: 902.678µs, gocritic: 403.379µs, unconvert: 281.715µs, ineffassign: 92.348µs, deadcode: 29.844µs, lll: 23.402µs, nakedret: 11.41µs, varcheck: 8.62µ
s, scopelint: 7.359µs, goconst: 7.214µs, prealloc: 6.426µs, structcheck: 5.25µs, maligned: 4.825µs, gochecknoinits: 1.677µs, gochecknoglobals: 1.658µs
INFO [runner] worker.5 took 1.585815ms with stages: gosec: 874.635µs, errcheck: 449.733µs, gofmt: 225.003µs, typecheck: 10.595µs, gocyclo: 8.754µs
INFO [runner] worker.2 took 16.911781ms with stages: golint: 16.905609ms
INFO [runner] worker.6 took 19.885151ms with stages: unparam: 19.870777ms
INFO [runner] worker.8 took 20.013524ms with stages: govet: 20.009502ms
INFO [runner] worker.3 took 22.062941ms with stages: interfacer: 22.043765ms, depguard: 11.785µs
INFO [runner] worker.7 took 41.068703ms with stages: misspell: 40.825008ms, goimports: 233.211µs
INFO [runner] worker.4 took 242.156868ms with stages: megacheck: 242.149501ms
INFO [runner] Workers idle times: #1: 239.994456ms, #2: 225.200391ms, #3: 220.0406ms, #5: 239.83248ms, #6: 221.961214ms, #7: 201.051468ms, #8: 221.743055ms
INFO [runner] Issues before processing: 1, after processing: 0
INFO [runner] processing took 2.311018ms with stages: identifier_marker: 1.909819ms, exclude: 319.795µs, autogenerated_exclude: 28.89µs, cgo: 23.688µs, path_prettifier: 15.333µs, skip_dirs: 8.964µs, max_same_issues: 1.087µs, nolint: 607ns, source_code: 456ns, diff: 430ns, replacement_builder: 322ns, uniq_by_line: 295ns, exclude-rules: 294ns, max_from_linter: 286ns, skip_files: 272ns, path_shortener: 243ns, max_per_file_from_linter: 237ns
INFO Memory: 9 samples, avg is 144.1MB, max is 205.1MB
INFO Execution took 812.597746ms
The exclude-use-default option needs to be under the issues object.
issues:
exclude-use-default: false
You aren't having this problem, but I did. golint is not enabled by default.
Whoops, sorry for the noise. This was absolutely the problem. Thanks!
Most helpful comment
The
exclude-use-defaultoption needs to be under theissuesobject.You aren't having this problem, but I did. golint is not enabled by default.