Skip to content

Commit 9a36080

Browse files
committed
Temporary fix for markdownlint_cli2 not working on files with spaces
jose-elias-alvarez/null-ls.nvim#1256
1 parent a47412d commit 9a36080

File tree

1 file changed

+19
-9
lines changed

1 file changed

+19
-9
lines changed

home/private_dot_config/lvim/config.lua

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -146,15 +146,25 @@ vim.list_extend(lvim.lsp.override, { "gopls" })
146146
-- },
147147
-- }
148148

149-
-- -- set additional linters
150-
local linters = require("lvim.lsp.null-ls.linters")
151-
linters.setup({
152-
{
153-
-- { name = "markdownlint_cli2" },
154-
command = "markdownlint-cli2",
155-
args = { "$FILENAME" },
156-
},
157-
})
149+
require("null-ls").register{
150+
require("null-ls").builtins.diagnostics.markdownlint_cli2.with { args = { ":$FILENAME" }, generator_opts ={
151+
command = "markdownlint-cli2",
152+
from_stderr = true,
153+
format = "line",
154+
multiple_files = false,
155+
on_output = require("null-ls.helpers").diagnostics.from_patterns({
156+
{
157+
pattern = [[(%g+):(%d+):(%d+) ([%w-/]+) (.*)]],
158+
groups = { "filename", "row", "col", "code", "message" },
159+
},
160+
{
161+
pattern = [[(%g+):(%d+) ([%w-/]+) (.*)]],
162+
groups = { "filename", "row", "code", "message" },
163+
},
164+
}),
165+
},
166+
},
167+
}
158168

159169
-- local linters = require "lvim.lsp.null-ls.linters"
160170
-- linters.setup {

0 commit comments

Comments
 (0)