Merge pull request #20155 from Homebrew/core-caveats

rubocops/caveats: only apply dynamic logic check to core.
This commit is contained in:
Mike McQuaid 2025-06-23 08:17:08 +00:00 committed by GitHub
commit cfede01ea9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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