From 70fc82578795a3c99fb149615e2efbf4596ea4a4 Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Tue, 27 Sep 2016 18:48:06 +0200 Subject: Use separate RuboCop configs for formulae and core code. --- Library/Homebrew/cmd/style.rb | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'Library/Homebrew/cmd') diff --git a/Library/Homebrew/cmd/style.rb b/Library/Homebrew/cmd/style.rb index db61116be..1a4b02277 100644 --- a/Library/Homebrew/cmd/style.rb +++ b/Library/Homebrew/cmd/style.rb @@ -19,7 +19,7 @@ require "utils/json" module Homebrew def style target = if ARGV.named.empty? - [HOMEBREW_LIBRARY_PATH] + nil elsif ARGV.named.any? { |file| File.exist? file } ARGV.named elsif ARGV.named.any? { |tap| tap.count("/") == 1 } @@ -49,10 +49,16 @@ module Homebrew args = %W[ --force-exclusion - --config #{HOMEBREW_LIBRARY}/.rubocop.yml ] args << "--auto-correct" if fix - args += files + + if files.nil? + args << "--config" << HOMEBREW_LIBRARY/".rubocop_core.yml" + args += [HOMEBREW_LIBRARY_PATH] + else + args << "--config" << HOMEBREW_LIBRARY/".rubocop_formula.yml" + args += files + end HOMEBREW_LIBRARY.cd do case output_type -- cgit v1.2.3