language/kotlin: migrate to conform/nvim-lint

This commit is contained in:
Ching Pei Yang 2025-03-27 20:12:58 +01:00
parent b24999300b
commit 543deb5c2a
No known key found for this signature in database
GPG key ID: B3841364253DC4C8

View file

@ -7,7 +7,6 @@
inherit (lib.options) mkEnableOption mkOption literalExpression; inherit (lib.options) mkEnableOption mkOption literalExpression;
inherit (lib.modules) mkIf mkMerge; inherit (lib.modules) mkIf mkMerge;
inherit (lib.meta) getExe; inherit (lib.meta) getExe;
inherit (lib.nvim.languages) diagnosticsToLua;
inherit (lib.types) either package listOf str; inherit (lib.types) either package listOf str;
inherit (lib.nvim.types) mkGrammarOption diagnostics; inherit (lib.nvim.types) mkGrammarOption diagnostics;
inherit (lib.lists) isList; inherit (lib.lists) isList;
@ -19,14 +18,6 @@
diagnosticsProviders = { diagnosticsProviders = {
ktlint = { ktlint = {
package = pkgs.ktlint; package = pkgs.ktlint;
nullConfig = pkg: ''
table.insert(
ls_sources,
null_ls.builtins.diagnostics.ktlint.with({
command = "${getExe pkg}",
})
)
'';
}; };
}; };
in { in {
@ -76,11 +67,13 @@ in {
}) })
(mkIf cfg.extraDiagnostics.enable { (mkIf cfg.extraDiagnostics.enable {
vim.lsp.null-ls.enable = true; vim.diagnostics.nvim-lint = {
vim.lsp.null-ls.sources = diagnosticsToLua { enable = true;
lang = "kotlin"; linters_by_ft.kotlin = cfg.extraDiagnostics.types;
config = cfg.extraDiagnostics.types; linters = mkMerge (map (name: {
inherit diagnosticsProviders; ${name}.cmd = getExe diagnosticsProviders.${name}.package;
})
cfg.extraDiagnostics.types);
}; };
}) })