Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

audit: don't care about shadowing official taps. #3236

Merged
merged 1 commit into from Sep 29, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
32 changes: 3 additions & 29 deletions Library/Homebrew/dev-cmd/audit.rb
Expand Up @@ -396,7 +396,6 @@ def audit_formula_name
return if formula.tap.nil? || !formula.tap.official?

name = formula.name
full_name = formula.full_name

if Homebrew::MissingFormula.blacklisted_reason(name)
problem "'#{name}' is blacklisted."
Expand All @@ -412,35 +411,10 @@ def audit_formula_name
return
end

if !formula.core_formula? && Formula.core_names.include?(name)
problem "Formula name conflicts with existing core formula."
return
end

@@local_official_taps_name_map ||= Tap.select(&:official?).flat_map(&:formula_names)
.each_with_object({}) do |tap_formula_full_name, name_map|
next if tap_formula_full_name.start_with?("homebrew/science/")
tap_formula_name = tap_formula_full_name.split("/").last
name_map[tap_formula_name] ||= []
name_map[tap_formula_name] << tap_formula_full_name
name_map
end

same_name_tap_formulae = @@local_official_taps_name_map[name] || []

if @online
Homebrew.search_taps(name, silent: true).each do |tap_formula_full_name|
next if tap_formula_full_name.start_with?("homebrew/science/")
tap_formula_name = tap_formula_full_name.split("/").last
next if tap_formula_name != name
same_name_tap_formulae << tap_formula_full_name
end
end

same_name_tap_formulae.delete(full_name)
return if formula.core_formula?
return unless Formula.core_names.include?(name)

return if same_name_tap_formulae.empty?
problem "Formula name conflicts with #{same_name_tap_formulae.join ", "}"
problem "Formula name conflicts with existing core formula."
end

def audit_deps
Expand Down