fix(vim): cspell linter will now work with newer versions
There was a breaking change / bug fix to the cspell that caused the error format to change.
This commit is contained in:
parent
584667ab3a
commit
bcab974cce
1 changed files with 29 additions and 27 deletions
|
|
@ -37,29 +37,31 @@ lint.linters.psalm = {
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
lint.linters.cspell = {
|
local get_language_id = function()
|
||||||
cmd = "cspell",
|
|
||||||
stdin = true,
|
|
||||||
args = {
|
|
||||||
"lint",
|
|
||||||
"--no-color",
|
|
||||||
"--no-progress",
|
|
||||||
"--no-summary",
|
|
||||||
"--config=" .. os.getenv("HOME") .. "/.cspell.json",
|
|
||||||
function()
|
|
||||||
local file_type = vim.api.nvim_buf_get_option(0, "filetype")
|
local file_type = vim.api.nvim_buf_get_option(0, "filetype")
|
||||||
return "--language-id=" .. file_type
|
return "--language-id=" .. file_type
|
||||||
end,
|
end
|
||||||
"--",
|
|
||||||
"stdin",
|
|
||||||
},
|
|
||||||
stream = "stdout",
|
|
||||||
parser = require("lint.parser").from_errorformat("/:%l:%c - %m", {
|
|
||||||
source = "cspell",
|
|
||||||
severity = vim.diagnostic.severity.INFO,
|
|
||||||
}),
|
|
||||||
}
|
|
||||||
|
|
||||||
|
lint.linters.cspell = {
|
||||||
|
cmd = 'cspell',
|
||||||
|
stdin = true,
|
||||||
|
ignore_exitcode = true,
|
||||||
|
args = {
|
||||||
|
'lint',
|
||||||
|
'--no-color',
|
||||||
|
'--no-progress',
|
||||||
|
'--no-summary',
|
||||||
|
"--config=" .. os.getenv("HOME") .. "/.cspell.json",
|
||||||
|
get_language_id,
|
||||||
|
'--',
|
||||||
|
'stdin'
|
||||||
|
},
|
||||||
|
stream = 'stdout',
|
||||||
|
parser = require('lint.parser').from_errorformat('%f:%l:%c - %m', {
|
||||||
|
source = 'cspell',
|
||||||
|
severity = vim.diagnostic.severity.INFO
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
lint.linters_by_ft = {
|
lint.linters_by_ft = {
|
||||||
php = {'phpcs'},
|
php = {'phpcs'},
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue