Merge pull request #2516 from hennevogel/bugfix/rubocop_tasks

Only define rubocop tasks in the dev env
This commit is contained in:
Henne Vogelsang 2019-05-08 09:34:18 +02:00 committed by GitHub
commit 9086d5f9bf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,16 +1,17 @@
# frozen_string_literal: true
require 'rubocop/rake_task'
unless Rails.env.production?
require 'rubocop/rake_task'
namespace :rubocop do
desc 'Generate .rubocop_todo.yml'
task :auto_gen_config do
sh 'rubocop --display-cop-names --auto-gen-config --auto-gen-only-exclude'
RuboCop::RakeTask.new(:rubocop) do |task|
task.patterns = []
task.options = ['--display-cop-names']
end
namespace :rubocop do
desc 'Generate .rubocop_todo.yml'
task :auto_gen_config do
sh 'rubocop --display-cop-names --auto-gen-config --auto-gen-only-exclude'
end
end
end
desc 'Run RuboCop on the whole project'
RuboCop::RakeTask.new(:rubocop) do |task|
task.patterns = []
task.options = ['--display-cop-names']
end