Skip to content

Commit

Permalink
Add svlint (#670)
Browse files Browse the repository at this point in the history
  • Loading branch information
DinDjarins authored Oct 3, 2024
1 parent 93b309e commit 5cda078
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ Other dedicated linters that are built-in are:
| [StandardRB][27] | `standardrb` |
| [statix check][33] | `statix` |
| [stylelint][29] | `stylelint` |
| [svlint][svlint] | `svlint` |
| [SwiftLint][swiftlint] | `swiftlint` |
| [systemd-analyze][systemd-analyze] | `systemd-analyze` |
| [systemdlint][systemdlint] | `systemdlint` |
Expand Down Expand Up @@ -577,4 +578,5 @@ busted tests/
[systemd-analyze]: https://man.archlinux.org/man/systemd-analyze.1
[awk]: https://www.gnu.org/software/gawk/
[yq]: https://mikefarah.gitbook.io/yq
[slang]: https://github.com/MikePopoloski/slang
[svlint]: https://github.com/dalance/svlint
[slang]: https://github.com/MikePopoloski/slang
17 changes: 17 additions & 0 deletions lua/lint/linters/svlint.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
local pattern = ".*(Fail)......([^:]+):(%d+):(%d+).*hint: (.+)%."
local groups = { "severity", "file", "lnum", "col", "message" }

local severities = {
["Fail"] = vim.diagnostic.severity.WARN,
}

return {
cmd = "svlint",
stdin = false,
stream = "stdout",
args = {
"--oneline",
},
ignore_exitcode = true,
parser = require("lint.parser").from_pattern(pattern, groups, severities, { ["source"] = "svlint" }),
}

0 comments on commit 5cda078

Please sign in to comment.