diff --git a/README.md b/README.md index e73cd719..d73c6471 100644 --- a/README.md +++ b/README.md @@ -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` | @@ -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 \ No newline at end of file diff --git a/lua/lint/linters/svlint.lua b/lua/lint/linters/svlint.lua new file mode 100644 index 00000000..59870655 --- /dev/null +++ b/lua/lint/linters/svlint.lua @@ -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" }), +}