Skip to content

Commit

Permalink
Add yq linter (#657)
Browse files Browse the repository at this point in the history
  • Loading branch information
fredrikfoss authored Sep 14, 2024
1 parent 0a6a544 commit 99cab0b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ Other dedicated linters that are built-in are:
| [woke][woke] | `woke` |
| [write-good][write-good] | `write_good` |
| [yamllint][yamllint] | `yamllint` |
| [yq][yq] | `yq` |
| [zsh][zsh] | `zsh` |

## Custom Linters
Expand Down Expand Up @@ -566,3 +567,4 @@ busted tests/
[hledger]: https://hledger.org/
[systemd-analyze]: https://man.archlinux.org/man/systemd-analyze.1
[awk]: https://www.gnu.org/software/gawk/
[yq]: https://mikefarah.gitbook.io/yq
10 changes: 10 additions & 0 deletions lua/lint/linters/yq.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
return {
cmd = "yq",
stdin = true,
stream = "stderr",
ignore_exitcode = true,
parser = require("lint.parser").from_pattern("line (%d+): (.+)", {
"lnum",
"message",
}, nil, { source = "yq" }),
}

0 comments on commit 99cab0b

Please sign in to comment.