Skip to content

Commit

Permalink
ci: add stable type check + update git-hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcjkb committed May 30, 2024
1 parent 5b5129c commit e52cfb8
Showing 1 changed file with 35 additions and 26 deletions.
61 changes: 35 additions & 26 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -62,33 +62,41 @@
];
};

luarc = pkgs.mk-luarc {
nvim = pkgs.neovim-nightly;
neodev-types = "nightly";
plugins = with pkgs.lua51Packages; [
toml-edit
toml
fidget-nvim
fzy
nvim-nio
];
disabled-diagnostics = [
# caused by a nio luaCATS bug
"redundant-return-value"
# we use @package to prevent lemmy-help from generating vimdoc
"invisible"
];
};

type-check-nightly = pre-commit-hooks.lib.${system}.run {
src = self;
hooks = {
lua-ls.enable = true;
mk-luarc = nvim:
pkgs.mk-luarc {
inherit nvim;
neodev-types = "nightly";
plugins = with pkgs.lua51Packages; [
toml-edit
toml
fidget-nvim
fzy
nvim-nio
];
disabled-diagnostics = [
# caused by a nio luaCATS bug
"redundant-return-value"
# we use @package to prevent lemmy-help from generating vimdoc
"invisible"
];
};
settings = {
lua-ls.config = luarc;

luarc-nightly = mk-luarc pkgs.neovim-nightly;
luarc-stable = mk-luarc pkgs.neovim-unwrapped;

mk-type-check = luarc:
pre-commit-hooks.lib.${system}.run {
src = self;
hooks = {
lua-ls = {
enable = true;
settings.configuration = luarc;
};
};
};
};

type-check-nightly = mk-type-check luarc-nightly;
type-check-stable = mk-type-check luarc-stable;

pre-commit-check = pre-commit-hooks.lib.${system}.run {
src = self;
Expand All @@ -104,7 +112,7 @@
name = "rocks.nvim devShell";
shellHook = ''
${pre-commit-check.shellHook}
ln -fs ${pkgs.luarc-to-json luarc} .luarc.json
ln -fs ${pkgs.luarc-to-json luarc-nightly} .luarc.json
'';
buildInputs =
self.checks.${system}.pre-commit-check.enabledPackages
Expand Down Expand Up @@ -139,6 +147,7 @@
checks = {
inherit
pre-commit-check
type-check-stable
type-check-nightly
;
inherit
Expand Down

0 comments on commit e52cfb8

Please sign in to comment.