Sha256: b2addcbd3dcab5fff41e26d1d460dfb9a00c3bec7295bf93096ea2fd10206d10
Contents?: true
Size: 911 Bytes
Versions: 37
Compression:
Stored size: 911 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 RuboCopFormattingRunner extend T::Sig include Singleton include Support::FormatterRunner sig { void } def initialize # -a is for "--auto-correct" (or "--autocorrect" on newer versions of RuboCop) @runner = T.let(RuboCopRunner.new("-a"), RuboCopRunner) end sig { override.params(uri: URI::Generic, document: Document).returns(String) } 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.formatted_source end end end end end
Version data entries
37 entries across 37 versions & 2 rubygems