Skip to content

golangci-lint fails when run in a directory that is a symbolic link with "Can't process result by autogenerated_exclude processor:" #383

Closed
@Zamiell

Description

@Zamiell

Greetings and thanks again for the excellent (and free!) linting software!
I'm getting a weird warning message / error with golangci-lint that only occurs sometimes and not other times, independent of any edits that I make to the code. This leads me to believe that it might be some kind of race condition? Not really sure. I first encountered the issue a while back, but it went away, so I never bothered posting an issue, but now it is back.

  1. Version of golangci-lint: golangci-lint --version (or git commit if you don't use binary distribution)
golangci-lint has version v1.13.1 built from af080e7 on Thu Jan 24 20:57:52 UTC 2019
  1. Config file: cat .golangci.yml
linters:
  enable-all: true
  disable:
    - gochecknoglobals
    - goconst
    - gocritic
    - gocyclo
    - gofmt
    - maligned
    - unparam

issues:
  exclude:
    - "exported \\w+ (\\S*['.]*)([a-zA-Z'.*]*) should have comment or be unexported"
    - "if block ends with a return statement, so drop this else and outdent its block"
  1. Go environment: go version && go env
go version go1.11.4 linux/amd64
GOARCH="amd64"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/root/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-build767775208=/tmp/go-build -gno-record-gcc-switches"
  1. Verbose output of running: golangci-lint run -v
INFO [config_reader] Config search paths: [./ /root/hanabi-live/src /root/hanabi-live /root /]
INFO [config_reader] Used config file .golangci.yml
INFO [lintersdb] Active 24 linters: [deadcode depguard dupl errcheck gochecknoinits goimports golint gosec gosimple govet ineffassign interfacer lll misspell nakedret prealloc scopelint staticcheck structcheck stylecheck typecheck unconvert 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 3.229601748s
INFO [loader] SSA repr building timing: packages building 21.326545ms, total 307.573023ms
WARN [runner] Can't process result by autogenerated_exclude processor: can't filter issue result.Issue{FromLinter:"golint", Text:"exported type BannedIPs should have comment or be unexported", Pos:token.Position{Filename:"models/bannedIPs.go", Offset:49, Line:7, Column:6}, LineRange:(*result.Range)(nil), HunkPos:0, SourceLines:[]string(nil)}: can't parse file models/bannedIPs.go: <nil>
WARN [runner] Can't process result by autogenerated_exclude processor: can't filter issue result.Issue{FromLinter:"gosec", Text:"G304: Potential file inclusion via variable", Pos:token.Position{Filename:"commandGameStart.go", Offset:0, Line:318, Column:0}, LineRange:(*result.Range)(nil), HunkPos:0, SourceLines:[]string(nil)}: can't parse file commandGameStart.go: <nil>
WARN [runner] Can't process result by autogenerated_exclude processor: can't filter issue result.Issue{FromLinter:"errcheck", Text:"Error return value of `stmt.Close` is not checked", Pos:token.Position{Filename:"models/chatLog.go", Offset:344, Line:21, Column:18}, LineRange:(*result.Range)(nil), HunkPos:0, SourceLines:[]string(nil)}: can't parse file models/chatLog.go: <nil>
INFO [runner] worker.1 took 1.915756564s with stages: dupl: 1.188553471s, misspell: 304.362627ms, ineffassign: 163.225951ms, govet: 82.133912ms, interfacer: 58.164422ms, unconvert: 35.282504ms, varcheck: 27.82642ms, structcheck: 25.1429ms, prealloc: 15.215249ms, lll: 14.042109ms, typecheck: 13.438µs, depguard: 9.622µs
INFO [runner] worker.4 took 1.942397903s with stages: golint: 1.464915389s, gosec: 371.274608ms, deadcode: 63.350267ms, errcheck: 25.527854ms, nakedret: 11.178068ms, scopelint: 5.965369ms, gochecknoinits: 94.699µs
INFO [runner] worker.2 took 4.274691533s with stages: goimports: 4.274671218s
INFO [runner] worker.3 took 5.585760506s with stages: megacheck: 5.58572108s
INFO [runner] Workers idle times: #1: 3.669718801s, #2: 1.310162543s, #4: 3.64323339s
INFO [runner] Issues before processing: 249, after processing: 0
INFO [runner] processing took 143.86141ms with stages: exclude: 125.005477ms, skip_dirs: 10.091142ms, cgo: 6.462904ms, autogenerated_exclude: 1.416662ms, path_prettifier: 821.204µs, nolint: 8.682µs, max_same_issues: 8.016µs, source_code: 7.629µs, diff: 7.191µs, path_shortener: 7.125µs, max_from_linter: 6.577µs, uniq_by_line: 6.417µs, skip_files: 6.244µs, max_per_file_from_linter: 6.14µs
INFO Memory: 67 samples, avg is 537.8MB, max is 1016.3MB
INFO Execution took 9.169170071s

The repository in question that I am testing with it my Hanabi Live repostiory. To reproduce:

git clone https://github.com/Zamiell/hanabi-live.git
cd hanabi-live/src
golangci-lint run -v

Any ideas or tips?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions