sonar-go
sonar-go copied to clipboard
Feature: Support golangci-lint linter
While being a fan of Gometalinter, there is a new option that is faster and easier to configure with support for all the other linters. https://github.com/golangci/golangci-lint
It does support getting the output as json that could easily be consumed. It already includes govet, golint, and all the linters that gometalinter includes plus several more.
@kenjones-cisco thanks for the idea, we will have a look and consider if we want to support it natively. However, you can quite easily import the issues if you are able to transform the output to the format described here https://docs.sonarqube.org/latest/analysis/generic-issue/
gometalinter is being deprecated in favour of golangci-lint.
I've started working on this here: https://github.com/srizzling/sonar-go/tree/add-native-golang-ci-support
Only snag I've hit is I can't find a severity from the outputs already listed (without reading a colorized output when redirecting to a file). Might need to modify golangci-lint
to be explicit.
Ok.. Looks like golangci-lint
itself reckons the default severity is error: https://github.com/golangci/golangci-lint/blob/master/pkg/printers/checkstyle.go#L31
Hi All, any update on this. I guess it will be required, as golangci-lint is getting popular
@dharmjit it's on plan but it will take some time, because we want to rewrite Go support in SonarQube from scratch. In the meanwhile I recommend to have a look at https://docs.sonarqube.org/latest/analysis/generic-issue/ as a way to import issues from any tool