aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike McQuaid2015-01-02 13:36:26 +0000
committerMike McQuaid2015-01-04 11:05:34 +0000
commite0cacd3008c4fb84d91db28f941a4cb63edccc2a (patch)
tree957214bcb98024af0e58a43a1763c36283c50d6f
parent1cd0a47067a42720d6ca0c286eefce2beffe83c1 (diff)
downloadbrew-e0cacd3008c4fb84d91db28f941a4cb63edccc2a.tar.bz2
style: run Rubocop on formulae (new command)
-rw-r--r--Library/Homebrew/cmd/style.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/Library/Homebrew/cmd/style.rb b/Library/Homebrew/cmd/style.rb
new file mode 100644
index 000000000..132b9d2e3
--- /dev/null
+++ b/Library/Homebrew/cmd/style.rb
@@ -0,0 +1,14 @@
+module Homebrew
+ def style
+ target = if ARGV.named.empty?
+ [HOMEBREW_LIBRARY]
+ else
+ ARGV.formulae.map(&:path)
+ end
+
+ Homebrew.install_gem_setup_path! "rubocop"
+
+ system "rubocop", "--format", "simple", *target
+ Homebrew.failed = !$?.success?
+ end
+end