diff --git a/Library/Homebrew/rubocops/lines.rb b/Library/Homebrew/rubocops/lines.rb index aaab76b904..fa1d1f2b27 100644 --- a/Library/Homebrew/rubocops/lines.rb +++ b/Library/Homebrew/rubocops/lines.rb @@ -180,7 +180,7 @@ module RuboCop end [:mac?, :linux?].each do |method_name| - next if formula_tap != "homebrew-core" || file_path&.match(/linuxbrew/) + next if formula_tap != "homebrew-core" || file_path&.include?("linuxbrew") find_instance_method_call(body_node, "OS", method_name) do |check| problem "Don't use #{check.source}; Homebrew/core only supports macOS"