Class: RuboCop::Lsp::StdinRunner Private
- Defined in:
- lib/rubocop/lsp/stdin_runner.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.
Originally lifted from: github.com/Shopify/ruby-lsp/blob/8d4c17efce4e8ecc8e7c557ab2981db6b22c0b6d/lib/ruby_lsp/requests/support/rubocop_runner.rb#L20
Defined Under Namespace
Classes: ConfigurationError
Constant Summary collapse
- DEFAULT_RUBOCOP_OPTIONS =
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.
{ stderr: true, force_exclusion: true, formatters: ['RuboCop::Formatter::BaseFormatter'], raise_cop_error: true, todo_file: nil, todo_ignore_files: [] }.freeze
Constants inherited from Runner
Runner::MAX_ITERATIONS, Runner::REDUNDANT_COP_DISABLE_DIRECTIVE_RULES
Instance Attribute Summary collapse
- #config_for_working_directory ⇒ Object readonly private
- #offenses ⇒ Object readonly private
Attributes inherited from Runner
Instance Method Summary collapse
- #formatted_source ⇒ Object private
-
#initialize(config_store) ⇒ StdinRunner
constructor
private
A new instance of StdinRunner.
- #run(path, contents, options, prism_result: nil) ⇒ Object private
Methods inherited from Runner
Constructor Details
#initialize(config_store) ⇒ StdinRunner
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 StdinRunner.
31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/rubocop/lsp/stdin_runner.rb', line 31 def initialize(config_store) @options = {} @offenses = [] @warnings = [] @errors = [] @config_for_working_directory = config_store.for_pwd super(@options, config_store) end |
Instance Attribute Details
#config_for_working_directory ⇒ Object (readonly)
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.
20 21 22 |
# File 'lib/rubocop/lsp/stdin_runner.rb', line 20 def config_for_working_directory @config_for_working_directory end |
#offenses ⇒ Object (readonly)
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.
20 21 22 |
# File 'lib/rubocop/lsp/stdin_runner.rb', line 20 def offenses @offenses end |
Instance Method Details
#formatted_source ⇒ Object
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.
58 59 60 |
# File 'lib/rubocop/lsp/stdin_runner.rb', line 58 def formatted_source @options[:stdin] end |
#run(path, contents, options, prism_result: nil) ⇒ Object
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.
43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/rubocop/lsp/stdin_runner.rb', line 43 def run(path, contents, , prism_result: nil) @options = .merge(DEFAULT_RUBOCOP_OPTIONS) @options[:stdin] = contents @prism_result = prism_result @offenses = [] @warnings = [] @errors = [] super([path]) raise Interrupt if aborting? end |