From 936ac8537539f789add37386903f635a36a2d464 Mon Sep 17 00:00:00 2001 From: Liu-Cheng Xu Date: Sun, 25 Nov 2018 17:41:12 +0800 Subject: [PATCH] Lint vimscript (#371) * Check vim * Use python3 * Specify 3.6 * Update beforehand * Add ppa * Yes * Compose * && * Split * Refactor * Chmod +x * Add pathlib * Sudo * Typing * Ci * Unique * Ci --- .travis.yml | 13 ++----------- ci/before_install.sh | 6 ++++++ ci/script.sh | 9 +++++++++ 3 files changed, 17 insertions(+), 11 deletions(-) create mode 100755 ci/before_install.sh create mode 100755 ci/script.sh diff --git a/.travis.yml b/.travis.yml index 1b161b903..79c2c5d6e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,14 +1,5 @@ sudo: required dist: trusty -before_install: -- sudo apt-get install shellcheck python vim -- pip install --user vim-vint - -script: -# - vint init.vim layers/*.vim core/*.vim -- shellcheck *.sh -- chmod +x install.sh -- git clone https://github.com/hecal3/vim-leader-guide ~/.vim/plugged/vim-leader-guide --depth=1 -- ./install.sh - +before_install: ci/before_install.sh +script: ci/script.sh diff --git a/ci/before_install.sh b/ci/before_install.sh new file mode 100755 index 000000000..3fb030c3f --- /dev/null +++ b/ci/before_install.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +sudo add-apt-repository ppa:deadsnakes/ppa -y +sudo apt-get update +sudo apt-get install shellcheck python3.6 -y +sudo pip install vim-vint pathlib typing enum34 diff --git a/ci/script.sh b/ci/script.sh new file mode 100755 index 000000000..2b81d3ccb --- /dev/null +++ b/ci/script.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +set -e + +find . -name "*.vim" -type f | grep -v "cache.vim" | while read filename; do vint -e "$filename"; done + +shellcheck *.sh + +./install.sh