Move development scripts into development/, leaving scripts/ plugin-only
CI / cargo fmt --check (push) Successful in 32s
CI / cargo clippy (push) Successful in 25s
CI / cargo test (push) Successful in 33s
CI / cargo fmt --check (pull_request) Successful in 30s
CI / cargo clippy (pull_request) Successful in 49s
CI / cargo test (pull_request) Successful in 43s
CI / editor keymaps (push) Successful in 1m49s
CI / editor keymaps (pull_request) Successful in 1m36s
CI / cargo fmt --check (push) Successful in 32s
CI / cargo clippy (push) Successful in 25s
CI / cargo test (push) Successful in 33s
CI / cargo fmt --check (pull_request) Successful in 30s
CI / cargo clippy (pull_request) Successful in 49s
CI / cargo test (pull_request) Successful in 43s
CI / editor keymaps (push) Successful in 1m49s
CI / editor keymaps (pull_request) Successful in 1m36s
The root scripts/ folder now holds only download_bin.vim, the one script the plugin itself invokes (via :NuwikiInstall and the vim-plug/Dein build hooks). All developer tooling — the start-nvim/start-vim launchers, test-personal-wiki, the keymap harnesses, and syntax-diag — moves to development/ alongside the developer docs. REPO_ROOT resolution is unchanged (development/ sits one level under root, same as scripts/ did); only the explicit cross-references, the CI harness invocations, the README launcher paths, and the ONBOARDING structure tree are updated. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Executable
+65
@@ -0,0 +1,65 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# development/test-keymaps-vim.sh — Vim counterpart of test-keymaps.sh.
|
||||
#
|
||||
# Pure-VimL portion only. The LSP-roundtrip keymaps (`<C-Space>`,
|
||||
# `=`, `-`, …) talk to the server via vim-lsp's timer-driven async
|
||||
# layer, which doesn't fire reliably inside `vim -e -s`. Those have
|
||||
# Neovim coverage in development/test-keymaps.lua, exercising the same
|
||||
# Lua command layer + server binary.
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
TMP="$(mktemp -d -t nuwiki-keymap-vim-test-XXXXXX)"
|
||||
trap 'rm -rf "$TMP"' EXIT
|
||||
|
||||
log() { printf '\033[1;34m[keymap-vim]\033[0m %s\n' "$*"; }
|
||||
|
||||
if ! command -v vim >/dev/null 2>&1; then
|
||||
log 'vim not installed — skipping'
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Don't need the LSP binary for the pure-VimL cases, but make sure
|
||||
# the autoload file `expand('<sfile>')` resolves correctly when the
|
||||
# script-load-time plugin_root capture runs.
|
||||
|
||||
mkdir -p "$TMP/wiki"
|
||||
SEED="$TMP/wiki/index.wiki"
|
||||
echo "= seed =" > "$SEED"
|
||||
|
||||
VIMRC="$TMP/vimrc"
|
||||
cat > "$VIMRC" <<EOF
|
||||
set nocompatible
|
||||
let &runtimepath = '$REPO_ROOT' . ',' . &runtimepath
|
||||
" Enable the opt-in mouse mappings before the ftplugin loads so the
|
||||
" harness can assert the full documented mapping surface (doc §6 mouse).
|
||||
let g:nuwiki_mouse_mappings = 1
|
||||
filetype plugin indent on
|
||||
syntax enable
|
||||
" ftdetect/nuwiki.vim already maps *.wiki → vimwiki via \`set filetype\`.
|
||||
EOF
|
||||
|
||||
RESULTS="$TMP/results.txt"
|
||||
|
||||
log "running harness…"
|
||||
# `</dev/null` so Vim's ex-mode doesn't hang waiting on stdin;
|
||||
# `timeout` so a misbehaving script can't stall CI for 30 minutes.
|
||||
NUWIKI_KEYMAP_RESULTS="$RESULTS" \
|
||||
timeout 30 vim -e -s -u "$VIMRC" -c "edit $SEED" -c "source $REPO_ROOT/development/test-keymaps-vim.vim" \
|
||||
</dev/null >"$TMP/vim.log" 2>&1 || true
|
||||
|
||||
if [[ ! -f "$RESULTS" ]]; then
|
||||
echo 'keymap test harness produced no output' >&2
|
||||
echo '--- vim log ---' >&2
|
||||
cat "$TMP/vim.log" >&2 || true
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cat "$RESULTS"
|
||||
|
||||
if grep -qE '^SUMMARY: [0-9]+ passed, 0 failed' "$RESULTS"; then
|
||||
exit 0
|
||||
fi
|
||||
exit 1
|
||||
Reference in New Issue
Block a user