Sha256: 4c571d86c5eb0a0649675e0130ce4311e1f593ecd3888cf34a72d9b9ea6f3c6c
Contents?: true
Size: 886 Bytes
Versions: 12
Compression:
Stored size: 886 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(document, offense, uri) end end end end end end
Version data entries
12 entries across 12 versions & 1 rubygems