Sha256: e03537347842363e1f5749a354102f70ef520fbdfa7406d12f0bf0253c2ce285

Contents?: true

Size: 663 Bytes

Versions: 6

Compression:

Stored size: 663 Bytes

Contents

# frozen_string_literal: true

require "rubocop"
require "refinements/ios"

module Rubysmith
  module Builders
    module Rubocop
      # Executes Rubocop auto-correct on newly generated project.
      class Formatter
        using Refinements::IOs

        def self.call(...) = new(...).call

        def initialize configuration, client: RuboCop::CLI.new
          @configuration = configuration
          @client = client
        end

        def call
          STDOUT.squelch { client.run ["--auto-correct", configuration.project_root.to_s] }
          nil
        end

        private

        attr_reader :configuration, :client
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rubysmith-0.16.1 lib/rubysmith/builders/rubocop/formatter.rb
rubysmith-0.16.0 lib/rubysmith/builders/rubocop/formatter.rb
rubysmith-0.15.0 lib/rubysmith/builders/rubocop/formatter.rb
rubysmith-0.14.0 lib/rubysmith/builders/rubocop/formatter.rb
rubysmith-0.13.0 lib/rubysmith/builders/rubocop/formatter.rb
rubysmith-0.12.0 lib/rubysmith/builders/rubocop/formatter.rb