From 90d09ba05f1460214759241ce08c0dc686eb0b32 Mon Sep 17 00:00:00 2001 From: rice-cracker-dev Date: Sun, 13 Apr 2025 20:57:23 +0700 Subject: [PATCH] nvim-lint: switch to .lint() --- modules/plugins/diagnostics/nvim-lint/config.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/plugins/diagnostics/nvim-lint/config.nix b/modules/plugins/diagnostics/nvim-lint/config.nix index e1ef789a..f1c2f8c2 100644 --- a/modules/plugins/diagnostics/nvim-lint/config.nix +++ b/modules/plugins/diagnostics/nvim-lint/config.nix @@ -53,6 +53,8 @@ in { if type(linter) == "function" then linter = linter() end + -- for require("lint").lint() to work, linter.name must be set + linter.name = linter.name or name local cwd = linter.required_files -- if no configuration files are configured, lint @@ -61,8 +63,10 @@ in { else -- if configuration files are configured and present in the project, lint for _, fn in ipairs(cwd) do - if vim.uv.fs_stat(fn) then - require("lint").try_lint(name) + local path = vim.fs.joinpath(linter.cwd or vim.fn.getcwd(), fn); + if vim.uv.fs_stat(path) then + require("lint").lint(linter) + break end end end