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

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

Overview

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

Returns a new instance of ShowCops.



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

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



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

def run
  print_available_cops
end