mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-02-08 01:53:20 +00:00
diagnostics/nvim-lint: init
This commit is contained in:
parent
b1ebf77826
commit
da4b1d4bbe
4 changed files with 56 additions and 0 deletions
3
modules/plugins/diagnostics/default.nix
Normal file
3
modules/plugins/diagnostics/default.nix
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
imports = [./nvim-lint];
|
||||||
|
}
|
20
modules/plugins/diagnostics/nvim-lint/config.nix
Normal file
20
modules/plugins/diagnostics/nvim-lint/config.nix
Normal 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})
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
6
modules/plugins/diagnostics/nvim-lint/default.nix
Normal file
6
modules/plugins/diagnostics/nvim-lint/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./nvim-lint.nix
|
||||||
|
./config.nix
|
||||||
|
];
|
||||||
|
}
|
27
modules/plugins/diagnostics/nvim-lint/nvim-lint.nix
Normal file
27
modules/plugins/diagnostics/nvim-lint/nvim-lint.nix
Normal 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.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue