Class: RuboCop::Lsp::StdinRunner Private
Do not use. This class is for internal use only.
Relationships & Source Files | |
Namespace Children | |
Exceptions:
| |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
::RuboCop::Runner
|
|
Instance Chain:
self,
::RuboCop::Runner
|
|
Inherits: |
RuboCop::Runner
|
Defined in: | lib/rubocop/lsp/stdin_runner.rb |
Overview
Constant Summary
-
DEFAULT_RUBOCOP_OPTIONS =
# File 'lib/rubocop/lsp/stdin_runner.rb', line 22{ stderr: true, force_exclusion: true, formatters: ['RuboCop::Formatter::BaseFormatter'], raise_cop_error: true, todo_file: nil, todo_ignore_files: [] }.freeze
::RuboCop::Runner
- Inherited
Class Method Summary
- .new(config_store) ⇒ StdinRunner constructor Internal use only
::RuboCop::Runner
- Inherited
Instance Attribute Summary
- #config_for_working_directory readonly Internal use only
- #offenses readonly Internal use only
::RuboCop::Runner
- Inherited
Instance Method Summary
- #formatted_source Internal use only
- #run(path, contents, options) Internal use only
- #file_finished(_file, offenses) private Internal use only
::RuboCop::Runner
- Inherited
Instance Attribute Details
#config_for_working_directory (readonly)
[ GitHub ]# File 'lib/rubocop/lsp/stdin_runner.rb', line 20
attr_reader :offenses, :config_for_working_directory
#offenses (readonly)
[ GitHub ]# File 'lib/rubocop/lsp/stdin_runner.rb', line 20
attr_reader :offenses, :config_for_working_directory
Instance Method Details
#file_finished(_file, offenses) (private)
[ GitHub ]#formatted_source
[ GitHub ]# File 'lib/rubocop/lsp/stdin_runner.rb', line 72
def formatted_source @options[:stdin] end
#run(path, contents, options)
[ GitHub ]# File 'lib/rubocop/lsp/stdin_runner.rb', line 44
def run(path, contents, ) @options = .merge(DEFAULT_RUBOCOP_OPTIONS) @options[:stdin] = contents @offenses = [] @warnings = [] @errors = [] super([path]) raise Interrupt if aborting? rescue RuboCop::Runner::InfiniteCorrectionLoop => e if defined?(::RubyLsp::Requests::Formatting::Error) raise ::RubyLsp::Requests::Formatting::Error, e. end raise e rescue RuboCop::ValidationError => e raise ConfigurationError, e. rescue StandardError => e if defined?(::RubyLsp::Requests::Formatting::Error) raise ::RubyLsp::Requests::Support::InternalRuboCopError, e end raise e end