WIP
All checks were successful
ci/woodpecker/push/check Pipeline was successful

This commit is contained in:
Bruno BELANYI 2024-04-09 17:56:28 +01:00
parent f6e1266493
commit 045e505073
2 changed files with 37 additions and 0 deletions

View file

@ -41,11 +41,21 @@
eachDefaultSystem
(system:
let
inherit (nixpkgs) lib;
pkgs = import nixpkgs {
inherit system;
overlays = [ self.overlays.default ];
};
# FIXME: does it pickup the parser correctly?
nvim-test = pkgs.writeShellScriptBin "nvim-test" ''
export NVIM_PLENARY='${pkgs.vimPlugins.plenary-nvim}'
export NVIM_TREESITTER='${pkgs.vimPlugins.nvim-treesitter}'
${pkgs.neovim}/bin/nvim --headless --noplugin -u scripts/minimal_init.lua \
-c "PlenaryBustedDirectory test/ { minimal_init = '${./scripts/minimal_init.lua}' }"
'';
bump-version = pkgs.writeShellScriptBin "bump-version" ''
set -eu
@ -90,6 +100,13 @@
enable = true;
};
nvim-test = {
enable = true;
name = "nvim tests";
entry = "${lib.getExe nvim-test}";
pass_filenames = false;
};
tree-sitter = {
enable = true;
name = "tree-sitter tests";
@ -112,6 +129,7 @@
nativeBuildInputs = with pkgs; [
bump-version
nodejs
nvim-test
# FIXME: waiting on #301336
# (tree-sitter.override { webUISupport = true; })
tree-sitter

19
scripts/minimal_init.lua Normal file
View file

@ -0,0 +1,19 @@
vim.opt.runtimepath:append(os.getenv("NVIM_PLENARY"))
vim.opt.runtimepath:append(os.getenv("NVIM_TREESITTER"))
vim.cmd.runtime({ "plugin/plenary.vim", bang = true })
vim.cmd.runtime({ "plugin/nvim-treesitter.lua", bang = true })
vim.filetype.add({
extension = {
bp = "bp",
},
})
vim.o.swapfile = false
vim.bo.swapfile = false
require("nvim-treesitter.configs").setup({
indent = { enable = true },
highlight = { enable = true },
})