mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-05-20 22:08:47 +00:00
diagnostics/presets: init
This commit is contained in:
parent
cd45295f9c
commit
0735ee8cfd
49 changed files with 892 additions and 575 deletions
31
modules/plugins/diagnostics/presets/sqlfluff.nix
Normal file
31
modules/plugins/diagnostics/presets/sqlfluff.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.sqlfluff;
|
||||
in {
|
||||
options.vim.diagnostics.presets.sqlfluff = {
|
||||
enable = mkDiagnosticsPresetEnableOption "sqlfluff" "SQLFluff";
|
||||
|
||||
dialect = mkOption {
|
||||
type = str;
|
||||
default = "ansi";
|
||||
description = "SQL dialect to use for sqlfluff diagnostics";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
vim.diagnostics.nvim-lint.linters.sqlfluff = {
|
||||
cmd = getExe pkgs.sqlfluff;
|
||||
args = ["lint" "--format=json" "--dialect=${cfg.dialect}"];
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue