Skip to content

Instantly share code, notes, and snippets.

@matthijsgroen
Created July 17, 2014 07:04
Show Gist options
  • Save matthijsgroen/df536872f095f8bcca13 to your computer and use it in GitHub Desktop.
Save matthijsgroen/df536872f095f8bcca13 to your computer and use it in GitHub Desktop.
if Rails.env.development?
require 'rubocop/rake_task'
# http://img4.wikia.nocookie.net/__cb20131111193341/lego/images/8/8b/Good_bad_cop.png
namespace :cop do
desc 'Run RuboCop using the CI config'
RuboCop::RakeTask.new(:good) do |task|
task.formatters = ['progress']
task.options = [['--config', 'tools/ci/rubocop.yml']]
task.fail_on_error = true
end
desc 'Run RuboCop the most strict config'
RuboCop::RakeTask.new(:bad) do |task|
task.formatters = ['offenses']
# don't abort rake on failure
task.fail_on_error = false
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment