mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-06-10 23:13:17 +00:00
diagnostics/presets/cpplint: init
This commit is contained in:
parent
0e5f966c38
commit
036423b86e
4 changed files with 54 additions and 0 deletions
|
|
@ -96,6 +96,9 @@
|
|||
};
|
||||
clang-format.command = getExe' pkgs.clang-tools "clang-format";
|
||||
};
|
||||
|
||||
defaultDiagnosticsProvider = ["cpplint"];
|
||||
diagnosticsProviders = ["cpplint"];
|
||||
in {
|
||||
options.vim.languages.clang = {
|
||||
enable = mkEnableOption "C/C++ language support";
|
||||
|
|
@ -168,6 +171,21 @@ in {
|
|||
description = "C formatter to use";
|
||||
};
|
||||
};
|
||||
|
||||
extraDiagnostics = {
|
||||
enable =
|
||||
mkEnableOption "extra C/C++ diagnostics"
|
||||
// {
|
||||
default = config.vim.languages.enableExtraDiagnostics;
|
||||
defaultText = literalExpression "config.vim.languages.enableExtraDiagnostics";
|
||||
};
|
||||
|
||||
types = mkOption {
|
||||
type = listOf (enum diagnosticsProviders);
|
||||
default = defaultDiagnosticsProvider;
|
||||
description = "extra C/C++ diagnostics providers";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable (mkMerge [
|
||||
|
|
@ -211,5 +229,18 @@ in {
|
|||
};
|
||||
};
|
||||
})
|
||||
|
||||
(mkIf cfg.extraDiagnostics.enable {
|
||||
vim.diagnostics = {
|
||||
presets = genAttrs cfg.extraDiagnostics.types (_: {enable = true;});
|
||||
nvim-lint = {
|
||||
enable = true;
|
||||
linters_by_ft = {
|
||||
c = cfg.extraDiagnostics.types;
|
||||
cpp = cfg.extraDiagnostics.types;
|
||||
};
|
||||
};
|
||||
};
|
||||
})
|
||||
]);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue