From e0cacd3008c4fb84d91db28f941a4cb63edccc2a Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Fri, 2 Jan 2015 13:36:26 +0000 Subject: [PATCH] style: run Rubocop on formulae (new command) --- Library/Homebrew/cmd/style.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 Library/Homebrew/cmd/style.rb diff --git a/Library/Homebrew/cmd/style.rb b/Library/Homebrew/cmd/style.rb new file mode 100644 index 0000000000..132b9d2e3e --- /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