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

Linting with non-default revive -formatter fails silently #3083

Closed
orn688 opened this issue Mar 3, 2020 · 2 comments
Closed

Linting with non-default revive -formatter fails silently #3083

orn688 opened this issue Mar 3, 2020 · 2 comments

Comments

@orn688
Copy link

orn688 commented Mar 3, 2020

What version of Go, VS Code & VS Code Go extension are you using?

  • go version: go version go1.14 linux/amd64
  • VS Code version: 1.40.2
  • Go extension version: 0.13.1
  • GOOS/GOARCH: linux/amd64

Share the Go related settings you have added/edited

{
    "go.lintTool": "revive",
    "go.lintFlags": ["-formatter=stylish"],
    "go.testTimeout": "10s",
    "go.useLanguageServer": true,
    "go.autocompleteUnimportedPackages": true,
    "go.languageServerFlags": [
        "-rpc.trace"
    ],
    "go.lintOnSave": "file",
    "go.vetOnSave": "package",
    "go.formatFlags": [
        "-s"
    ],
    "go.formatTool": "gofmt",
    "go.toolsEnvVars": {
        "GO111MODULE": "on",
    },
    "[go]": {
        "editor.snippetSuggestions": "none",
        "editor.codeActionsOnSave": {
            "source.organizeImports": true
        },
        "editor.formatOnSave": true
    }
}

Describe the bug

With "go.lintTool" set to "revive and "-formatter=stylish" in "go.lintFlags", linting silently falis. In the "Go" section of output, I see the following:

Started linting the current file at /path/to/package/file.go
/path/to/package>Finished running tool: /path/to/revive -formatter=stylish /path/to/package/file.go

Presumably this is because the Go extension is unable to parse the "stylish" output from revive. This isn't the end of the world since I don't mind using the default output, but it took a long time to figure out why I wasn't getting any linter output because the parsing failed silently and I didn't get any sort of warning that the revive output was not being parsed by the extension. It would be nice to at least get an alert saying that the extension couldn't parse the linter output.

Steps to reproduce the behavior:

  1. Copy the "go.lintTool" and "go.lintFlags" settings from above.
  2. Try to run linting on a go file.
@stamblerre
Copy link
Contributor

Thanks for reporting this issue! We'll take a look.

@ramya-rao-a
Copy link
Contributor

ramya-rao-a commented May 28, 2020

Hey @orn688,

We are in the midst of a repo move, see We are moving section in our readme for more details.

Closing this issue in favor of golang/vscode-go#127. Please subscribe to it for further updates

Thanks for all the support & Happy Coding!

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

No branches or pull requests

3 participants