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

How to populate quickfix list #65

Open
issadarkthing opened this issue Aug 23, 2021 · 1 comment
Open

How to populate quickfix list #65

issadarkthing opened this issue Aug 23, 2021 · 1 comment
Labels
help wanted Extra attention is needed

Comments

@issadarkthing
Copy link

How do I populate the quickfix list with eslint errors?

@iamcco iamcco added the help wanted Extra attention is needed label Nov 26, 2021
@FalcoGer
Copy link

FalcoGer commented Nov 2, 2023

shellcheck outputs a fix when using it's JSON format.

test.sh

#!/bin/bash

echo `ls -al`

Running cat test.sh | shellcheck --format=json - | jq yields

[
  {
    "file": "-",
    "line": 3,
    "endLine": 3,
    "column": 6,
    "endColumn": 14,
    "level": "warning",
    "code": 2046,
    "message": "Quote this to prevent word splitting.",
    "fix": null
  },
  {
    "file": "-",
    "line": 3,
    "endLine": 3,
    "column": 6,
    "endColumn": 14,
    "level": "style",
    "code": 2005,
    "message": "Useless echo? Instead of 'echo $(cmd)', just use 'cmd'.",
    "fix": null
  },
  {
    "file": "-",
    "line": 3,
    "endLine": 3,
    "column": 6,
    "endColumn": 14,
    "level": "style",
    "code": 2006,
    "message": "Use $(...) notation instead of legacy backticks `...`.",
    "fix": {
      "replacements": [
        {
          "line": 3,
          "endLine": 3,
          "precedence": 7,
          "insertionPoint": "afterEnd",
          "column": 6,
          "replacement": "$(",
          "endColumn": 7
        },
        {
          "line": 3,
          "endLine": 3,
          "precedence": 7,
          "insertionPoint": "beforeStart",
          "column": 13,
          "replacement": ")",
          "endColumn": 14
        }
      ]
    }
  }
]

It would be neat if this was somehow capable of sending that on to coc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants