Cask#full_name: properly output Homebrew org names

This was not returning the full name correctly for e.g. anything in
Homebrew/homebrew-fonts.

While we're here, fix up a few other places where `tap.core_cask_tap?`
can be used more appropriately.
This commit is contained in:
Mike McQuaid 2023-12-13 13:17:12 +00:00
parent cd8a9c02cb
commit 79a6091d08
No known key found for this signature in database
GPG Key ID: 3338A31AFDB1D829
4 changed files with 6 additions and 6 deletions

View File

@ -793,7 +793,7 @@ module Cask
sig { void } sig { void }
def audit_cask_path def audit_cask_path
return if cask.tap != "homebrew/cask" return unless cask.tap.core_cask_tap?
expected_path = cask.tap.new_cask_path(cask.token) expected_path = cask.tap.new_cask_path(cask.token)

View File

@ -122,7 +122,7 @@ module Cask
def full_name def full_name
return token if tap.nil? return token if tap.nil?
return token if tap.user == "Homebrew" return token if tap.core_cask_tap?
"#{tap.name}/#{token}" "#{tap.name}/#{token}"
end end

View File

@ -73,8 +73,8 @@ module Homebrew
other_taps = {} other_taps = {}
formulae_and_casks_to_check.each do |formula_or_cask| formulae_and_casks_to_check.each do |formula_or_cask|
next if formula_or_cask.tap.blank? next if formula_or_cask.tap.blank?
next if formula_or_cask.tap.name == CoreTap.instance.name next if formula_or_cask.tap.core_tap?
next if formula_or_cask.tap.name == "homebrew/cask" next if formula_or_cask.tap.core_cask_tap?
next if other_taps[formula_or_cask.tap.name] next if other_taps[formula_or_cask.tap.name]
other_taps[formula_or_cask.tap.name] = formula_or_cask.tap other_taps[formula_or_cask.tap.name] = formula_or_cask.tap

View File

@ -307,7 +307,7 @@ describe Cask::Audit, :cask do
let(:cask_token) { "token-beta" } let(:cask_token) { "token-beta" }
it "fails if the cask is from an official tap" do it "fails if the cask is from an official tap" do
allow(cask).to receive(:tap).and_return(Tap.fetch("homebrew/cask")) allow(cask).to receive(:tap).and_return(CoreCaskTap.instance)
expect(run).to error_with(/token contains version designation/) expect(run).to error_with(/token contains version designation/)
end end
@ -369,7 +369,7 @@ describe Cask::Audit, :cask do
context "when cask token is in tap_migrations.json and" do context "when cask token is in tap_migrations.json and" do
let(:cask_token) { "token-migrated" } let(:cask_token) { "token-migrated" }
let(:tap) { Tap.fetch("homebrew/cask") } let(:tap) { CoreCaskTap.instance }
before do before do
allow(tap).to receive(:tap_migrations).and_return({ cask_token => "homebrew/core" }) allow(tap).to receive(:tap_migrations).and_return({ cask_token => "homebrew/core" })