diff options
-rw-r--r-- | .travis.yml | 11 | ||||
-rw-r--r-- | Dockerfile | 17 | ||||
-rw-r--r-- | Makefile | 31 | ||||
-rw-r--r-- | ale_linters/python/flake8.vim | 2 | ||||
-rw-r--r-- | autoload/ale/linter.vim | 2 | ||||
-rw-r--r-- | test/vimrc | 24 |
6 files changed, 79 insertions, 8 deletions
diff --git a/.travis.yml b/.travis.yml index 03ad0177..d6da2530 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,7 @@ --- +sudo: required +services: + - docker language: python -python: 2.7 -cache: pip -install: - - "pip install vim-vint==0.3.9" -script: - - "vint -s ." +script: | + make test diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..7ef5e77c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM tweekmonster/vim-testbed:latest + +RUN install_vim -tag v8.0.0000 -build \ + -tag v8.0.0027 -build + +ENV PACKAGES="\ + git \ + python=2.7.12-r0 \ + py-pip=8.1.2-r0 \ +" +RUN apk --update add $PACKAGES && \ + rm -rf /var/cache/apk/* /tmp/* /var/tmp/* + +RUN pip install vim-vint==0.3.9 + +RUN git clone https://github.com/junegunn/vader.vim vader && \ + cd vader && git checkout c6243dd81c98350df4dec608fa972df98fa2a3af diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..e8376deb --- /dev/null +++ b/Makefile @@ -0,0 +1,31 @@ +IMAGE ?= w0rp/ale +DOCKER_FLAGS = --rm -v $(PWD):/testplugin -v $(PWD)/test:/home "$(IMAGE)" + +test-setup: + docker images -q $(IMAGE) || docker pull $(IMAGE) + +test: test-setup + @:; \ + vims=$$(docker run --rm $(IMAGE) ls /vim-build/bin | grep -E '^n?vim'); \ + if [ -z "$$vims" ]; then echo "No Vims found!"; exit 1; fi; \ + EXIT=0; \ + for vim in $$vims; do \ + echo; \ + echo '========================================'; \ + echo "Running tests for $$vim"; \ + echo '========================================'; \ + echo; \ + docker run -a stderr $(DOCKER_FLAGS) $$vim '+Vader! test/*' || EXIT=$$?; \ + done; \ + echo; \ + echo '========================================'; \ + echo 'Running Vint to lint our code'; \ + echo '========================================'; \ + echo 'Vint warnings/errors follow:'; \ + echo; \ + docker run -a stdout $(DOCKER_FLAGS) vint -s /testplugin | sed s:^/testplugin/:: || EXIT=$$?; \ + echo; \ + echo; \ + exit $$EXIT; + +.DEFAULT_GOAL := test diff --git a/ale_linters/python/flake8.vim b/ale_linters/python/flake8.vim index 549eaf7f..cc4c604f 100644 --- a/ale_linters/python/flake8.vim +++ b/ale_linters/python/flake8.vim @@ -27,7 +27,7 @@ function! ale_linters#python#flake8#Handle(buffer, lines) let l:text = l:code . ': ' . l:match[4] let l:type = l:code[0] ==# 'E' ? 'E' : 'W' - if l:code ==# 'W291' && !g:ale_warn_about_trailing_whitespace + if (l:code ==# 'W291' || l:code ==# 'W293') && !g:ale_warn_about_trailing_whitespace " Skip warnings for trailing whitespace if the option is off. continue endif diff --git a/autoload/ale/linter.vim b/autoload/ale/linter.vim index f99d32a9..7a5c8d51 100644 --- a/autoload/ale/linter.vim +++ b/autoload/ale/linter.vim @@ -7,7 +7,7 @@ let s:linters = {} " Default filetype aliaes. " The user defined aliases will be merged with this Dictionary. let s:default_ale_linter_aliases = { -\ 'javscript.jsx': 'javascript', +\ 'javascript.jsx': 'javascript', \ 'zsh': 'sh', \ 'csh': 'sh', \} diff --git a/test/vimrc b/test/vimrc new file mode 100644 index 00000000..1ab04d04 --- /dev/null +++ b/test/vimrc @@ -0,0 +1,24 @@ +" vint: -ProhibitSetNoCompatible + +" Load builtin plugins +" We need this because run_vim.sh sets -i NONE +set runtimepath=/home/vim,$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after,/testplugin +set runtimepath+=/home/ale +set runtimepath+=/vader + +" The following is just an example +filetype plugin indent on +syntax on +set nocompatible +set tabstop=4 +set softtabstop=4 +set shiftwidth=4 +set expandtab +set backspace=2 +set nofoldenable +set foldmethod=syntax +set foldlevelstart=10 +set foldnestmax=10 +set ttimeoutlen=0 + +let g:mapleader=',' |