diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100644 index 0000000..0fbebed --- /dev/null +++ b/.rubocop.yml @@ -0,0 +1,5 @@ +Metrics/AbcSize: + Enabled: false + +Metrics/BlockLength: + Enabled: false diff --git a/.travis.yml b/.travis.yml index 6e90e83..2b5bdb7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/Gemfile b/Gemfile index ecd554f..0e38c42 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + source 'https://rubygems.org' group :test do diff --git a/Rakefile b/Rakefile index 86f263e..cffdd09 100644 --- a/Rakefile +++ b/Rakefile @@ -1,6 +1,7 @@ +# frozen_string_literal: true + require 'rspec/core/rake_task' RSpec::Core::RakeTask.new(:spec) -task :default => :spec - +task default: :spec diff --git a/spec/filetypes_spec.rb b/spec/filetypes_spec.rb index 7d87609..ac3fcf0 100644 --- a/spec/filetypes_spec.rb +++ b/spec/filetypes_spec.rb @@ -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 '\\' - vim.type "=&filetype" + vim.type '=&filetype' vim.feedkeys '\\' 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