Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"--out-format" does not change output format #1170

Closed
3 tasks done
eskwayrd opened this issue May 29, 2020 · 3 comments
Closed
3 tasks done

"--out-format" does not change output format #1170

eskwayrd opened this issue May 29, 2020 · 3 comments
Labels
bug Something isn't working

Comments

@eskwayrd
Copy link

Thank you for creating the issue!

  • Yes, I'm using a binary release within 2 latest major releases. Only such installations are supported.
  • Yes, I've searched similar issues on GitHub and didn't find any.
  • Yes, I've included all information below (version, config, etc).

Please include the following information:

Version of golangci-lint
$ golangci-lint --version
golangci-lint has version 1.27.0 built from fb74c2e on 2020-05-13T18:45:55Z
Config file
$ cat .golangci.yml
cat: .golangci.yml: No such file or directory
Go environment
$ go version && go env
go version go1.12 darwin/amd64
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/eskwayrd/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/eskwayrd/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/lj/fgm_6fb14qg5qc7871zj_9f80000gn/T/go-build790526519=/tmp/go-build -gno-record-gcc-switches -fno-common"
Verbose output of running

First run, no output specified:

$ golangci-lint cache clean
$ golangci-lint run test.go
WARN [runner] Can't run linter goanalysis_metalinter: S1012: failed prerequisites: [(inspect@command-line-arguments, isgenerated@command-line-arguments): analysis skipped: errors in package: [/Users/eskwayrd/test.go:13:10: err declared but not used]] 
WARN [runner] Can't run linter unused: buildir: analysis skipped: errors in package: [/Users/eskwayrd/test.go:13:10: err declared but not used] 
ERRO Running error: buildir: analysis skipped: errors in package: [/Users/eskwayrd/test.go:13:10: err declared but not used] 

Second run, setting the output format to json:

$ golangci-lint run --out-format json test.go
WARN [runner] Can't run linter goanalysis_metalinter: S1033: failed prerequisites: [(inspect@command-line-arguments, isgenerated@command-line-arguments): analysis skipped: errors in package: [/Users/eskwayrd/test.go:13:10: err declared but not used]] 
WARN [runner] Can't run linter unused: buildir: analysis skipped: errors in package: [/Users/eskwayrd/test.go:13:10: err declared but not used] 
ERRO Running error: buildir: analysis skipped: errors in package: [/Users/eskwayrd/test.go:13:10: err declared but not used]

I would expect JSON output summarizing the errors, but no JSON is emitted.

Similarly, specifying any of the available output format causes the same output (as shown above) to be emitted every time.

If I'm doing something wrong, what is it?

@eskwayrd eskwayrd added the bug Something isn't working label May 29, 2020
@boring-cyborg
Copy link

boring-cyborg bot commented May 29, 2020

Hey, thank you for opening your first Issue ! 🙂 If you would like to contribute we have a guide for contributors.

@ryancurrah
Copy link
Member

ryancurrah commented May 29, 2020

Only issue results are printed to stdout in the out format you choose. Errors are printed too stderr like in your example. I think what you are looking for is similar to this issue: #1043

@eskwayrd
Copy link
Author

Ah, that explains it. I was unaware that build errors would prevent the lint report.

Indeed, a solution for #1043 would be handy.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants