Sha256: 0cc648bcad2a09209f2d126b92c89782e0f11067adb0640b8229f6780ee34314
Contents?: true
Size: 876 Bytes
Versions: 25
Compression:
Stored size: 876 Bytes
Contents
# typed: strict # frozen_string_literal: true return unless defined?(RubyLsp::Requests::Support::RuboCopRunner) require "singleton" module RubyLsp module Requests module Support # :nodoc: class RuboCopDiagnosticsRunner extend T::Sig include Singleton sig { void } def initialize @runner = T.let(RuboCopRunner.new, RuboCopRunner) end sig { params(uri: URI::Generic, document: Document).returns(T::Array[Support::RuboCopDiagnostic]) } def run(uri, document) filename = T.must(uri.to_standardized_path || uri.opaque) # Invoke RuboCop with just this file in `paths` @runner.run(filename, document.source) @runner.offenses.map do |offense| Support::RuboCopDiagnostic.new(offense, uri) end end end end end end
Version data entries
25 entries across 25 versions & 2 rubygems