From b2cccfcf68b131d2eab734b1e105a5b0407a06ba Mon Sep 17 00:00:00 2001 From: Lionell Loh Jian An Date: Fri, 19 Jun 2020 04:00:08 +0800 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Mike McQuaid --- Library/Homebrew/dev-cmd/audit.rb | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb index 1e65db97aa..ac68e2957f 100644 --- a/Library/Homebrew/dev-cmd/audit.rb +++ b/Library/Homebrew/dev-cmd/audit.rb @@ -353,7 +353,7 @@ module Homebrew if @spdx_ids.key?(formula.license) return unless @online - user, repo = get_repo_data(%r{https?://github\.com/([^/]+)/([^/]+)/?.*}, false) + user, repo = get_repo_data(%r{https?://github\.com/([^/]+)/([^/]+)/?.*}) return if user.nil? github_license = GitHub.get_repo_license(user, repo) @@ -369,19 +369,6 @@ module Homebrew end end - # def get_github_repo_license_data(user, repo) - # return unless @online - # - # begin - # res = GitHub.open_api("#{GitHub::API_URL}/repos/#{user}/#{repo}/license") - # return unless res.key?("license") - # - # res["license"]["spdx_id"] || nil - # rescue GitHub::HTTPNotFoundError - # nil - # end - # end - def audit_deps @specs.each do |spec| # Check for things we don't like to depend on. @@ -590,8 +577,6 @@ module Homebrew return unless @core_tap return unless @online - return unless @new_formula || !new_formula_only - _, user, repo = *regex.match(formula.stable.url) if formula.stable _, user, repo = *regex.match(formula.homepage) unless user return if !user || !repo