aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/dev-cmd/audit.rb
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew/dev-cmd/audit.rb')
-rw-r--r--Library/Homebrew/dev-cmd/audit.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb
index 5b2edfcf6..443a45816 100644
--- a/Library/Homebrew/dev-cmd/audit.rb
+++ b/Library/Homebrew/dev-cmd/audit.rb
@@ -75,16 +75,18 @@ module Homebrew
only_cops = ARGV.value("only-cops").to_s.split(",")
except_cops = ARGV.value("except-cops").to_s.split(",")
+
if !only_cops.empty? && !except_cops.empty?
odie "--only-cops and --except-cops cannot be used simultaneously!"
- elsif (!only_cops.empty? || !except_cops.empty?) && strict
- odie "--only-cops/--except-cops and --strict cannot be used simultaneously"
+ elsif (!only_cops.empty? || !except_cops.empty?) && (strict || ARGV.value("only"))
+ odie "--only-cops/--except-cops and --strict/--only cannot be used simultaneously"
end
options = { fix: ARGV.flag?("--fix"), realpath: true }
if !only_cops.empty?
options[:only_cops] = only_cops
+ ARGV.push("--only=style")
elsif !except_cops.empty?
options[:except_cops] = except_cops
elsif !strict