Skip to content

Commit

Permalink
✨ (plugin): add lint
Browse files Browse the repository at this point in the history
  • Loading branch information
elythh committed Jan 24, 2025
1 parent f5ac5af commit 849a7a2
Show file tree
Hide file tree
Showing 2 changed files with 94 additions and 0 deletions.
1 change: 1 addition & 0 deletions config/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
./plug/git/gitsigns.nix

./plug/lsp/conform.nix
./plug/lsp/lint.nix
./plug/lsp/lsp.nix
./plug/lsp/lspsaga.nix
./plug/lsp/none-ls.nix
Expand Down
93 changes: 93 additions & 0 deletions config/plug/lsp/lint.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
{
lib,
pkgs,
config,
...
}:
{
plugins = {
lint = {
enable = true;

lazyLoad.settings.event = "DeferredUIEnter";

lintersByFt = {
bash = [ "shellcheck" ];
c = [ "clangtidy" ];
css = lib.mkIf (!config.plugins.lsp.servers.stylelint_lsp.enable) [ "stylelint" ];
fish = [ "fish" ];
gdscript = [ "gdlint" ];
go = [ "golangcilint" ];
html = [ "htmlhint" ];
java = [ "checkstyle" ];
json = [ "jsonlint" ];
lua = [ "luacheck" ];
markdown = [ "markdownlint" ];
nix = [
"deadnix"
"nix"
] ++ lib.optionals (!config.plugins.lsp.servers.statix.enable) [ "statix" ];
python = [ "pylint" ];
rust = [ "clippy" ];
sh = [ "shellcheck" ];
sql = [ "sqlfluff" ];
terraform = [ "tflint" ];
yaml = [ "yamllint" ];
};

linters = {
checkmake = {
cmd = lib.getExe pkgs.checkmake;
};
checkstyle = {
cmd = lib.getExe pkgs.checkstyle;
};
clippy = {
cmd = lib.getExe pkgs.rust-analyzer;
};
deadnix = {
cmd = lib.getExe pkgs.deadnix;
};
fish = {
cmd = lib.getExe pkgs.fish;
};
golangcilint = {
cmd = lib.getExe pkgs.golangci-lint;
};
htmlhint = {
cmd = lib.getExe pkgs.htmlhint;
};
jsonlint = {
cmd = lib.getExe pkgs.nodePackages.jsonlint;
};
luacheck = {
cmd = lib.getExe pkgs.luaPackages.luacheck;
};
markdownlint = {
cmd = lib.getExe pkgs.markdownlint-cli;
};
pylint = {
cmd = lib.getExe pkgs.pylint;
};
shellcheck = {
cmd = lib.getExe pkgs.shellcheck;
};
sqlfluff = {
cmd = lib.getExe pkgs.sqlfluff;
};
statix = {
cmd = lib.getExe pkgs.statix;
};
stylelint = {
cmd = lib.getExe pkgs.stylelint;
};
terraform = {
cmd = lib.getExe pkgs.tflint;
};
yamllint = {
cmd = lib.getExe pkgs.yamllint;
};
};
};
};
}

0 comments on commit 849a7a2

Please sign in to comment.