diagnostics/nvim-lint: init

This commit is contained in:
raf 2025-02-01 07:31:29 +03:00
parent b1ebf77826
commit da4b1d4bbe
No known key found for this signature in database
GPG key ID: EED98D11B85A2819
4 changed files with 56 additions and 0 deletions

View file

@ -0,0 +1,3 @@
{
imports = [./nvim-lint];
}

View file

@ -0,0 +1,20 @@
{
config,
lib,
...
}: let
inherit (lib.modules) mkIf;
inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.lua) toLuaObject;
cfg = config.vim.diagnostics.nvim-lint;
in {
config = mkIf cfg.enable {
vim = {
startPlugins = ["nvim-lint"];
pluginRC.nvim-lint = entryAnywhere ''
require("lint").setup(${toLuaObject cfg.setupOpts})
'';
};
};
}

View file

@ -0,0 +1,6 @@
{
imports = [
./nvim-lint.nix
./config.nix
];
}

View file

@ -0,0 +1,27 @@
{lib, ...}: let
inherit (lib.options) mkOption mkEnableOption;
inherit (lib.types) attrsOf listOf str;
inherit (lib.nvim.types) mkPluginSetupOption;
in {
options.vim.diagnostics.nvim-lint = {
enable = mkEnableOption "asynchronous linter plugin for Neovim [nvim-lint]";
setupOpts = mkPluginSetupOption "nvim-lint" {
linters_by_ft = mkOption {
type = attrsOf (listOf str);
default = {};
example = {
text = ["vale"];
markdown = ["vale"];
};
description = ''
Map of filetype to formatters. This option takes a set of
`key = value` format where the `value` will be converted
to its Lua equivalent. You are responsible for passing the
correct Nix data types to generate a correct Lua value that
conform is able to accept.
'';
};
};
};
}