From 621ddc60d1653f27fc375f480a915da10b3aab4b Mon Sep 17 00:00:00 2001 From: Issy Long Date: Sat, 10 Aug 2024 21:44:26 +0100 Subject: [PATCH] formula_auditor: `repo` should never be nil, so use `T.must` https://github.com/Homebrew/brew/pull/18004#discussion_r1712680763 --- Library/Homebrew/formula_auditor.rb | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/Library/Homebrew/formula_auditor.rb b/Library/Homebrew/formula_auditor.rb index 371635f967e16..264c9b6702c91 100644 --- a/Library/Homebrew/formula_auditor.rb +++ b/Library/Homebrew/formula_auditor.rb @@ -776,28 +776,24 @@ def audit_specs problem "#{stable.version} is a development release" when %r{https?://gitlab\.com/([\w-]+)/([\w-]+)} - owner = Regexp.last_match(1) - repo = Regexp.last_match(2) + owner = T.must(T.must(Regexp.last_match(1))) + repo = T.must(T.must(Regexp.last_match(2))) tag = SharedAudits.gitlab_tag_from_url(url) tag ||= stable.specs[:tag] tag ||= stable.version if @online - return if owner.nil? || repo.nil? - error = SharedAudits.gitlab_release(owner, repo, tag, formula:) problem error if error end when %r{^https://github.com/([\w-]+)/([\w-]+)} - owner = Regexp.last_match(1) - repo = Regexp.last_match(2) + owner = T.must(Regexp.last_match(1)) + repo = T.must(Regexp.last_match(2)) tag = SharedAudits.github_tag_from_url(url) tag ||= formula.stable.specs[:tag] if @online - return if owner.nil? || repo.nil? - error = SharedAudits.github_release(owner, repo, tag, formula:) problem error if error end