Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

golangci-lint --out-format=colored-line-number #3112

Merged
merged 2 commits into from
Mar 20, 2020

Conversation

CarltonHenderson
Copy link
Contributor

@CarltonHenderson CarltonHenderson commented Mar 18, 2020

What Problem

In a project with .golancci.yml containing output: format: checkstyle (many formats other than checkstyle probably cause the same bug.) vscode will fail to parse warning output from golangci-lint with no discernible error message other than the usual No problems have been detected in the workspace so far. in the problems view. Output in the Output view > Go tab shows only the normal Finished running tool: /home/user/go/bin/golangci-lint run --print-issued-lines=false

Solution

Let's be explicit about a format that we do understand. I chose colored-line-number because that's golangci-lint's default according to golangci-lint run --help.

Testing

I approximated tested by setting "go.lintFlags": ["--out-format=colored-line-number"], in settings.json and watching the command come up in the Output view > Go tab. Unfortunately, I don't currently have time to build the extension, sideload it, write tests, run tests, etc.

What Problem
===============

In a project with .golancci.yml with `output: format: checkstyle` vscode will fail to parse warning output from golangci-lint. Other formats probably confuse this extension too.

Solution
--------------

 Let's be explicit about a format that we do understand. I chose `colored-line-number` because that's golangci-lint's default according to `golangci-lint run --help`.
Copy link
Contributor

@ramya-rao-a ramya-rao-a left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@CarltonHenderson,

Looks like this is your first PR contribution to this project, Thanks & Welcome!

@ramya-rao-a ramya-rao-a merged commit 38af15a into microsoft:master Mar 20, 2020
@ramya-rao-a
Copy link
Contributor

You can try out the change in this PR in the latest beta version of this extension

@ramya-rao-a
Copy link
Contributor

This change is now available in the latest version of this extension.

Thanks @CarltonHenderson!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants