push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,145 @@
#shellcheck shell=bash
# Setup hook for checking whether Lua imports succeed
echo "Sourcing neovim-require-check-hook.sh"
# Discover modules automatically if nvimRequireCheck is not set
discover_modules() {
echo "Running module discovery in source directory..."
# Create unique lists so we can organize later
modules=()
while IFS= read -r lua_file; do
# Ignore certain infra directories
if [[ "$lua_file" =~ (^|/)(debug|script|scripts|test|tests|spec)(/|$) || "$lua_file" =~ .*\meta.lua ]]; then
continue
# Ignore optional telescope and lualine modules
elif [[ "$lua_file" =~ ^lua/telescope/_extensions/(.+)\.lua || "$lua_file" =~ ^lua/lualine/(.+)\.lua ]]; then
continue
# Grab main module names
elif [[ "$lua_file" =~ ^lua/([^/]+)/init.lua$ ]]; then
echo "$lua_file"
modules+=("${BASH_REMATCH[1]}")
# Check other lua files
elif [[ "$lua_file" =~ ^lua/(.*)\.lua$ ]]; then
echo "$lua_file"
# Replace slashes with dots to form the module name
module_name="${BASH_REMATCH[1]//\//.}"
modules+=("$module_name")
elif [[ "$lua_file" =~ ^([^/.][^/]*)\.lua$ ]]; then
echo "$lua_file"
modules+=("${BASH_REMATCH[1]}")
fi
done < <(find "$src" -name '*.lua' | xargs -n 1 realpath --relative-to="$src")
nvimRequireCheck=("${modules[@]}")
echo "Discovered modules: ${nvimRequireCheck[*]}"
if [ "${#nvimRequireCheck[@]}" -eq 0 ]; then
echo "No valid Lua modules found; skipping check"
return 1
fi
return 0
}
# Run require checks on each module in nvimRequireCheck
run_require_checks() {
echo "Starting require checks"
check_passed=false
failed_modules=()
successful_modules=()
export HOME="$TMPDIR"
local deps="${dependencies[*]}"
local nativeCheckInputs="${nativeBuildInputs[*]}"
local checkInputs="${buildInputs[*]}"
set +e
if [ -v 'nvimSkipModule' ]; then
nvimSkipModules=("${nvimSkipModule[@]}")
echo "WARNING: nvimSkipModule got renamed to nvimSkipModules, please update package $name"
fi
for name in "${nvimRequireCheck[@]}"; do
local skip=false
for module in "${nvimSkipModules[@]}"; do
if [[ "$module" == "$name" ]]; then
echo "$name is in list of modules to not check. Skipping..."
skip=true
break
fi
done
if [ "$skip" = false ]; then
echo "Attempting to require module: $name"
if @nvimBinary@ -es --headless -n -u NONE -i NONE --clean -V1 \
--cmd "set rtp+=$out,${deps// /,}" \
--cmd "set rtp+=$out,${nativeCheckInputs// /,}" \
--cmd "set rtp+=$out,${checkInputs// /,}" \
--cmd "lua require('$name')"; then
check_passed=true
successful_modules+=("$name")
echo "Successfully required module: $name"
else
echo "Failed to require module: $name"
failed_modules+=("$name")
fi
fi
done
set -e
}
# Define color codes
GREEN="\033[0;32m"
RED="\033[0;31m"
NC="\033[0m" # No Color
# Print summary of the require checks
print_summary() {
echo -e "\n======================================================"
if [[ "$check_passed" == "true" ]]; then
echo -e "${GREEN}Require check succeeded for the following modules:${NC}"
for module in "${successful_modules[@]}"; do
echo -e " ${GREEN}- $module${NC}"
done
echo "All lua modules were checked."
else
echo -e "${RED}No successful require checks.${NC}"
fi
# Print any modules that failed with improved formatting and color
if [ "${#failed_modules[@]}" -gt 0 ]; then
echo -e "\n${RED}Require check failed for the following modules:${NC}"
for module in "${failed_modules[@]}"; do
echo -e " ${RED}- $module${NC}"
done
echo -e "\n${RED}Checkout https://nixos.org/manual/nixpkgs/unstable/#testing-neovim-plugins-neovim-require-check${NC}"
fi
echo "======================================================"
if [ "${#failed_modules[@]}" -gt 0 ]; then
return 1
fi
}
# Main entry point: orchestrates discovery, require checks, and summary
neovimRequireCheckHook() {
echo "Executing neovimRequireCheckHook"
if [ "${nvimRequireCheck[*]}" = "" ]; then
echo "nvimRequireCheck is empty; entering discovery mode"
# Auto-discovery mode
if ! discover_modules; then
echo "No modules found during discovery; exiting hook"
return
fi
else
echo "nvimRequireCheck is pre-populated; entering manual check mode"
fi
run_require_checks
print_summary
}
echo "Using neovimRequireCheckHook"
appendToVar preDistPhases neovimRequireCheckHook

View File

@@ -0,0 +1,25 @@
# Setup hook for checking whether a vim command exists
echo "Sourcing vim-command-check-hook.sh"
vimCommandCheckHook () {
echo "Executing vimCommandCheckHook"
if [ -n "$vimCommandCheck" ]; then
echo "Check whether the following modules can be imported: $vimCommandCheck"
# editorconfig-checker-disable
export HOME="$TMPDIR"
@vimBinary@ -es -n -u NONE -i NONE --clean -V1 --cmd "set rtp+=$out" \
--cmd "runtime! plugin/*.vim" <<-EOF
if exists(":$vimCommandCheck") == 2
cquit 0
else
cquit 1
fi
EOF
fi
}
echo "Using vimCommandCheckHook"
appendToVar preDistPhases vimCommandCheckHook

View File

@@ -0,0 +1,30 @@
echo "Sourcing vim-gen-doc-hook"
# the doc folder is copied via the copy_directories entry of the rockspec
# in the folder gitsigns.nvim-scm-1-rocks/gitsigns.nvim/scm-1
vimPluginGenTags() {
echo "Executing vimPluginGenTags"
target="$out/@rtpPath@"
mkdir -p $out/@rtpPath@
# build help tags
if [ -d "$target/doc" ]; then
echo "Building help tags"
if ! @vimBinary@ -N -u NONE -i NONE -n -E -s -V1 -c "helptags $target/doc" +quit!; then
echo "Failed to build help tags!"
exit 1
fi
else
echo "No docs available for $target"
fi
if [ -n "$addonInfo" ]; then
echo "$addonInfo" > $target/addon-info.json
fi
echo "Finished executing vimPluginGenTags"
}
preFixupHooks+=(vimPluginGenTags)