Merge pull request #3086 from MikeMcQuaid/audit-taps-shush

audit: don't output when searching taps.
This commit is contained in:
Mike McQuaid 2017-08-24 11:17:31 +01:00 committed by GitHub
commit 8b7defb3eb
2 changed files with 5 additions and 3 deletions

View File

@ -102,11 +102,13 @@ module Homebrew
odie "#{query} is not a valid regex"
end
def search_taps(query)
def search_taps(query, silent: false)
return [] if ENV["HOMEBREW_NO_GITHUB_API"]
# Use stderr to avoid breaking parsed output
unless silent
$stderr.puts Formatter.headline("Searching taps on GitHub...", color: :blue)
end
valid_dirnames = ["Formula", "HomebrewFormula", "Casks", "."].freeze
matches = GitHub.search_code(user: ["Homebrew", "caskroom"], filename: query, extension: "rb")

View File

@ -412,7 +412,7 @@ class FormulaAuditor
same_name_tap_formulae = @@local_official_taps_name_map[name] || []
if @online
Homebrew.search_taps(name).each do |tap_formula_full_name|
Homebrew.search_taps(name, silent: true).each do |tap_formula_full_name|
tap_formula_name = tap_formula_full_name.split("/").last
next if tap_formula_name != name
same_name_tap_formulae << tap_formula_full_name