Sha256: bbcaceee2a95e2e99c680ad84b4cf4280e731feca3723029d9db004177a6246f

Contents?: true

Size: 683 Bytes

Versions: 2

Compression:

Stored size: 683 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(configuration) = new(configuration).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

2 entries across 2 versions & 1 rubygems

Version Path
rubysmith-0.11.0 lib/rubysmith/builders/rubocop/formatter.rb
rubysmith-0.10.0 lib/rubysmith/builders/rubocop/formatter.rb