Class: RuboCop::CLI::Command::SuggestExtensions Private

Inherits:
Base
  • Object
show all
Defined in:
lib/rubocop/cli/command/suggest_extensions.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Suggest RuboCop extensions to install based on Gemfile dependencies. Only primary dependencies are evaluated, so if a dependency depends on a gem with an extension, it is not suggested. However, if an extension is a transitive dependency, it will not be suggested.

Constant Summary collapse

INCLUDED_FORMATTERS =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Combination of short and long formatter names.

%w[p progress fu fuubar pa pacman].freeze

Instance Attribute Summary

Attributes inherited from Base

#env

Instance Method Summary collapse

Methods inherited from Base

by_command_name, inherited, #initialize

Constructor Details

This class inherits a constructor from RuboCop::CLI::Command::Base

Instance Method Details

#runObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



17
18
19
20
21
22
23
24
25
26
# File 'lib/rubocop/cli/command/suggest_extensions.rb', line 17

def run
  return if skip? || extensions.none?

  print_install_suggestions if not_installed_extensions.any?
  print_load_suggestions if installed_and_not_loaded_extensions.any?

  print_opt_out_instruction

  puts if @options[:display_time]
end