Class: RuboCop::CLI::Command::Explain Private
| Relationships & Source Files | |
| Super Chains via Extension / Inclusion / Inheritance | |
|
Class Chain:
self,
Base
|
|
|
Instance Chain:
|
|
| Inherits: |
RuboCop::CLI::Command::Base
|
| Defined in: | lib/rubocop/cli/command/explain.rb |
Overview
Explains what cops do, as described by ::RuboCop::Cop::CopExplanation.
Class Attribute Summary
Base - Inherited
Class Method Summary
- .new(env) ⇒ Explain constructor Internal use only
Base - Inherited
Instance Attribute Summary
Instance Method Summary
- #run Internal use only
CopNames - Included
| #cop_class_for | Not memoized: the MCP server lives long enough for a plugin to register a cop after a lookup has missed it. |
| #department?, #department_message, | |
| #known_cop_classes | The cops among |
| #unknown_cop_message, #validate_cop_names! | |
Constructor Details
.new(env) ⇒ Explain
Instance Method Details
#run
[ GitHub ]# File 'lib/rubocop/cli/command/explain.rb', line 19
def run names = @options[:explain] known_cop_classes(names).each_with_index do |cop_class, index| puts if index.positive? puts Cop::CopExplanation.new(cop_class, @config) end # Checked after printing, so a typo in a list does not cost you the # explanations you asked for alongside it. validate_cop_names!(names) end