How to integrate rubocop with Rake?

前端 未结 5 1410
一整个雨季
一整个雨季 2021-02-06 22:46

rubocop is a code style checker for Ruby. A similar tool to rubocop, Cane, can be integrated with Rake. I prefer rubocop to Cane since rubocop makes checks based on the Ruby Sty

5条回答
  •  无人及你
    2021-02-06 23:19

    I would recommend shelling out to the rubocop program. It's the simplest solution. Just add this to your Rakefile:

    task test: :rubocop
    
    task :rubocop do
      sh 'rubocop'
    end
    

提交回复
热议问题