aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorBaptiste Fontaine2015-03-13 11:09:32 +0100
committerMike McQuaid2015-03-13 13:21:15 +0000
commit04508b0c4d919c4284c84d50cf077f3742540198 (patch)
tree8e0d216f1193fef9140eafe7aec62d80301ecb6e /Library
parent6dc9506edca9ffc730abd8ae4dcb352afa9e2f95 (diff)
downloadbrew-04508b0c4d919c4284c84d50cf077f3742540198.tar.bz2
brew style: --fix to auto-correct issues.
Closes Homebrew/homebrew#37670. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/style.rb12
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