feat(linter): add ignore_exit option
This commit is contained in:
+4
-1
@@ -62,6 +62,8 @@ local util = require("util")
|
||||
---@field zero_idx_col? boolean
|
||||
--- Don't log stderr as errors (default: false)
|
||||
---@field ignore_stderr? boolean
|
||||
--- Don't check exit status (default: false)
|
||||
---@field ignore_exit? boolean
|
||||
--- Post-process diagnostics
|
||||
---@field hook? fun(self: ow.lsp.Linter, diagnostics: vim.Diagnostic[])
|
||||
|
||||
@@ -290,6 +292,7 @@ function Linter.validate(config)
|
||||
zero_idx_lnum = { config.zero_idx_lnum, "boolean", true },
|
||||
zero_idx_col = { config.zero_idx_col, "boolean", true },
|
||||
ignore_stderr = { config.ignore_stderr, "boolean", true },
|
||||
ignore_exit = { config.ignore_exit, "boolean", true },
|
||||
})
|
||||
end
|
||||
|
||||
@@ -400,7 +403,7 @@ function Linter:run()
|
||||
end)
|
||||
)
|
||||
|
||||
if not ok then
|
||||
if not self.config.ignore_exit and not ok then
|
||||
log.error("Failed to run %s: %s", self.config.cmd[1], resp)
|
||||
success = false
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user