mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-09-07 10:51:36 +00:00
nvim-lint: switch to .lint()
This commit is contained in:
parent
2b62a441e9
commit
90d09ba05f
1 changed files with 6 additions and 2 deletions
|
@ -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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue