Skip to content

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

Open
@ramya-rao-a

Description

@ramya-rao-a

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions