将 haml-lint 添加到 travis

Adding haml-lint to travis

有什么方法可以将 haml-lint 添加到 travis?我试过这个:

script:
  - bundle exec rubocop --config .rubocop.yml app/models/ app/controllers/ app/mailers/ spec/
  - RAILS_ENV=test xvfb-run bundle exec rspec
  - haml-lint

没用。我得到了

haml-lint
/home/travis/build.sh: line 41: haml-lint: command not found
The command "haml-lint" exited with 127.

我必须像他们 github page 说的那样使用 hook 吗?

我需要将 haml-lint 添加到我的 gemfile。

所以这行得通:

group :test do
  gem 'haml-lint', require: false
end

我不确定为什么,但在 .travis.yml 中我不得不更改:

script:
  - bundle exec rubocop --config .rubocop.yml app/models/ app/controllers/ app/mailers/ spec/
  - RAILS_ENV=test xvfb-run bundle exec rspec
  - haml-lint

至:

script:
  - bundle exec rubocop --config .rubocop.yml app/models/ app/controllers/ app/mailers/ spec/
  - RAILS_ENV=test xvfb-run bundle exec rspec
  - haml-lint app/views