mirror of
https://oauth2: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@github.com/m1ngsama/chopsticks.git
synced 2026-06-26 05:54:37 +08:00
Insulate vim smoke tests from a user's local chopsticks.vim (#73)
Four `vim -u NONE` invocations in scripts/test.sh set a profile or option as their first `-c` then `source .vimrc`. They didn't override XDG_CONFIG_HOME, so .vimrc's local-config hook read ~/.config/chopsticks.vim and any `let g:chopsticks_profile = '...'` there silently overrode the test's setup. After install.sh runs (writing `engineer` or `full` to that file), scripts/test.sh vim fails on the developer's machine but passes in CI — CI never runs install.sh. Fix by prepending XDG_CONFIG_HOME="\$EMPTY_XDG" to the four bare sites, matching what the surrounding tests already do. L176 stays unchanged because it explicitly sets g:chopsticks_local_config to its own controlled file. Closes #72
This commit is contained in:
parent
debcdd33c4
commit
74cc479a0e
1 changed files with 4 additions and 4 deletions
|
|
@ -165,7 +165,7 @@ check_vim() {
|
|||
XDG_CONFIG_HOME="$EMPTY_XDG" vim -u "$TMP_ROOT/chopsticks path/.vimrc" \
|
||||
-i NONE -es -N -c 'qa!' 2>&1
|
||||
|
||||
vim -u NONE -i NONE -es -N \
|
||||
XDG_CONFIG_HOME="$EMPTY_XDG" vim -u NONE -i NONE -es -N \
|
||||
-c 'let g:chopsticks_profile = "minimal"' \
|
||||
-c 'source .vimrc' \
|
||||
-c 'if has_key(g:plugs, "ale") || has_key(g:plugs, "vim-lsp") || has_key(g:plugs, "vim-lsp-settings") || has_key(g:plugs, "asyncomplete.vim") || has_key(g:plugs, "auto-pairs") | cquit | endif' \
|
||||
|
|
@ -267,7 +267,7 @@ check_vim() {
|
|||
-c 'qa!' 2>&1
|
||||
grep -Fq 'OK vim-lsp stack (installed; not loaded yet)' "$TMP_ROOT/status-lsp-not-loaded.txt"
|
||||
|
||||
vim -u NONE -i NONE -es -N \
|
||||
XDG_CONFIG_HOME="$EMPTY_XDG" vim -u NONE -i NONE -es -N \
|
||||
-c 'let g:chopsticks_profile = "minimal"' \
|
||||
-c 'source .vimrc' \
|
||||
-c 'ChopsticksStatus' \
|
||||
|
|
@ -322,7 +322,7 @@ check_vim() {
|
|||
exit 1
|
||||
fi
|
||||
|
||||
vim -u NONE -i NONE -es -N \
|
||||
XDG_CONFIG_HOME="$EMPTY_XDG" vim -u NONE -i NONE -es -N \
|
||||
-c 'let g:chopsticks_profile = "minimal"' \
|
||||
-c 'source .vimrc' \
|
||||
-c 'normal ,?' \
|
||||
|
|
@ -347,7 +347,7 @@ check_vim() {
|
|||
-c 'if !&swapfile || !&writebackup || &directory !~# "\.vim/.swap" | cquit | endif' \
|
||||
-c 'qa!' 2>&1
|
||||
|
||||
vim -u NONE -i NONE -es -N \
|
||||
XDG_CONFIG_HOME="$EMPTY_XDG" vim -u NONE -i NONE -es -N \
|
||||
-c 'let g:ale_fix_on_save = 0' \
|
||||
-c 'source .vimrc' \
|
||||
-c 'if g:ale_fix_on_save != 0 | cquit | endif' \
|
||||
|
|
|
|||
Loading…
Reference in a new issue