From bca922fd5be6ed2e03b5ee2c11522106c5507c50 Mon Sep 17 00:00:00 2001 From: Jan Viljanen <527069+javian@users.noreply.github.com> Date: Thu, 4 Oct 2018 18:09:23 +0200 Subject: [PATCH] rubocop: only use config if style is testing specified file(s) --- Library/Homebrew/style.rb | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Library/Homebrew/style.rb b/Library/Homebrew/style.rb index 79dd43fd55..60198886da 100644 --- a/Library/Homebrew/style.rb +++ b/Library/Homebrew/style.rb @@ -60,13 +60,10 @@ module Homebrew has_non_formula = Array(files).any? do |file| File.expand_path(file).start_with? HOMEBREW_LIBRARY_PATH end - config_file = if files.nil? || has_non_formula - HOMEBREW_LIBRARY_PATH/".rubocop.yml" - else - HOMEBREW_LIBRARY/".rubocop_audit.yml" - end - args << "--config" << config_file + unless files.nil? || has_non_formula + args << "--config" << HOMEBREW_LIBRARY/".rubocop_audit.yml" + end if files.nil? args << HOMEBREW_LIBRARY_PATH