diff options
| author | Baptiste Fontaine | 2015-03-13 11:09:32 +0100 |
|---|---|---|
| committer | Mike McQuaid | 2015-03-13 13:21:15 +0000 |
| commit | e2d40f00dfc91bdc0e7b984aac71afe3fcf76b13 (patch) | |
| tree | f22ccc972814a5c0634ab280be2c5f068badfe5e /Library | |
| parent | 540302a98c4d2363fe99a726091517460429860f (diff) | |
| download | homebrew-e2d40f00dfc91bdc0e7b984aac71afe3fcf76b13.tar.bz2 | |
brew style: --fix to auto-correct issues.
Closes #37670.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/cmd/style.rb | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/Library/Homebrew/cmd/style.rb b/Library/Homebrew/cmd/style.rb index 1114c6372..3f78a85dc 100644 --- a/Library/Homebrew/cmd/style.rb +++ b/Library/Homebrew/cmd/style.rb @@ -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 |
