Skip to content

Commit

Permalink
Merge pull request #55 from dkarter/add-vint-to-ci
Browse files Browse the repository at this point in the history
Check linting for vimscript
  • Loading branch information
dkarter committed Mar 9, 2020
2 parents 7dde47b + d6cf523 commit dd209b2
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 8 deletions.
5 changes: 5 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Metrics/AbcSize:
Enabled: false

Metrics/BlockLength:
Enabled: false
38 changes: 36 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,47 @@ branches:
- master

language: ruby
cache: bundler

env:
HOMEBREW_NO_INSTALL_CLEANUP=1
HOMEBREW_NO_AUTO_UPDATE=1
PYTHON_VERSION=3.8.1

cache:
bundler: true
pip: true
directories:
- $HOME/.rvm
- $HOME/Library/Caches/Homebrew # https://stackoverflow.com/questions/39930171/cache-brew-builds-with-travis-ci
- /usr/local/Homebrew
- $HOME/.cache/pip
- $HOME/.cache/pyenv

rvm:
- '2.7.0'

before_install:
- gem install bundler
- HOMEBREW_NO_INSTALL_CLEANUP=1 HOMEBREW_NO_AUTO_UPDATE=1 brew install macvim
- gem install rubocop
- brew install macvim

install:
- |
which pyenv
whereis pyenv
eval "$(pyenv init -)"
pyenv install --skip-existing "$PYTHON_VERSION"
pyenv global "$PYTHON_VERSION"
pyenv shell "$PYTHON_VERSION"
pyenv local "$PYTHON_VERSION"
pyenv rehash
pip3 --version
pip3 install vim-vint
bundle install
script:
- vint -s --enable-neovim plugin/*.vim
- rubocop
- bundle exec rspec --format documentation
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

source 'https://rubygems.org'

group :test do
Expand Down
5 changes: 3 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# frozen_string_literal: true

require 'rspec/core/rake_task'

RSpec::Core::RakeTask.new(:spec)

task :default => :spec

task default: :spec
7 changes: 3 additions & 4 deletions spec/filetypes_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,17 @@
# filetype to something that isn't text or markdown,
# the rest of the tests are gonna fail.
filename = "#{SecureRandom.hex(6)}.txt"
write_file(filename, "")
write_file(filename, '')

vim.edit filename
vim.type 'i'
vim.feedkeys '\\<c-r>'
vim.type "=&filetype"
vim.type '=&filetype'
vim.feedkeys '\\<cr>'
vim.write

file_contents = normalize_string_indent(IO.read(filename)).strip

expect(["markdown", "text"]).to include(file_contents)
expect(%w[markdown text]).to include(file_contents)
end

end

0 comments on commit dd209b2

Please sign in to comment.