mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
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
16 lines
383 B
Ruby
16 lines
383 B
Ruby
# 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
|