Bob W. Hogg 3e0828c29a Rubocop: upgrade to version 0.36.0
Stop using Style/TrailingComma as it is no longer recognized and start using
Style/TrailingCommaInArguments and Style/TrailingCommaInLiteral instead.

Closes Homebrew/homebrew#48144.

Signed-off-by: Xu Cheng <xucheng@me.com>
2016-01-17 16:26:49 +08:00

26 lines
563 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.36.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