Skip to content
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

bug: linting with non-default revive -formatter fails silently #127

Open
ramya-rao-a opened this issue May 28, 2020 · 0 comments
Open

bug: linting with non-default revive -formatter fails silently #127

ramya-rao-a opened this issue May 28, 2020 · 0 comments
Labels
NeedsFix The path to resolution is known, but the work has not been done.

Comments

@ramya-rao-a
Copy link
Contributor

From microsoft/vscode-go#3083 by @orn688:

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 stamblerre added Debug Issues related to the debugging functionality of the extension. NeedsFix The path to resolution is known, but the work has not been done. and removed Debug Issues related to the debugging functionality of the extension. labels May 29, 2020
@stamblerre stamblerre changed the title Linting with non-default revive -formatter fails silently bug: linting with non-default revive -formatter fails silently Jun 3, 2020
@gopherbot gopherbot added this to the Untriaged milestone Apr 8, 2021
@stamblerre stamblerre modified the milestones: Untriaged, Backlog Apr 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

3 participants