Skip to content

golangci-lint v2 flags have changed #4781

Open
@offbyone

Description

@offbyone

Thank you for the bug report

  • I am using the latest version of lsp-mode related packages.
  • I checked FAQ and Troubleshooting sections
  • You may also try reproduce the issue using clean environment using the following command: M-x lsp-start-plain

Bug description

The flags defined in clients/lsp-golangci-lint.el are not compatible with v2 of golangci-lint:

(defun lsp-golangci-lint--get-initialization-options ()
  "Return initialization options for golangci-lint-langserver."
  (let ((opts (make-hash-table :test 'equal))
        (command (vconcat `(,lsp-golangci-lint-path)
                          ["run" "--out-format=json" "--issues-exit-code=1"]
                          (lsp-golangci-lint--run-args))))
    (puthash "command" command opts)
    opts))

The flag to output json has changed to --output.json.path=stdout: golangci/golangci-lint#5612

Steps to reproduce

  1. upgrade golangcli-lint to v2
  2. enable the LSP

Expected behavior

It should work

Which Language Server did you use?

golangci-lint

OS

MacOS

Error callstack

There's no error, it reports as a flycheck error

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions