Class: RuboCop::Runner
- Inherits:
-
Object
- Object
- RuboCop::Runner
- Defined in:
- lib/rubocop/runner.rb
Overview
This class handles the processing of files, which includes dealing with formatters and letting cops inspect the files.
Direct Known Subclasses
Defined Under Namespace
Classes: InfiniteCorrectionLoop
Constant Summary collapse
- MAX_ITERATIONS =
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.
200
- REDUNDANT_COP_DISABLE_DIRECTIVE_RULES =
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.
%w[ Lint/RedundantCopDisableDirective RedundantCopDisableDirective Lint ].freeze
Instance Attribute Summary collapse
-
#aborting ⇒ Object
writeonly
Sets the attribute aborting.
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#warnings ⇒ Object
readonly
Returns the value of attribute warnings.
Class Method Summary collapse
Instance Method Summary collapse
- #aborting? ⇒ Boolean
-
#initialize(options, config_store) ⇒ Runner
constructor
A new instance of Runner.
- #run(paths) ⇒ Object
Constructor Details
#initialize(options, config_store) ⇒ Runner
Returns a new instance of Runner.
59 60 61 62 63 64 65 |
# File 'lib/rubocop/runner.rb', line 59 def initialize(, config_store) @options = @config_store = config_store @errors = [] @warnings = [] @aborting = false end |
Instance Attribute Details
#aborting=(value) ⇒ Object (writeonly)
Sets the attribute aborting
57 58 59 |
# File 'lib/rubocop/runner.rb', line 57 def aborting=(value) @aborting = value end |
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
56 57 58 |
# File 'lib/rubocop/runner.rb', line 56 def errors @errors end |
#warnings ⇒ Object (readonly)
Returns the value of attribute warnings.
56 57 58 |
# File 'lib/rubocop/runner.rb', line 56 def warnings @warnings end |
Class Method Details
.ruby_extractors ⇒ Array<#call>
29 30 31 |
# File 'lib/rubocop/runner.rb', line 29 def ruby_extractors @ruby_extractors ||= [default_ruby_extractor] end |
Instance Method Details
#aborting? ⇒ Boolean
83 84 85 |
# File 'lib/rubocop/runner.rb', line 83 def aborting? @aborting end |
#run(paths) ⇒ Object
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/rubocop/runner.rb', line 67 def run(paths) target_files = find_target_files(paths) if @options[:list_target_files] list_files(target_files) else warm_cache(target_files) if @options[:parallel] inspect_files(target_files) end rescue Interrupt self.aborting = true warn '' warn 'Exiting...' false end |