class RuboCop::Lsp::StdinRunner
Originally lifted from: github.com/Shopify/ruby-lsp/blob/8d4c17efce4e8ecc8e7c557ab2981db6b22c0b6d/lib/ruby_lsp/requests/support/rubocop_runner.rb#L20 @api private
Constants
- DEFAULT_RUBOCOP_OPTIONS
Attributes
Public Class Methods
Source
# 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
Calls superclass method
RuboCop::Runner::new
Public Instance Methods
Source
# File lib/rubocop/lsp/stdin_runner.rb, line 74 def formatted_source @options[:stdin] end
rubocop:enable Metrics/MethodLength
Source
# File lib/rubocop/lsp/stdin_runner.rb, line 44 def run(path, contents, options, prism_result: nil) @options = options.merge(DEFAULT_RUBOCOP_OPTIONS) @options[:stdin] = contents @prism_result = prism_result @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.message end raise e rescue RuboCop::ValidationError => e raise ConfigurationError, e.message rescue StandardError => e if defined?(::RubyLsp::Requests::Formatting::Error) raise ::RubyLsp::Requests::Support::InternalRuboCopError, e end raise e end
rubocop:disable Metrics/MethodLength
Calls superclass method
RuboCop::Runner#run
Private Instance Methods
Source
# File lib/rubocop/lsp/stdin_runner.rb, line 80 def file_finished(_file, offenses) @offenses = offenses end