sonar-go icon indicating copy to clipboard operation
sonar-go copied to clipboard

Feature: Support golangci-lint linter

Open kenjones-cisco opened this issue 6 years ago • 6 comments

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 avatar Dec 04 '18 22:12 kenjones-cisco

@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/

saberduck avatar Dec 11 '18 09:12 saberduck

gometalinter is being deprecated in favour of golangci-lint.

mykter avatar Feb 28 '19 10:02 mykter

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.

srizzling avatar Mar 08 '19 20:03 srizzling

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

srizzling avatar Mar 08 '19 20:03 srizzling

Hi All, any update on this. I guess it will be required, as golangci-lint is getting popular

dharmjit avatar Jun 04 '19 05:06 dharmjit

@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

saberduck avatar Jun 04 '19 06:06 saberduck