brew style: --fix to auto-correct issues.

Closes Homebrew/homebrew#37670.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
Baptiste Fontaine 2015-03-13 11:09:32 +01:00 committed by Mike McQuaid
parent 6dc9506edc
commit 04508b0c4d

View File

@ -8,8 +8,16 @@ module Homebrew
Homebrew.install_gem_setup_path! "rubocop"
system "rubocop", "--format", "simple", "--config",
"#{HOMEBREW_LIBRARY}/.rubocop.yml", *target
args = [
"--format", "simple", "--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