uartois / sonar-golang

Sonarqube plugin for the golang language.
GNU Lesser General Public License v3.0
245 stars 32 forks source link

golangci-lint -> an integration with Sonar #74

Open SergiiOliinyk opened 5 years ago

SergiiOliinyk commented 5 years ago

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

thibaultfalque commented 5 years ago

Hello @SergiiOliinyk,

I will check if it's possible.

Thanks for your feedback.

SergiiOliinyk commented 5 years ago

@thibaultfalque thx!

thibaultfalque commented 5 years ago

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

SergiiOliinyk commented 5 years ago

@thibaultfalque thx!

SergiiOliinyk commented 5 years ago

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