【问题标题】:Adding haml-lint to travis向 travis 添加 haml-lint
【发布时间】:2023-12-28 22:18:01
【问题描述】:

有没有办法可以将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 所说的那样使用钩子吗?

【问题讨论】:

    标签: ruby-on-rails ruby-on-rails-4 haml travis-ci haml-lint


    【解决方案1】:

    我需要将 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
    

    【讨论】: