1

We have a pre-commit git hook locally set up that runs and for some reason I cannot get it to complete properly.

This is the command:

ENABLE_LINTERS="whitespace,bodyclose,dupl,exportloopref,gosec,bodyclose,errorlint,exportloopref,goconst,gocritic,gocyclo,gofmt,goprintffuncname,prealloc,stylecheck,unconvert"
DISABLE_LINTERS="unused"

golangci-lint run --verbose --out-format colored-line-number -E ${ENABLE_LINTERS} -D ${DISABLE_LINTERS} --timeout 10m0s --new-from-rev=HEAD~ ./...

And here are the logs:

INFO [config_reader] Config search paths: [./] 
INFO [lintersdb] Active 20 linters: [bodyclose dupl errcheck errorlint exportloopref goconst gocritic gocyclo gofmt goprintffuncname gosec gosimple govet ineffassign prealloc staticcheck stylecheck typecheck unconvert whitespace] 
INFO [loader] Go packages loading at mode 575 (deps|files|name|types_sizes|compiled_files|imports|exports_file) took 326.716291ms 
INFO [runner/filename_unadjuster] Pre-built 0 adjustments in 10.707875ms 

But it never finishes and after 10 min it times out, any idea what runner/filename_unadjuster is doing that would take 10m?

trever
  • 961
  • 2
  • 9
  • 28
  • First, fix obvious bugs. `golangci-lint ... runs linters in parallel,` You repeat `bodyclose`: `bodyclose,dupl,exportloopref,gosec,bodyclose,` A possible race condition. For readability, your list of linters should be sorted. – rocka2q Apr 24 '23 at 11:18

0 Answers0