Class: Rubysmith::Extensions::Rubocop

Inherits:
Object
  • Object
show all
Defined in:
lib/rubysmith/extensions/rubocop.rb

Overview

Ensures project skeleton adheres to style guide.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(configuration, client: ::RuboCop::CLI.new) ⇒ Rubocop

Returns a new instance of Rubocop.



14
15
16
17
# File 'lib/rubysmith/extensions/rubocop.rb', line 14

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

Class Method Details

.callObject



12
# File 'lib/rubysmith/extensions/rubocop.rb', line 12

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

Instance Method Details

#callObject



19
20
21
22
# File 'lib/rubysmith/extensions/rubocop.rb', line 19

def call
  STDOUT.squelch { client.run ["--autocorrect-all", configuration.project_root.to_s] }
  configuration
end