26 lines
561 B
Ruby
Raw Normal View History

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
2016-04-14 14:44:23 +01:00
Homebrew.install_gem_setup_path! "rubocop", "0.39"
args = [
2015-08-02 14:56:01 +01:00
"--format", "simple", "--force-exclusion", "--config",
2015-09-09 15:58:33 +01:00
"#{HOMEBREW_LIBRARY}/.rubocop.yml",
]
args << "--auto-correct" if ARGV.homebrew_developer? && ARGV.flag?("--fix")
args += target
system "rubocop", *args
Homebrew.failed = !$?.success?
end
end