Skip to content

Commit

Permalink
ci: add static type checking for neovim-nightly (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcjkb authored Nov 27, 2023
1 parent d483fe9 commit 14fa236
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 6 deletions.
58 changes: 57 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,59 @@
];
};

mkTypeCheck = {
nvim-api ? [],
disabled-diagnostics ? [],
}:
pre-commit-hooks.lib.${system}.run {
src = self;
hooks = {
lua-ls.enable = true;
};
settings = {
lua-ls = {
config = {
runtime.version = "LuaJIT";
Lua = {
workspace = {
library =
nvim-api
++ (with pkgs.lua51Packages; [
"${toml-edit}/lib/lua/5.1/"
"${toml}/lib/lua/5.1/"
"${nui-nvim}/share/lua/5.1"
])
++ [
"\${3rd}/busted/library"
"\${3rd}/luassert/library"
];
ignoreDir = [
".git"
".github"
".direnv"
"result"
"nix"
"doc"
"lua/nio"
];
};
diagnostics = {
libraryFiles = "Disable";
disable = disabled-diagnostics;
};
};
};
};
};
};

type-check-nightly = mkTypeCheck {
nvim-api = [
"${pkgs.neovim-nightly}/share/nvim/runtime/lua"
"${pkgs.vimPlugins.neodev-nvim}/types/nightly"
];
};

pre-commit-check = pre-commit-hooks.lib.${system}.run {
src = self;
hooks = {
Expand Down Expand Up @@ -102,7 +155,10 @@

# TODO: add integration-stable when ready
checks = {
lints = pre-commit-check;
inherit
pre-commit-check
type-check-nightly
;
inherit
(pkgs)
integration-nightly
Expand Down
14 changes: 9 additions & 5 deletions nix/plugin-overlay.nix
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,15 @@
in {
inherit lua5_1 lua51Packages;

vimPlugins.rocks-nvim = final.neovimUtils.buildNeovimPlugin {
pname = name;
version = "dev";
src = self;
};
vimPlugins =
prev.vimPlugins
// {
rocks-nvim = final.neovimUtils.buildNeovimPlugin {
pname = name;
version = "dev";
src = self;
};
};

neovim-with-rocks = let
neovimConfig = final.neovimUtils.makeNeovimConfig {
Expand Down

0 comments on commit 14fa236

Please sign in to comment.