diff --git a/docs-preview-821/options.html b/docs-preview-821/options.html index b78db736..bb348c19 100644 --- a/docs-preview-821/options.html +++ b/docs-preview-821/options.html @@ -5824,6 +5824,76 @@ boolean
Example:
true
Declared by:
+
+
+<nvf/modules/plugins/diagnostics/nvim-lint/nvim-lint.nix>
+
+ |
vim.diagnostics.nvim-lint.lint_function
+
+
+Define the global function nvf_lint which is used by nvf to lint.
+ +Type: +luaInline
+ +Default:
{
+ _type = "lua-inline";
+ expr = ''
+ function(buf)
+ local ft = vim.api.nvim_get_option_value("filetype", { buf = buf })
+ local linters = require("lint").linters
+ local linters_from_ft = require("lint").linters_by_ft[ft]
+
+ -- if no linter is configured for this filetype, stops linting
+ if linters_from_ft == nil then return end
+
+ for _, name in ipairs(linters_from_ft) do
+ local linter = linters[name]
+ assert(linter, 'Linter with name `' .. name .. '` not available')
+
+ 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
+ if cwd == nil then
+ require("lint").lint(linter)
+ else
+ -- if configuration files are configured and present in the project, lint
+ for _, fn in ipairs(cwd) do
+ 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
+ end
+ end
+ '';
+}
+
+
+Example:
mkLuaInline ''
+ function(buf)
+ require("lint").try_lint()
+ end
+''
+
+
+
Declared by:
@@ -6058,6 +6128,37 @@ null or (luaInline)
Default:
Declared by: +
vim.diagnostics.nvim-lint.linters.<name>.required_files
+
+
+Required files to lint. These files must exist relative to the cwd +of the linter or else this linter will be skipped NoteThis option is an nvf extension that only takes effect if you
+use the See Type: +null or (list of string) + +Default:
+ Example:
+
Declared by: |