Merge pull request #2516 from hennevogel/bugfix/rubocop_tasks
Only define rubocop tasks in the dev env
This commit is contained in:
commit
9086d5f9bf
1 changed files with 12 additions and 11 deletions
|
|
@ -1,16 +1,17 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require 'rubocop/rake_task'
|
unless Rails.env.production?
|
||||||
|
require 'rubocop/rake_task'
|
||||||
|
|
||||||
namespace :rubocop do
|
RuboCop::RakeTask.new(:rubocop) do |task|
|
||||||
desc 'Generate .rubocop_todo.yml'
|
task.patterns = []
|
||||||
task :auto_gen_config do
|
task.options = ['--display-cop-names']
|
||||||
sh 'rubocop --display-cop-names --auto-gen-config --auto-gen-only-exclude'
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
desc 'Run RuboCop on the whole project'
|
|
||||||
RuboCop::RakeTask.new(:rubocop) do |task|
|
|
||||||
task.patterns = []
|
|
||||||
task.options = ['--display-cop-names']
|
|
||||||
end
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue