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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What Problem
In a project with
.golancci.yml
containingoutput: 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 usualNo problems have been detected in the workspace so far.
in the problems view. Output in theOutput view > Go tab
shows only the normalFinished 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 togolangci-lint run --help
.Testing
I approximated tested by setting
"go.lintFlags": ["--out-format=colored-line-number"],
insettings.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.