mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 06:53:01 +00:00
neovim: add a checkPhase in the wrapper
add a checkPhase (if doCheck == true, disabled by default) that tries to start neovim and fails in case of errors. It allows to catch small misconfiugurations before switching to a new config.
This commit is contained in:
parent
f937a3a20c
commit
31dc3e56e0
@ -55,11 +55,17 @@ let
|
||||
nvim-with-luasnip = wrapNeovim2 "-with-luasnip" (makeNeovimConfig {
|
||||
plugins = [ {
|
||||
plugin = vimPlugins.luasnip;
|
||||
|
||||
}
|
||||
];
|
||||
});
|
||||
|
||||
# build should fail with a wrong
|
||||
nvim-run-failing-check = (wrapNeovimUnstable neovim-unwrapped {
|
||||
luaRcContent = "this is an invalid lua statement to break the build";
|
||||
}).overrideAttrs({
|
||||
doCheck = true;
|
||||
});
|
||||
|
||||
nvimAutoDisableWrap = makeNeovimConfig { };
|
||||
|
||||
wrapNeovim2 = suffix: config:
|
||||
@ -96,6 +102,9 @@ in
|
||||
|
||||
inherit nmt;
|
||||
|
||||
# Disabled because of https://github.com/NixOS/nixpkgs/pull/352727
|
||||
# failed_check = pkgs.testers.testBuildFailure nvim-run-failing-check;
|
||||
|
||||
vim_empty_config = vimUtils.vimrcFile { beforePlugins = ""; customRC = ""; };
|
||||
|
||||
### neovim tests
|
||||
|
@ -61,7 +61,7 @@ let
|
||||
|
||||
stdenv.mkDerivation (finalAttrs:
|
||||
let
|
||||
pluginsNormalized = neovimUtils.normalizePlugins plugins;
|
||||
pluginsNormalized = neovimUtils.normalizePlugins finalAttrs.plugins;
|
||||
|
||||
myVimPackage = neovimUtils.normalizedPluginsToVimPackage pluginsNormalized;
|
||||
|
||||
@ -250,6 +250,13 @@ let
|
||||
# A Vim "package", see ':h packages'
|
||||
vimPackage = myVimPackage;
|
||||
|
||||
checkPhase = ''
|
||||
runHook preCheck
|
||||
|
||||
$out/bin/nvim -i NONE -e +quitall!
|
||||
runHook postCheck
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
inherit providerLuaRc packpathDirs;
|
||||
unwrapped = neovim-unwrapped;
|
||||
|
Loading…
Reference in New Issue
Block a user