Skip to content

Commit

Permalink
formula_auditor: repo should never be nil, so use T.must
Browse files Browse the repository at this point in the history
  • Loading branch information
issyl0 committed Aug 11, 2024
1 parent b6fbd51 commit 621ddc6
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions Library/Homebrew/formula_auditor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 621ddc6

Please sign in to comment.