Add rake tasks for Rubocop

To always run rubocop with the same options (specially important when
regenerating the todo file).

It creates the following three tasks:

rake rubocop                     # Run RuboCop on the whole project
rake rubocop:auto_correct        # Auto-correct RuboCop offenses
rake rubocop:auto_gen_config     # Generate .rubocop_todo.yml
This commit is contained in:
Ana María Martínez Gómez 2019-04-29 16:26:13 +02:00
parent 3fabb7a1e2
commit e31d848e75
No known key found for this signature in database
GPG key ID: EACB9B4BC80C0347
4 changed files with 16 additions and 0 deletions

Binary file not shown.

BIN
lib/tasks/.data.rake.swp Normal file

Binary file not shown.

BIN
lib/tasks/.rubocop.rake.swp Normal file

Binary file not shown.

16
lib/tasks/rubocop.rake Normal file
View file

@ -0,0 +1,16 @@
# frozen_string_literal: true
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'
end
end
desc 'Run RuboCop on the whole project'
RuboCop::RakeTask.new(:rubocop) do |task|
task.patterns = []
task.options = ['--display-cop-names']
end