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

jq cannot run: Linter command cmd.exe exited with code: 5 #651

Open
Ra2-IFV opened this issue Sep 6, 2024 · 5 comments
Open

jq cannot run: Linter command cmd.exe exited with code: 5 #651

Ra2-IFV opened this issue Sep 6, 2024 · 5 comments

Comments

@Ra2-IFV
Copy link

Ra2-IFV commented Sep 6, 2024

    lint.linters.jq_custom = {
      cmd = "jq",
      stdin = true,
      args = { "." },
      stream = "stderr",
      ignore_exitcode = false,
      parser = require("lint.parser").from_pattern(
        "^parse error: (.+) at line (%d+), column (%d+)$",
        { "message", "lnum", "col" },
        nil,
        nil,
        nil
      ), 
    }

if I ignore exit code, it still does nothing at all.
I googled for cmd exit status 5 and it looks like a permission problem, but jq worked well with :!cat % | jq .

@fredrikfoss
Copy link
Contributor

Remove the ^ in the pattern or append jq to it. jq errors start with jq (at least on Linux). Ex. error: jq: parse error: Expected ... line x, column y. Also, the exit status 5 is solved by setting ignore_exitcode to true as you described.

@Ra2-IFV
Copy link
Author

Ra2-IFV commented Sep 14, 2024

Something is wrong
Linter command ``cmd.exe`` exited with code: 5
It can't be cmd.exe, it should be jq.exe
Also, jq doen't has exit code 5

@Ra2-IFV
Copy link
Author

Ra2-IFV commented Sep 15, 2024

Remove the ^ in the pattern or append jq to it. jq errors start with jq (at least on Linux). Ex. error: jq: parse error: Expected ... line x, column y.

Tried but still not working.

@Ra2-IFV
Copy link
Author

Ra2-IFV commented Sep 15, 2024

Turns out there is a space at the end of the string

^jq: parse error: (.+) at line (%d+), column (%d+)%s$

Or simply remove the $ anchor.
Should I open a pull request for this? Not sure if someone else is having the same problem, or use %s? to match space instead.
I'm using bash from msys2 on Windows 10

@Ra2-IFV
Copy link
Author

Ra2-IFV commented Oct 3, 2024

Hello, hello? What should I do now?
It looks core devs are not very active...

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

No branches or pull requests

2 participants