From 3631765a8d8681d1c2d79aa9079e749d376bcfe5 Mon Sep 17 00:00:00 2001 From: Carlo Cabrera <30379873+carlocab@users.noreply.github.com> Date: Sat, 22 Apr 2023 01:27:35 +0800 Subject: [PATCH] formula_auditor: remove issue comment audit See discussion at Homebrew/homebrew-core#128954. --- Library/Homebrew/formula_auditor.rb | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/Library/Homebrew/formula_auditor.rb b/Library/Homebrew/formula_auditor.rb index 4174530677..35113d38b6 100644 --- a/Library/Homebrew/formula_auditor.rb +++ b/Library/Homebrew/formula_auditor.rb @@ -826,28 +826,6 @@ module Homebrew end end - def audit_github_issue_comment - return unless @online - - matches = text.to_s.scan(%r{https://github.com/([-\w_]*)/([-\w_]*)/(pull|issues)/([0-9]*)}) - return unless matches - - matches.each do |match| - owner, repo, type, id = match - - # Do not trigger for self references - next if "#{owner}/#{repo}" == formula.tap.remote_repo || owner == "Homebrew" - - issue = GitHub::API.open_rest("https://api.github.com/repos/#{owner}/#{repo}/issues/#{id}") - next if issue.blank? - next if issue["state"] == "open" - next if issue.dig("pull_request", "merged_at").present? - - issue_url = "https://github.com/#{owner}/#{repo}/#{type}/#{id}" - problem "Formula refers to a GitHub issue or pull request that is closed: #{issue_url}" - end - end - def audit_reverse_migration # Only enforce for new formula being re-added to core return unless @strict