Skip to content

Feature: New out-format gometalinter #638

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

Closed
timme04 opened this issue Aug 16, 2019 · 3 comments
Closed

Feature: New out-format gometalinter #638

timme04 opened this issue Aug 16, 2019 · 3 comments
Labels
duplicate This issue or pull request already exists enhancement New feature or improvement won't fix This will not be worked on

Comments

@timme04
Copy link

timme04 commented Aug 16, 2019

Hi,
thanks for your awesome work on golangci-lint.

For using golangci-lint in ci/cd pipelines together with our well established Sonarqube, it would be helpful, if golangci-lint could print a gometalinter compatible format.

The gometalinter-format is one of Sonarqubes supported formats when importing external issues. See https://docs.sonarqube.org/latest/analysis/external-issues/

Today I'm using a perl regular expression to reformat golangci's output to the gometalinter format, which sonarqube understands.
golangci-lint run --deadline=30m --out-format=line-number | perl -pe 's/(?<file>[^:]+):(?<line>\d+):(?<col>\d*): (?<message>.*)\((?<linter>[^\(]*)\)/$+{file}:$+{line}:$+{col}:error:$+{message}($+{linter})/g'
This is far from optimal, but works.

I could provide a pull request.
What do you think?

@tpounds tpounds added the enhancement New feature or improvement label Sep 25, 2019
@ryancurrah
Copy link
Member

ryancurrah commented Sep 26, 2019

Sonarqbue addressed this issue in July they have not updated the documentation to reflect it. Basically use the checkstyle out-format and the configuration syntax below for sonar-scanner.

sonar.go.golangci-lint.reportPaths=golangci-lint-report.xml

https://github.com/SonarSource/slang/blob/d75b521ab3f7b511d9735a5c7b13db3392cae4e9/sonar-go-plugin/src/main/java/org/sonar/go/externalreport/GolangCILintReportSensor.java#L31-L52

@jirfag jirfag added the won't fix This will not be worked on label Oct 4, 2019
@jirfag
Copy link
Contributor

jirfag commented Oct 4, 2019

hi, if you can use checkstyle output - it's not needed

@jirfag jirfag closed this as completed Oct 4, 2019
@tpounds
Copy link
Contributor

tpounds commented Oct 4, 2019

A similar request was made in #228. As @jirfag mentioned several additional output formats have been added that should fulfill the requirements of this request.

@tpounds tpounds added the duplicate This issue or pull request already exists label Oct 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists enhancement New feature or improvement won't fix This will not be worked on
Projects
None yet
Development

No branches or pull requests

4 participants