mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-06-24 13:24:39 +00:00
diagnostics/presets: init
This commit is contained in:
parent
29f7eb8491
commit
0e5f966c38
52 changed files with 958 additions and 634 deletions
31
modules/plugins/diagnostics/presets/sqruff.nix
Normal file
31
modules/plugins/diagnostics/presets/sqruff.nix
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.meta) getExe;
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.options) mkOption;
|
||||
inherit (lib.types) str;
|
||||
inherit (lib.nvim.types) mkDiagnosticsPresetEnableOption;
|
||||
|
||||
cfg = config.vim.diagnostics.presets.sqruff;
|
||||
in {
|
||||
options.vim.diagnostics.presets.sqruff = {
|
||||
enable = mkDiagnosticsPresetEnableOption "sqruff" "Sqruff";
|
||||
|
||||
dialect = mkOption {
|
||||
type = str;
|
||||
default = "ansi";
|
||||
description = "SQL dialect to use for sqruff diagnostics";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
vim.diagnostics.nvim-lint.linters.sqruff = {
|
||||
cmd = getExe pkgs.sqruff;
|
||||
args = ["lint" "--format=json" "--dialect=${cfg.dialect}" "-"];
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue