nvim-lint: switch to .lint()

This commit is contained in:
rice-cracker-dev 2025-04-13 20:57:23 +07:00
commit 90d09ba05f

View file

@ -53,6 +53,8 @@ in {
if type(linter) == "function" then if type(linter) == "function" then
linter = linter() linter = linter()
end end
-- for require("lint").lint() to work, linter.name must be set
linter.name = linter.name or name
local cwd = linter.required_files local cwd = linter.required_files
-- if no configuration files are configured, lint -- if no configuration files are configured, lint
@ -61,8 +63,10 @@ in {
else else
-- if configuration files are configured and present in the project, lint -- if configuration files are configured and present in the project, lint
for _, fn in ipairs(cwd) do for _, fn in ipairs(cwd) do
if vim.uv.fs_stat(fn) then local path = vim.fs.joinpath(linter.cwd or vim.fn.getcwd(), fn);
require("lint").try_lint(name) if vim.uv.fs_stat(path) then
require("lint").lint(linter)
break
end end
end end
end end