mirror of
https://github.com/amix/vimrc
synced 2025-08-01 18:35:00 +08:00
Added not added new plugin files
This commit is contained in:
13
sources_non_forked/vim-go/scripts/docker-test
Normal file
13
sources_non_forked/vim-go/scripts/docker-test
Normal file
@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Run all tests inside a Docker container
|
||||
#
|
||||
|
||||
set -euC
|
||||
vimgodir=$(cd -P "$(dirname "$0")/.." > /dev/null && pwd)
|
||||
cd "$vimgodir"
|
||||
|
||||
docker build --tag vim-go-test .
|
||||
docker run --rm vim-go-test
|
||||
|
||||
# vim:ts=2:sts=2:sw=2:et
|
112
sources_non_forked/vim-go/scripts/install-vim
Normal file
112
sources_non_forked/vim-go/scripts/install-vim
Normal file
@ -0,0 +1,112 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Install and setup a Vim or Neovim for running tests.
|
||||
# This should work on both Travis and people's desktop computers, and be 100%
|
||||
# independent from any system installed Vim.
|
||||
#
|
||||
# It will echo the full path to a Vim binary, e.g.:
|
||||
# /some/path/src/vim
|
||||
|
||||
set -euC
|
||||
|
||||
vimgodir=$(cd -P "$(dirname "$0")/.." > /dev/null && pwd)
|
||||
cd "$vimgodir"
|
||||
|
||||
vim=${1:-}
|
||||
|
||||
case "$vim" in
|
||||
"vim-7.4")
|
||||
# This is what the most recent Ubuntu LTS (16.04) ships with.
|
||||
tag="v7.4.1689"
|
||||
giturl="https://github.com/vim/vim"
|
||||
;;
|
||||
|
||||
"vim-8.0")
|
||||
# This follows the version in Arch Linux. Vim's master branch isn't always
|
||||
# stable, and we don't want to have the build fail because Vim introduced a
|
||||
# bug.
|
||||
tag="v8.0.1176"
|
||||
giturl="https://github.com/vim/vim"
|
||||
;;
|
||||
|
||||
"nvim")
|
||||
# Use latest stable version.
|
||||
tag="v0.2.0"
|
||||
giturl="https://github.com/neovim/neovim"
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "unknown version: '${1:-}'"
|
||||
echo "First argument must be 'vim-7.4', 'vim-8.0', or 'nvim'."
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
srcdir="/tmp/vim-go-test/$1-src"
|
||||
installdir="/tmp/vim-go-test/$1-install"
|
||||
|
||||
# Use cached installdir.
|
||||
if [ -d "$installdir" ]; then
|
||||
echo "$installdir exists; skipping build."
|
||||
|
||||
# The ./scripts/test script relies on this.
|
||||
echo "installed to: $installdir"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
mkdir -p "$srcdir"
|
||||
cd "$srcdir"
|
||||
|
||||
# Neovim build requires more deps than Vim and is annoying, so we use the
|
||||
# binary.
|
||||
# 0.2.0 doesn't have a binary build for Linux, so we use 0.2.1-dev for now.
|
||||
if [ "$1" = "nvim" ]; then
|
||||
|
||||
# TODO: Use macOS binaries on macOS
|
||||
curl -Ls https://github.com/neovim/neovim/releases/download/nightly/nvim-linux64.tar.gz |
|
||||
tar xzf - -C /tmp/vim-go-test/
|
||||
mv /tmp/vim-go-test/nvim-linux64 /tmp/vim-go-test/nvim-install
|
||||
mkdir -p "$installdir/share/nvim/runtime/pack/vim-go/start"
|
||||
ln -s "$vimgodir" "$installdir/share/nvim/runtime/pack/vim-go/start/vim-go"
|
||||
|
||||
# Consistent paths makes calling things easier.
|
||||
mv "$installdir/bin/nvim" "$installdir/bin/vim"
|
||||
mkdir -p "$installdir/share/vim/vimgo/pack"
|
||||
ln -s "$installdir/share/nvim/runtime/pack/vim-go" "$installdir/share/vim/vimgo/pack/vim-go"
|
||||
|
||||
# Build Vim from source.
|
||||
else
|
||||
if [ -d "$srcdir/.git" ]; then
|
||||
echo "Skipping clone as $srcdir/.git exists"
|
||||
else
|
||||
echo "Cloning $tag from $giturl"
|
||||
git clone --branch "$tag" --depth 1 "$giturl" "$srcdir"
|
||||
fi
|
||||
|
||||
./configure --prefix="$installdir" --with-features=huge --disable-gui
|
||||
make install
|
||||
mkdir -p "$installdir/share/vim/vimgo/pack/vim-go/start"
|
||||
ln -s "$vimgodir" "$installdir/share/vim/vimgo/pack/vim-go/start/vim-go"
|
||||
fi
|
||||
|
||||
# Make sure all Go tools and other dependencies are installed.
|
||||
echo "Installing Go binaries"
|
||||
export GOPATH=$installdir
|
||||
export PATH=${GOPATH}/bin:$PATH
|
||||
"$vimgodir/scripts/run-vim" $vim +':silent :GoUpdateBinaries' +':qa'
|
||||
|
||||
echo "Installing lint tools"
|
||||
(
|
||||
mkdir -p "$installdir/share/vim/vimgo/pack/vim-go/start/"
|
||||
cd "$installdir/share/vim/vimgo/pack/vim-go/start/"
|
||||
[ -d "vim-vimhelplint" ] || git clone --depth 1 --quiet https://github.com/machakann/vim-vimhelplint
|
||||
[ -d "vim-vimlparser" ] || git clone --depth 1 --quiet https://github.com/ynkdir/vim-vimlparser
|
||||
[ -d "vim-vimlint" ] || git clone --depth 1 --quiet https://github.com/syngan/vim-vimlint
|
||||
)
|
||||
|
||||
# Don't really need source after successful install.
|
||||
rm -rf "$srcdir"
|
||||
|
||||
echo "installed to: $installdir"
|
||||
|
||||
# vim:ts=2:sts=2:sw=2:et
|
88
sources_non_forked/vim-go/scripts/lint
Normal file
88
sources_non_forked/vim-go/scripts/lint
Normal file
@ -0,0 +1,88 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Run all linting tools.
|
||||
#
|
||||
|
||||
set -euC
|
||||
vimgodir=$(cd -P "$(dirname "$0")/.." > /dev/null && pwd)
|
||||
cd "$vimgodir"
|
||||
|
||||
### Setup Vim and other dependencies.
|
||||
#####################################
|
||||
if [ -z "${1:-}" ]; then
|
||||
echo "unknown version: '${1:-}'"
|
||||
echo "First argument must be 'vim-7.4', 'vim-8.0', or 'nvim'."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
vim=$1
|
||||
vimdir="/tmp/vim-go-test/$vim-install"
|
||||
export GOPATH=$vimdir
|
||||
export PATH=${GOPATH}/bin:$PATH
|
||||
|
||||
if [ ! -f "$vimdir/bin/vim" ]; then
|
||||
echo "$vimdir/bin/vim doesn't exist; did you install it with the install-vim script?"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
### Run vint
|
||||
############
|
||||
failed=0
|
||||
printf "Running vint ... "
|
||||
if [ -x "$(command -v vint)" ]; then
|
||||
lint=$(vint "$vimgodir" 2>&1 ||:)
|
||||
if [ -n "$lint" ]; then
|
||||
echo "FAILED"
|
||||
echo "$lint"
|
||||
echo
|
||||
failed=6
|
||||
else
|
||||
echo "PASSED"
|
||||
fi
|
||||
else
|
||||
echo "SKIPPED"
|
||||
echo "'vint' binary not found; use 'pip install vim-vint' to install it."
|
||||
fi
|
||||
|
||||
### Run vim-vimlint
|
||||
###################
|
||||
printf "Running vim-vimlint ... "
|
||||
lint=$(sh "$vimdir/share/vim/vimgo/pack/vim-go/start/vim-vimlint/bin/vimlint.sh" \
|
||||
-p "$vimdir/share/vim/vimgo/pack/vim-go/start/vim-vimlparser" \
|
||||
-l "$vimdir/share/vim/vimgo/pack/vim-go/start/vim-vimlint" \
|
||||
-u \
|
||||
-c func_abort=1 \
|
||||
-e EVL110=1 -e EVL103=1 -e EVL104=1 -e EVL102=1 \
|
||||
"$vimgodir" \
|
||||
2>&1 ||:)
|
||||
if [ -n "$lint" ]; then
|
||||
echo "FAILED"
|
||||
echo "$lint"
|
||||
echo
|
||||
failed=6
|
||||
else
|
||||
echo "PASSED"
|
||||
fi
|
||||
|
||||
### Run vimhelplint.
|
||||
####################
|
||||
printf "Running vimhelplint ... "
|
||||
|
||||
# set modeline explicitly so that the modeline will be respected when run as root.
|
||||
lint=$($vimdir/bin/vim -esNR \
|
||||
--cmd "set rtp+=$vimdir/share/vim/vimgo/pack/vim-go/start/vim-vimhelplint/" \
|
||||
--cmd 'set modeline' \
|
||||
+'filetype plugin on' \
|
||||
+"e $vimgodir/doc/vim-go.txt" \
|
||||
+'verbose VimhelpLintEcho' \
|
||||
+q \
|
||||
2>&1 ||:)
|
||||
if [ "$lint" ]; then
|
||||
echo "FAILED"
|
||||
echo "$lint"
|
||||
failed=6
|
||||
else
|
||||
echo "PASSED"
|
||||
fi
|
||||
|
||||
exit "$failed"
|
33
sources_non_forked/vim-go/scripts/run-vim
Normal file
33
sources_non_forked/vim-go/scripts/run-vim
Normal file
@ -0,0 +1,33 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Run a "bare" Vim with just vim-go and ignoring ~/.vim
|
||||
#
|
||||
|
||||
set -euC
|
||||
vimgodir=$(cd -P "$(dirname "$0")/.." > /dev/null && pwd)
|
||||
cd "$vimgodir"
|
||||
|
||||
if [ -z "${1:-}" ]; then
|
||||
echo "unknown version: '${1:-}'"
|
||||
echo "First argument must be 'vim-7.4', 'vim-8.0', or 'nvim'."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
dir="/tmp/vim-go-test/$1-install"
|
||||
export GOPATH=$dir
|
||||
export PATH=${GOPATH}/bin:$PATH
|
||||
shift
|
||||
|
||||
if [ ! -f "$dir/bin/vim" ]; then
|
||||
echo "$dir/bin/vim doesn't exist; did you install it with the install-vim script?"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
$dir/bin/vim --noplugin -u NONE -N \
|
||||
+"set shm+=WAFI rtp=$dir/share/vim/vimgo packpath=$dir/share/vim/vimgo,$vimgodir" \
|
||||
+'filetype plugin indent on' \
|
||||
+'packloadall!' \
|
||||
"$@"
|
||||
|
||||
|
||||
# vim:ts=2:sts=2:sw=2:et
|
51
sources_non_forked/vim-go/scripts/test
Normal file
51
sources_non_forked/vim-go/scripts/test
Normal file
@ -0,0 +1,51 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Run all tests.
|
||||
#
|
||||
|
||||
set -euC
|
||||
vimgodir=$(cd -P "$(dirname "$0")/.." > /dev/null && pwd)
|
||||
cd "$vimgodir"
|
||||
|
||||
### Setup Vim and other dependencies.
|
||||
#####################################
|
||||
if [ -z "${1:-}" ]; then
|
||||
echo "unknown version: '${1:-}'"
|
||||
echo "First argument must be 'vim-7.4', 'vim-8.0', or 'nvim'."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
vim=$1
|
||||
vimdir="/tmp/vim-go-test/$vim-install"
|
||||
export GOPATH=$vimdir
|
||||
export PATH=${GOPATH}/bin:$PATH
|
||||
|
||||
if [ ! -f "$vimdir/bin/vim" ]; then
|
||||
echo "$vimdir/bin/vim doesn't exist; did you install it with the install-vim script?"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
### Run tests.
|
||||
##############
|
||||
# Clean stale log file.
|
||||
[ -f '/tmp/vim-go-test/test.log' ] && rm '/tmp/vim-go-test/test.log'
|
||||
[ -f '/tmp/vim-go-test/FAILED' ] && rm '/tmp/vim-go-test/FAILED'
|
||||
|
||||
# Run the actual tests.
|
||||
fail=0
|
||||
for test_file in "$vimgodir"/autoload/go/*_test.vim; do
|
||||
"$vimgodir/scripts/run-vim" $vim -e +"silent e $test_file" -S ./scripts/runtest.vim
|
||||
|
||||
# Append logs
|
||||
cat '/tmp/vim-go-test/test.tmp' | tee '/tmp/vim-go-test/test.log'
|
||||
rm '/tmp/vim-go-test/test.tmp'
|
||||
done
|
||||
|
||||
echo
|
||||
if [ -f "/tmp/vim-go-test/FAILED" ]; then
|
||||
echo 2>&1 "Some tests FAILED"
|
||||
exit 1
|
||||
fi
|
||||
echo 2>&1 "All tests PASSED"
|
||||
|
||||
# vim:ts=2:sts=2:sw=2:et
|
Reference in New Issue
Block a user