From 840fbd69fb8edb15e9dd017c17e187a6025ad47c Mon Sep 17 00:00:00 2001 From: Gautham Goli Date: Tue, 30 Oct 2018 23:44:14 +0530 Subject: [PATCH] audit: Don't mutate args --- Library/Homebrew/dev-cmd/audit.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb index 636cfdf6f7..ae0fc99714 100644 --- a/Library/Homebrew/dev-cmd/audit.rb +++ b/Library/Homebrew/dev-cmd/audit.rb @@ -134,7 +134,6 @@ module Homebrew if only_cops options[:only_cops] = only_cops - args.only = ["style"] elsif args.new_formula? nil elsif strict @@ -151,7 +150,8 @@ module Homebrew new_formula_problem_lines = [] ff.sort.each do |f| - options = { new_formula: new_formula, strict: strict, online: online, only: args.only, except: args.except } + only = only_cops ? ["style"] : args.only + options = { new_formula: new_formula, strict: strict, online: online, only: only, except: args.except } options[:style_offenses] = style_results.file_offenses(f.path) fa = FormulaAuditor.new(f, options) fa.audit