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

golangci-lint -> an integration with Sonar

Open SergiiOliinyk opened this issue 7 years ago • 5 comments

Would u consider to implement an integration golangci-lint with Sonar ? https://github.com/golangci/golangci-lint

SergiiOliinyk avatar Sep 24 '18 14:09 SergiiOliinyk

Hello @SergiiOliinyk,

I will check if it's possible.

Thanks for your feedback.

thibaultfalque avatar Mar 29 '19 09:03 thibaultfalque

@thibaultfalque thx!

SergiiOliinyk avatar Mar 29 '19 09:03 SergiiOliinyk

Hello @SergiiOliinyk

I tried to use golangci-lint with the plugin. Because it does not use exactly the same format many violations are not displayed, even though some are.

I am going to update the plugin to consider the violations which are not recognized.

You can still execute the plugin (but violations will be missing). To do so, you will need to create the yaml file specified in the documentation of golangci-lint, and to edit it to comply with the plugin's expected input format, which must be checkstyle, as in the following:


# [...]

output:
  # colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number"
  format: checkstyle

To execute the analysis, you need to run: golangci-lint run -c .golangci.yml > report.xml

thibaultfalque avatar Apr 04 '19 11:04 thibaultfalque

@thibaultfalque thx!

SergiiOliinyk avatar Apr 04 '19 21:04 SergiiOliinyk

Hi @thibaultfalque did u have a chance to look into the plugin ?

SergiiOliinyk avatar May 06 '19 09:05 SergiiOliinyk