Class: RuboCop::CLI::Command::ShowCops Private

Inherits:
Base
  • Object
show all
Defined in:
lib/rubocop/cli/command/show_cops.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.

Shows the given cops, or all cops by default, and their configurations for the current directory.

Instance Attribute Summary

Attributes inherited from Base

#env

Instance Method Summary collapse

Methods inherited from Base

by_command_name, inherited

Constructor Details

#initialize(env) ⇒ ShowCops

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.

Returns a new instance of ShowCops.


12
13
14
15
16
17
# File 'lib/rubocop/cli/command/show_cops.rb', line 12

def initialize(env)
  super

  # Load the configs so the require()s are done for custom cops
  @config = @config_store.for(Dir.pwd)
end

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.


19
20
21
# File 'lib/rubocop/cli/command/show_cops.rb', line 19

def run
  print_available_cops
end