Skip to content

Commit c697c78

Browse files
committed
fix(lint): shrink the markdownlint override to args-only
the from_pattern parser required path:line:col, but markdownlint omits the column when unknown (e.g. MD012), so those findings were silently dropped. inheriting upstream's stdin mode + errorformat parser (whose "stdin:%l %m" fallback keeps col-less findings) fixes that; the file-based shape is no longer needed now that mise ships real node. stdin also means the buffer's live content is linted instead of the on-disk file. only the --config arg pointing at the global .markdownlint.yml remains overridden.
1 parent c53bd6e commit c697c78

1 file changed

Lines changed: 6 additions & 14 deletions

File tree

lua/modules/configs/completion/nvim-lint.lua

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,17 @@ return function()
1515
"-",
1616
}
1717
end,
18-
-- markdownlint-cli2: file-based mode + stderr parser date from the bun
19-
-- node-shim era (stdin's for-await yielded empty); mise ships real node
20-
-- now, so stdin likely works again — kept pending re-evaluation.
21-
-- NOTE (known limitation): the pattern requires "path:line:col", but
22-
-- upstream omits the column when unknown (e.g. MD012), so those
23-
-- findings are silently dropped.
18+
-- markdownlint-cli2: only add the global config — it discovers configs
19+
-- upward from the linted file, so projects without their own would
20+
-- otherwise fall back to factory defaults. stdin mode and the parser
21+
-- stay upstream's; its errorformat fallback ("stdin:%l %m") keeps
22+
-- findings whose column is unknown (e.g. MD012).
2423
["markdownlint-cli2"] = function(linter)
25-
linter.stdin = false
2624
linter.args = {
2725
"--config",
2826
vim.fn.stdpath("config") .. "/.markdownlint.yml",
27+
"-",
2928
}
30-
linter.stream = "stderr"
31-
linter.parser = require("lint.parser").from_pattern(
32-
"[^:]+:(%d+):(%d+) (%a+) (.+)",
33-
{ "lnum", "col", "severity", "message" },
34-
{ ["error"] = vim.diagnostic.severity.ERROR, ["warning"] = vim.diagnostic.severity.WARN },
35-
{ source = "markdownlint" }
36-
)
3729
end,
3830
}
3931
---@param name string

0 commit comments

Comments
 (0)