mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-05-19 05:24:22 +00:00
diagnostics/presets: init
This commit is contained in:
parent
cd45295f9c
commit
0735ee8cfd
49 changed files with 892 additions and 575 deletions
|
|
@ -1,3 +1,6 @@
|
|||
{
|
||||
imports = [./nvim-lint];
|
||||
imports = [
|
||||
./nvim-lint
|
||||
./presets
|
||||
];
|
||||
}
|
||||
|
|
|
|||
20
modules/plugins/diagnostics/presets/biomejs.nix
Normal file
20
modules/plugins/diagnostics/presets/biomejs.nix
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.meta) getExe;
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.nvim.types) mkDiagnosticsPresetEnableOption;
|
||||
|
||||
cfg = config.vim.diagnostics.presets.biomejs;
|
||||
in {
|
||||
options.vim.diagnostics.presets.biomejs = {
|
||||
enable = mkDiagnosticsPresetEnableOption "biomejs" "Biome";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
vim.diagnostics.nvim-lint.linters.biomejs.cmd = getExe pkgs.biome;
|
||||
};
|
||||
}
|
||||
20
modules/plugins/diagnostics/presets/checkmake.nix
Normal file
20
modules/plugins/diagnostics/presets/checkmake.nix
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.meta) getExe;
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.nvim.types) mkDiagnosticsPresetEnableOption;
|
||||
|
||||
cfg = config.vim.diagnostics.presets.checkmake;
|
||||
in {
|
||||
options.vim.diagnostics.presets.checkmake = {
|
||||
enable = mkDiagnosticsPresetEnableOption "checkmake" "Checkmake";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
vim.diagnostics.nvim-lint.linters.checkmake.cmd = getExe pkgs.checkmake;
|
||||
};
|
||||
}
|
||||
20
modules/plugins/diagnostics/presets/deadnix.nix
Normal file
20
modules/plugins/diagnostics/presets/deadnix.nix
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.meta) getExe;
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.nvim.types) mkDiagnosticsPresetEnableOption;
|
||||
|
||||
cfg = config.vim.diagnostics.presets.deadnix;
|
||||
in {
|
||||
options.vim.diagnostics.presets.deadnix = {
|
||||
enable = mkDiagnosticsPresetEnableOption "deadnix" "Deadnix";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
vim.diagnostics.nvim-lint.linters.deadnix.cmd = getExe pkgs.deadnix;
|
||||
};
|
||||
}
|
||||
27
modules/plugins/diagnostics/presets/default.nix
Normal file
27
modules/plugins/diagnostics/presets/default.nix
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
imports = [
|
||||
./biomejs.nix
|
||||
./checkmake.nix
|
||||
./deadnix.nix
|
||||
./djlint.nix
|
||||
./dotenv-linter.nix
|
||||
./eslint_d.nix
|
||||
./golangci-lint.nix
|
||||
./hadolint.nix
|
||||
./htmlhint.nix
|
||||
./ktlint.nix
|
||||
./luacheck.nix
|
||||
./markdownlint-cli2.nix
|
||||
./mypy.nix
|
||||
./rubocop.nix
|
||||
./rumdl.nix
|
||||
./selene.nix
|
||||
./shellcheck.nix
|
||||
./sqlfluff.nix
|
||||
./sqruff.nix
|
||||
./statix.nix
|
||||
./stylelint.nix
|
||||
./taplo.nix
|
||||
./tombi.nix
|
||||
];
|
||||
}
|
||||
20
modules/plugins/diagnostics/presets/djlint.nix
Normal file
20
modules/plugins/diagnostics/presets/djlint.nix
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.meta) getExe;
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.nvim.types) mkDiagnosticsPresetEnableOption;
|
||||
|
||||
cfg = config.vim.diagnostics.presets.djlint;
|
||||
in {
|
||||
options.vim.diagnostics.presets.djlint = {
|
||||
enable = mkDiagnosticsPresetEnableOption "djlint" "djLint";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
vim.diagnostics.nvim-lint.linters.djlint.cmd = getExe pkgs.djlint;
|
||||
};
|
||||
}
|
||||
20
modules/plugins/diagnostics/presets/dotenv-linter.nix
Normal file
20
modules/plugins/diagnostics/presets/dotenv-linter.nix
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.meta) getExe;
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.nvim.types) mkDiagnosticsPresetEnableOption;
|
||||
|
||||
cfg = config.vim.diagnostics.presets.dotenv-linter;
|
||||
in {
|
||||
options.vim.diagnostics.presets.dotenv-linter = {
|
||||
enable = mkDiagnosticsPresetEnableOption "dotenv-linter" "Dotenv Linter";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
vim.diagnostics.nvim-lint.linters.dotenv-linter.cmd = getExe pkgs.dotenv-linter;
|
||||
};
|
||||
}
|
||||
30
modules/plugins/diagnostics/presets/eslint_d.nix
Normal file
30
modules/plugins/diagnostics/presets/eslint_d.nix
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.meta) getExe;
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.nvim.types) mkDiagnosticsPresetEnableOption;
|
||||
|
||||
cfg = config.vim.diagnostics.presets.eslint_d;
|
||||
in {
|
||||
options.vim.diagnostics.presets.eslint_d = {
|
||||
enable = mkDiagnosticsPresetEnableOption "eslint_d" "Eslint Daemon";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
vim.diagnostics.nvim-lint.linters.eslint_d = {
|
||||
cmd = getExe pkgs.eslint_d;
|
||||
required_files = [
|
||||
"eslint.config.js"
|
||||
"eslint.config.mjs"
|
||||
".eslintrc"
|
||||
".eslintrc.json"
|
||||
".eslintrc.js"
|
||||
".eslintrc.yml"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
96
modules/plugins/diagnostics/presets/golangci-lint.nix
Normal file
96
modules/plugins/diagnostics/presets/golangci-lint.nix
Normal file
|
|
@ -0,0 +1,96 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.meta) getExe;
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.generators) mkLuaInline;
|
||||
inherit (lib.nvim.types) mkDiagnosticsPresetEnableOption;
|
||||
|
||||
cfg = config.vim.diagnostics.presets.golangci-lint;
|
||||
in {
|
||||
options.vim.diagnostics.presets.golangci-lint = {
|
||||
enable = mkDiagnosticsPresetEnableOption "golangci-lint" "GolangCI Lint";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
vim.diagnostics.nvim-lint.linters.golangci-lint = {
|
||||
cmd = getExe pkgs.golangci-lint;
|
||||
args = [
|
||||
"run"
|
||||
"--output.json.path=stdout"
|
||||
"--issues-exit-code=0"
|
||||
"--show-stats=false"
|
||||
"--fix=false"
|
||||
"--path-mode=abs"
|
||||
# Overwrite values that could be configured and result in unwanted writes
|
||||
"--output.text.path="
|
||||
"--output.tab.path="
|
||||
"--output.html.path="
|
||||
"--output.checkstyle.path="
|
||||
"--output.code-climate.path="
|
||||
"--output.junit-xml.path="
|
||||
"--output.teamcity.path="
|
||||
"--output.sarif.path="
|
||||
];
|
||||
parser = mkLuaInline ''
|
||||
function(output, bufnr)
|
||||
local SOURCE = "golangci-lint";
|
||||
|
||||
local function display_tool_error(msg)
|
||||
return{
|
||||
{
|
||||
bufnr = bufnr,
|
||||
lnum = 0,
|
||||
col = 0,
|
||||
message = string.format("[%s] %s", SOURCE, msg),
|
||||
severity = vim.diagnostic.severity.ERROR,
|
||||
source = SOURCE,
|
||||
},
|
||||
}
|
||||
end
|
||||
|
||||
if output == "" then
|
||||
return display_tool_error("no output provided")
|
||||
end
|
||||
|
||||
local ok, decoded = pcall(vim.json.decode, output)
|
||||
if not ok then
|
||||
return display_tool_error("failed to parse JSON output")
|
||||
end
|
||||
|
||||
if not decoded or not decoded.Issues then
|
||||
return display_tool_error("unexpected output format")
|
||||
end
|
||||
|
||||
local severity_map = {
|
||||
error = vim.diagnostic.severity.ERROR,
|
||||
warning = vim.diagnostic.severity.WARN,
|
||||
info = vim.diagnostic.severity.INFO,
|
||||
hint = vim.diagnostic.severity.HINT,
|
||||
}
|
||||
local diagnostics = {}
|
||||
for _, issue in ipairs(decoded.Issues) do
|
||||
local sev = vim.diagnostic.severity.ERROR
|
||||
if issue.Severity and issue.Severity ~= "" then
|
||||
local normalized = issue.Severity:lower()
|
||||
sev = severity_map[normalized] or vim.diagnostic.severity.ERROR
|
||||
end
|
||||
table.insert(diagnostics, {
|
||||
bufnr = bufnr,
|
||||
lnum = issue.Pos.Line - 1,
|
||||
col = issue.Pos.Column - 1,
|
||||
message = issue.Text,
|
||||
code = issue.FromLinter,
|
||||
severity = sev,
|
||||
source = SOURCE,
|
||||
})
|
||||
end
|
||||
return diagnostics
|
||||
end
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
20
modules/plugins/diagnostics/presets/hadolint.nix
Normal file
20
modules/plugins/diagnostics/presets/hadolint.nix
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.meta) getExe;
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.nvim.types) mkDiagnosticsPresetEnableOption;
|
||||
|
||||
cfg = config.vim.diagnostics.presets.hadolint;
|
||||
in {
|
||||
options.vim.diagnostics.presets.hadolint = {
|
||||
enable = mkDiagnosticsPresetEnableOption "hadolint" "Hadolint";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
vim.diagnostics.nvim-lint.linters.hadolint.cmd = getExe pkgs.hadolint;
|
||||
};
|
||||
}
|
||||
20
modules/plugins/diagnostics/presets/htmlhint.nix
Normal file
20
modules/plugins/diagnostics/presets/htmlhint.nix
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.meta) getExe;
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.nvim.types) mkDiagnosticsPresetEnableOption;
|
||||
|
||||
cfg = config.vim.diagnostics.presets.htmlhint;
|
||||
in {
|
||||
options.vim.diagnostics.presets.htmlhint = {
|
||||
enable = mkDiagnosticsPresetEnableOption "htmlhint" "HTMLHint";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
vim.diagnostics.nvim-lint.linters.htmlhint.cmd = getExe pkgs.htmlhint;
|
||||
};
|
||||
}
|
||||
20
modules/plugins/diagnostics/presets/ktlint.nix
Normal file
20
modules/plugins/diagnostics/presets/ktlint.nix
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.meta) getExe;
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.nvim.types) mkDiagnosticsPresetEnableOption;
|
||||
|
||||
cfg = config.vim.diagnostics.presets.ktlint;
|
||||
in {
|
||||
options.vim.diagnostics.presets.ktlint = {
|
||||
enable = mkDiagnosticsPresetEnableOption "ktlint" "ktlint";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
vim.diagnostics.nvim-lint.linters.ktlint.cmd = getExe pkgs.ktlint;
|
||||
};
|
||||
}
|
||||
20
modules/plugins/diagnostics/presets/luacheck.nix
Normal file
20
modules/plugins/diagnostics/presets/luacheck.nix
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.meta) getExe;
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.nvim.types) mkDiagnosticsPresetEnableOption;
|
||||
|
||||
cfg = config.vim.diagnostics.presets.luacheck;
|
||||
in {
|
||||
options.vim.diagnostics.presets.luacheck = {
|
||||
enable = mkDiagnosticsPresetEnableOption "luacheck" "Luacheck";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
vim.diagnostics.nvim-lint.linters.luacheck.cmd = getExe pkgs.luajitPackages.luacheck;
|
||||
};
|
||||
}
|
||||
20
modules/plugins/diagnostics/presets/markdownlint-cli2.nix
Normal file
20
modules/plugins/diagnostics/presets/markdownlint-cli2.nix
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.meta) getExe;
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.nvim.types) mkDiagnosticsPresetEnableOption;
|
||||
|
||||
cfg = config.vim.diagnostics.presets.markdownlint-cli2;
|
||||
in {
|
||||
options.vim.diagnostics.presets.markdownlint-cli2 = {
|
||||
enable = mkDiagnosticsPresetEnableOption "markdownlint-cli2" "Markdownlint CLI 2";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
vim.diagnostics.nvim-lint.linters.markdownlint-cli2.cmd = getExe pkgs.markdownlint-cli2;
|
||||
};
|
||||
}
|
||||
20
modules/plugins/diagnostics/presets/mypy.nix
Normal file
20
modules/plugins/diagnostics/presets/mypy.nix
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.meta) getExe';
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.nvim.types) mkDiagnosticsPresetEnableOption;
|
||||
|
||||
cfg = config.vim.diagnostics.presets.mypy;
|
||||
in {
|
||||
options.vim.diagnostics.presets.mypy = {
|
||||
enable = mkDiagnosticsPresetEnableOption "mypy" "Mypy";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
vim.diagnostics.nvim-lint.linters.mypy.cmd = getExe' pkgs.mypy "mypy";
|
||||
};
|
||||
}
|
||||
20
modules/plugins/diagnostics/presets/rubocop.nix
Normal file
20
modules/plugins/diagnostics/presets/rubocop.nix
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.meta) getExe;
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.nvim.types) mkDiagnosticsPresetEnableOption;
|
||||
|
||||
cfg = config.vim.diagnostics.presets.rubocop;
|
||||
in {
|
||||
options.vim.diagnostics.presets.rubocop = {
|
||||
enable = mkDiagnosticsPresetEnableOption "rubocop" "RuboCop";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
vim.diagnostics.nvim-lint.linters.rubocop.cmd = getExe pkgs.rubyPackages.rubocop;
|
||||
};
|
||||
}
|
||||
20
modules/plugins/diagnostics/presets/rumdl.nix
Normal file
20
modules/plugins/diagnostics/presets/rumdl.nix
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.meta) getExe;
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.nvim.types) mkDiagnosticsPresetEnableOption;
|
||||
|
||||
cfg = config.vim.diagnostics.presets.rumdl;
|
||||
in {
|
||||
options.vim.diagnostics.presets.rumdl = {
|
||||
enable = mkDiagnosticsPresetEnableOption "rumdl" "Rumdl";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
vim.diagnostics.nvim-lint.linters.rumdl.cmd = getExe pkgs.rumdl;
|
||||
};
|
||||
}
|
||||
20
modules/plugins/diagnostics/presets/selene.nix
Normal file
20
modules/plugins/diagnostics/presets/selene.nix
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.meta) getExe;
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.nvim.types) mkDiagnosticsPresetEnableOption;
|
||||
|
||||
cfg = config.vim.diagnostics.presets.selene;
|
||||
in {
|
||||
options.vim.diagnostics.presets.selene = {
|
||||
enable = mkDiagnosticsPresetEnableOption "selene" "Selene";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
vim.diagnostics.nvim-lint.linters.selene.cmd = getExe pkgs.selene;
|
||||
};
|
||||
}
|
||||
20
modules/plugins/diagnostics/presets/shellcheck.nix
Normal file
20
modules/plugins/diagnostics/presets/shellcheck.nix
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.meta) getExe;
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.nvim.types) mkDiagnosticsPresetEnableOption;
|
||||
|
||||
cfg = config.vim.diagnostics.presets.shellcheck;
|
||||
in {
|
||||
options.vim.diagnostics.presets.shellcheck = {
|
||||
enable = mkDiagnosticsPresetEnableOption "shellcheck" "Shellcheck";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
vim.diagnostics.nvim-lint.linters.shellcheck.cmd = getExe pkgs.shellcheck;
|
||||
};
|
||||
}
|
||||
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}"];
|
||||
};
|
||||
};
|
||||
}
|
||||
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}" "-"];
|
||||
};
|
||||
};
|
||||
}
|
||||
20
modules/plugins/diagnostics/presets/statix.nix
Normal file
20
modules/plugins/diagnostics/presets/statix.nix
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.meta) getExe;
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.nvim.types) mkDiagnosticsPresetEnableOption;
|
||||
|
||||
cfg = config.vim.diagnostics.presets.statix;
|
||||
in {
|
||||
options.vim.diagnostics.presets.statix = {
|
||||
enable = mkDiagnosticsPresetEnableOption "statix" "Statix";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
vim.diagnostics.nvim-lint.linters.statix.cmd = getExe pkgs.statix;
|
||||
};
|
||||
}
|
||||
20
modules/plugins/diagnostics/presets/stylelint.nix
Normal file
20
modules/plugins/diagnostics/presets/stylelint.nix
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.meta) getExe;
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.nvim.types) mkDiagnosticsPresetEnableOption;
|
||||
|
||||
cfg = config.vim.diagnostics.presets.stylelint;
|
||||
in {
|
||||
options.vim.diagnostics.presets.stylelint = {
|
||||
enable = mkDiagnosticsPresetEnableOption "stylelint" "Stylelint";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
vim.diagnostics.nvim-lint.linters.stylelint.cmd = getExe pkgs.stylelint;
|
||||
};
|
||||
}
|
||||
23
modules/plugins/diagnostics/presets/taplo.nix
Normal file
23
modules/plugins/diagnostics/presets/taplo.nix
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.meta) getExe;
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.nvim.types) mkDiagnosticsPresetEnableOption;
|
||||
|
||||
cfg = config.vim.diagnostics.presets.taplo;
|
||||
in {
|
||||
options.vim.diagnostics.presets.taplo = {
|
||||
enable = mkDiagnosticsPresetEnableOption "taplo" "Taplo";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
vim.diagnostics.nvim-lint.linters.taplo = {
|
||||
cmd = getExe pkgs.taplo;
|
||||
args = ["lint"];
|
||||
};
|
||||
};
|
||||
}
|
||||
23
modules/plugins/diagnostics/presets/tombi.nix
Normal file
23
modules/plugins/diagnostics/presets/tombi.nix
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.meta) getExe;
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.nvim.types) mkDiagnosticsPresetEnableOption;
|
||||
|
||||
cfg = config.vim.diagnostics.presets.tombi;
|
||||
in {
|
||||
options.vim.diagnostics.presets.tombi = {
|
||||
enable = mkDiagnosticsPresetEnableOption "tombi" "Tombi";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
vim.diagnostics.nvim-lint.linters.tombi = {
|
||||
cmd = getExe pkgs.tombi;
|
||||
args = ["lint"];
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue