Class: Aptible::Tasks::Rubocop

Inherits:
Object
  • Object
show all
Defined in:
lib/aptible/tasks/rubocop.rb

Instance Method Summary collapse

Instance Method Details

#configObject



10
11
12
# File 'lib/aptible/tasks/rubocop.rb', line 10

def config
  ::Rubocop::ConfigLoader.load_file(config_file)
end

#config_fileObject



6
7
8
# File 'lib/aptible/tasks/rubocop.rb', line 6

def config_file
  File.join(File.dirname(__FILE__), '..', '..', '..', '.rubocop.yml')
end

#runObject



14
15
16
17
18
# File 'lib/aptible/tasks/rubocop.rb', line 14

def run
  cli = ::Rubocop::CLI.new
  result = cli.run(%W( -c #{config_file} ))
  abort unless result == 0
end