From 8c167b23cce58a155da34c14ebe994601534ff2f Mon Sep 17 00:00:00 2001 From: Gautham Goli Date: Fri, 30 Jun 2017 10:58:24 +0530 Subject: audit: Don't run audit methods when `--only-cops` is passed --- Library/Homebrew/cmd/style.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Library/Homebrew/cmd') diff --git a/Library/Homebrew/cmd/style.rb b/Library/Homebrew/cmd/style.rb index c6201e371..51937c3e5 100644 --- a/Library/Homebrew/cmd/style.rb +++ b/Library/Homebrew/cmd/style.rb @@ -94,7 +94,11 @@ module Homebrew RuboCop::Cop::Cop.registry.departments.include?(cop.to_sym) end - args << "--only" << cops_to_include.join(",") unless cops_to_include.empty? + if cops_to_include.empty? + odie "RuboCops #{options[:only_cops].join(",")} were not found" + end + + args << "--only" << cops_to_include.join(",") end if files.nil? -- cgit v1.2.3