diff options
Diffstat (limited to 'rubocop/check_graceful_task.rb')
-rw-r--r-- | rubocop/check_graceful_task.rb | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/rubocop/check_graceful_task.rb b/rubocop/check_graceful_task.rb index 7bf678def83..d16d3d315bf 100644 --- a/rubocop/check_graceful_task.rb +++ b/rubocop/check_graceful_task.rb @@ -15,17 +15,14 @@ module RuboCop --format RuboCop::Formatter::GracefulFormatter ] - available_cops = RuboCop::Cop::Registry.global.to_h - - cop_names, paths = args.partition { available_cops.key?(_1) } + # Convert from Rake::TaskArguments into an Array to make `any?` work as expected. + cop_names = args.to_a if cop_names.any? list = cop_names.sort.join(',') options.concat ['--only', list] end - options.concat(paths) - puts <<~MSG Running RuboCop in graceful mode: rubocop #{options.join(' ')} |