module PowerApi::GeneratorHelper::RubocopHelper

Public Instance Methods

format_ruby_file(path) click to toggle source
# File lib/power_api/generator_helper/rubocop_helper.rb, line 4
def format_ruby_file(path)
  return unless File.exist?(path)

  options, paths = RuboCop::Options.new.parse(["-a", "-fa", path])
  runner = RuboCop::Runner.new(options, RuboCop::ConfigStore.new)
  runner.run(paths)
end