Skip to content

Feature: New out-format gometalinter #638

Closed
@timme04

Description

@timme04

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already existsenhancementNew feature or improvementwon't fixThis will not be worked on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions