From 56753c9d0877316b36ed262bfcffe06e6f8bac3c Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Wed, 15 Sep 2021 12:23:07 +0100 Subject: [PATCH] rubocops/lines: be less strict about OS.{mac,linux}? in taps. Fixes #12040. --- Library/Homebrew/rubocops/lines.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Library/Homebrew/rubocops/lines.rb b/Library/Homebrew/rubocops/lines.rb index 638ae164f0..9f2005874a 100644 --- a/Library/Homebrew/rubocops/lines.rb +++ b/Library/Homebrew/rubocops/lines.rb @@ -394,6 +394,12 @@ module RuboCop end end + # Don't restrict OS.mac? or OS.linux? usage in taps; they don't care + # as much as we do about e.g. formulae.brew.sh generation, often use + # platform-specific URLs and we don't want to add DSLs to support + # that case. + next if formula_tap != "homebrew-core" + find_instance_method_call(body_node, "OS", if_method_name) do |method| valid = T.let(false, T::Boolean) method.each_ancestor do |ancestor|