From afa5d50b36fbd38f9f1ee24b0aaf977c3d1055e0 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Mon, 23 Jun 2025 08:58:34 +0100 Subject: [PATCH] rubocops/caveats: only apply dynamic logic check to core. This doesn't really matter for non-API taps. --- Library/Homebrew/rubocops/caveats.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Library/Homebrew/rubocops/caveats.rb b/Library/Homebrew/rubocops/caveats.rb index 73922a2d31..77f5cd0ea3 100644 --- a/Library/Homebrew/rubocops/caveats.rb +++ b/Library/Homebrew/rubocops/caveats.rb @@ -48,6 +48,8 @@ module RuboCop problem "Don't use ANSI escape codes in the caveats." if regex_match_group(n, /\e/) end + return if formula_tap != "homebrew-core" + # Forbid dynamic logic in caveats (only if/else/unless) caveats_method = find_method_def(@body, :caveats) return unless caveats_method