How to integrate rubocop with Rake?

前端 未结 5 1470
一整个雨季
一整个雨季 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:39

    As of version 0.10.0 rubocop contain a custom rake task that you can use. Just put the following in your Rakefile

    require 'rubocop/rake_task'
    
    RuboCop::RakeTask.new
    

    Make sure to use upper-case 'R' and 'C' or you will get a NameError.

提交回复
热议问题