Class: RubyLsp::Reek::Runner
- Inherits:
-
Object
- Object
- RubyLsp::Reek::Runner
- Includes:
- RubyLsp::Requests::Support::Formatter
- Defined in:
- lib/ruby_lsp/reek/runner.rb
Overview
Implements Ruby LSP Formatter interface: specifically run_diagnostic
Instance Method Summary collapse
-
#initialize ⇒ Runner
constructor
A new instance of Runner.
- #run_diagnostic(uri, document) ⇒ Object
-
#run_formatting(_uri, document) ⇒ String
We are not implementing this method, but it is required by the interface.
Constructor Details
#initialize ⇒ Runner
Returns a new instance of Runner.
11 12 13 |
# File 'lib/ruby_lsp/reek/runner.rb', line 11 def initialize @config = ::Reek::Configuration::AppConfiguration.from_default_path end |
Instance Method Details
#run_diagnostic(uri, document) ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/ruby_lsp/reek/runner.rb', line 26 def run_diagnostic(uri, document) path = Pathname.new(uri.path) return [] if path_excluded?(path) examiner = build_examiner(path, document) examiner.smells.map { |smell| warning_to_diagnostic(smell) } end |
#run_formatting(_uri, document) ⇒ String
We are not implementing this method, but it is required by the interface
20 21 22 |
# File 'lib/ruby_lsp/reek/runner.rb', line 20 def run_formatting(_uri, document) document.source end |