mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Only define rubocop tasks in the dev env
This broke loading the rake tasks in the production environment as we only have rubocop in development.
This commit is contained in:
parent
0b6d18e3d3
commit
3f07a8e68c
1 changed files with 12 additions and 11 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue