How to integrate rubocop with Rake?

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

    I highly recommend,

    require 'rubocop/rake_task'
    
    RuboCop::RakeTask.new(:rubocop) do |t|
      t.options = ['--display-cop-names']
    end
    

    This uses the rubocop's own rake tasks and allows you to pass options if you like.

提交回复
热议问题