Tomasz Pajor c4ceaabfc1 style: update to rubocop 0.34.0.
Closes Homebrew/homebrew#43650.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-09-08 15:08:46 +01:00

26 lines
562 B
Ruby

module Homebrew
def style
target = if ARGV.named.empty?
[HOMEBREW_LIBRARY]
elsif ARGV.named.any? { |file| File.exist? file }
ARGV.named
else
ARGV.formulae.map(&:path)
end
Homebrew.install_gem_setup_path! "rubocop", "0.34.0"
args = [
"--format", "simple", "--force-exclusion", "--config",
"#{HOMEBREW_LIBRARY}/.rubocop.yml"
]
args << "--auto-correct" if ARGV.homebrew_developer? && ARGV.flag?("--fix")
args += target
system "rubocop", *args
Homebrew.failed = !$?.success?
end
end