Skip to content

Commit dd209b2

Browse files
authored
Merge pull request #55 from dkarter/add-vint-to-ci
Check linting for vimscript
2 parents 7dde47b + d6cf523 commit dd209b2

File tree

5 files changed

+49
-8
lines changed

5 files changed

+49
-8
lines changed

.rubocop.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Metrics/AbcSize:
2+
Enabled: false
3+
4+
Metrics/BlockLength:
5+
Enabled: false

.travis.yml

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,47 @@ branches:
66
- master
77

88
language: ruby
9-
cache: bundler
9+
10+
env:
11+
HOMEBREW_NO_INSTALL_CLEANUP=1
12+
HOMEBREW_NO_AUTO_UPDATE=1
13+
PYTHON_VERSION=3.8.1
14+
15+
cache:
16+
bundler: true
17+
pip: true
18+
directories:
19+
- $HOME/.rvm
20+
- $HOME/Library/Caches/Homebrew # https://stackoverflow.com/questions/39930171/cache-brew-builds-with-travis-ci
21+
- /usr/local/Homebrew
22+
- $HOME/.cache/pip
23+
- $HOME/.cache/pyenv
24+
1025
rvm:
1126
- '2.7.0'
1227

1328
before_install:
1429
- gem install bundler
15-
- HOMEBREW_NO_INSTALL_CLEANUP=1 HOMEBREW_NO_AUTO_UPDATE=1 brew install macvim
30+
- gem install rubocop
31+
- brew install macvim
32+
33+
install:
34+
- |
35+
which pyenv
36+
whereis pyenv
37+
eval "$(pyenv init -)"
38+
pyenv install --skip-existing "$PYTHON_VERSION"
39+
pyenv global "$PYTHON_VERSION"
40+
pyenv shell "$PYTHON_VERSION"
41+
pyenv local "$PYTHON_VERSION"
42+
pyenv rehash
43+
pip3 --version
44+
pip3 install vim-vint
45+
46+
bundle install
47+
1648
1749
script:
50+
- vint -s --enable-neovim plugin/*.vim
51+
- rubocop
1852
- bundle exec rspec --format documentation

Gemfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
source 'https://rubygems.org'
24

35
group :test do

Rakefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
# frozen_string_literal: true
2+
13
require 'rspec/core/rake_task'
24

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

5-
task :default => :spec
6-
7+
task default: :spec

spec/filetypes_spec.rb

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,17 @@
2626
# filetype to something that isn't text or markdown,
2727
# the rest of the tests are gonna fail.
2828
filename = "#{SecureRandom.hex(6)}.txt"
29-
write_file(filename, "")
29+
write_file(filename, '')
3030

3131
vim.edit filename
3232
vim.type 'i'
3333
vim.feedkeys '\\<c-r>'
34-
vim.type "=&filetype"
34+
vim.type '=&filetype'
3535
vim.feedkeys '\\<cr>'
3636
vim.write
3737

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

40-
expect(["markdown", "text"]).to include(file_contents)
40+
expect(%w[markdown text]).to include(file_contents)
4141
end
42-
4342
end

0 commit comments

Comments
 (0)