Skip to content

Commit

Permalink
feat: Support vim 8.0.1630+ from now on
Browse files Browse the repository at this point in the history
  • Loading branch information
kkoomen committed Jun 18, 2019
1 parent 201354f commit 3058c14
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 12 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
FROM tweekmonster/vim-testbed:latest

RUN install_vim \
-tag v8.0.1630 -build \
-tag v8.1.1511 -build \
-tag neovim:v0.3.2 -build

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<a href="https://travis-ci.com/kkoomen/doge">
<img src="https://travis-ci.com/kkoomen/doge.svg?branch=master" alt="Travic CI Build Status" />
</a>
<img src="https://img.shields.io/badge/vim-8.1%2B-informational.svg" alt="Minimum supported Vim version" />
<img src="https://img.shields.io/badge/vim-8.0.1630%2B-informational.svg" alt="Minimum supported Vim version" />
<img src="https://img.shields.io/badge/neovim-0.3.2%2B-informational.svg" alt="Minimum supported NeoVim version" />
<a href="https://github.com/kkoomen/doge/blob/develop/LICENSE">
<img src="https://img.shields.io/github/license/kkoomen/doge.svg" alt="License" />
Expand Down
4 changes: 4 additions & 0 deletions autoload/doge.vim
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,17 @@ function! doge#generate() abort

echo '[DoGe] No patterns did match L' . line('.') . '.'
echo '--'
echohl WarningMsg
echo 'Is this a bug? Use the following link to quickly sent in a bug report for kkoomen/doge:'
echohl None
let l:issue_title = substitute(&filetype . ' expression does not generate comment', '\s\+', '+', 'g')
echo printf('https://github.com/kkoomen/doge/issues/new?labels=bug&template=bug_report.md&title=[BUG]+%s', l:issue_title)
else
echo '[DoGe] b:doge_patterns variable not found for filetype "' . &filetype . '".'
echo '--'
echohl WarningMsg
echo 'Should this filetype be supported? Use the following link to quickly sent in a feature request for kkoomen/doge:'
echohl None
let l:issue_title = substitute('Add support for ' . &filetype, '\s\+', '+', 'g')
echo printf('https://github.com/kkoomen/doge/issues/new?assignees=&labels=enhancement&template=feature_request.md&title=[FEATURE]+%s', l:issue_title)
endif
Expand Down
7 changes: 7 additions & 0 deletions plugin/doge.vim
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
let s:save_cpo = &cpoptions
set cpoptions&vim

if v:version < 800 || (v:version == 800 && !has('patch1630'))
echohl WarningMsg
echo '[DoGe] Unsupported version. Vim v8.0.1630+ is required.'
echohl None
finish
endif

""
" @section Introduction, intro
" We all love documentation because it makes our codebases easier to understand,
Expand Down
40 changes: 29 additions & 11 deletions run-tests
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,14 @@ set -e
set -u

docker_image=kkoomen/doge
current_docker_image_id=5a3156d58b1d
current_docker_image_id=54344e231921

DOGE_DOCKER_IMAGE="$docker_image"
export DOGE_DOCKER_IMAGE

verbose_flag=''
verbose=0
run_vim_80_tests=1
run_vim_81_tests=1
run_neovim_03_tests=1
run_linter=1
Expand All @@ -52,17 +53,31 @@ while [ $# -ne 0 ]; do
verbose=1
shift
;;
--vim-only)
run_linter=0
run_neovim_03_tests=0
shift
;;
--vim-80-only)
run_linter=0
run_vim_81_tests=0
run_neovim_03_tests=0
shift
;;
--vim-81-only)
run_linter=0
run_vim_80_tests=0
run_neovim_03_tests=0
shift
;;
--neovim-03-only)
run_linter=0
run_vim_80_tests=0
run_vim_81_tests=0
shift
;;
--linter-only)
run_vim_80_tests=0
run_vim_81_tests=0
run_neovim_03_tests=0
shift
Expand All @@ -75,6 +90,8 @@ while [ $# -ne 0 ]; do
echo
echo 'Options:'
echo ' -v Enable verbose output'
echo ' --vim-only Run tests only for Vim 8.0 and 8.1'
echo ' --vim-80-only Run tests only for Vim 8.0'
echo ' --vim-81-only Run tests only for Vim 8.1'
echo ' --neovim-03-only Run tests only for NeoVim 0.3'
echo ' --linters-only Run only Vint'
Expand Down Expand Up @@ -142,20 +159,21 @@ trap cancel_tests INT TERM
file_number=0
pid_list=''
for vim in $(docker run --rm "$DOGE_DOCKER_IMAGE" ls /vim-build/bin | grep '^neovim\|^vim'); do
if ( [[ $vim =~ ^vim-v8.1 ]] && ((run_vim_81_tests)) ) \
|| ( [[ $vim =~ ^neovim-v0.3 ]] && ((run_neovim_03_tests)) ); then
echo "Starting Vim: $vim..."
file_number=$((file_number+1))
scripts/run-vader-tests $verbose_flag "$vim" "$tests" > "$output_dir/$file_number" 2>&1 &
pid_list="$pid_list $!"
if ( [[ $vim =~ ^vim-v8.1 ]] && ((run_vim_81_tests)) ) \
|| ( [[ $vim =~ ^vim-v8.0 ]] && ((run_vim_80_tests)) ) \
|| ( [[ $vim =~ ^neovim-v0.3 ]] && ((run_neovim_03_tests)) ); then
echo "Starting Vim: $vim..."
file_number=$((file_number+1))
scripts/run-vader-tests $verbose_flag "$vim" "$tests" > "$output_dir/$file_number" 2>&1 &
pid_list="$pid_list $!"
fi
done

if ((run_linter)); then
echo "Starting Vint..."
file_number=$((file_number+1))
scripts/run-vint > "$output_dir/$file_number" 2>&1 &
pid_list="$pid_list $!"
echo "Starting Vint..."
file_number=$((file_number+1))
scripts/run-vint > "$output_dir/$file_number" 2>&1 &
pid_list="$pid_list $!"
fi

echo
Expand Down

0 comments on commit 3058c14

Please sign in to comment.