Skip to content
Snippets Groups Projects
Commit b91587d1 authored by lionellloh's avatar lionellloh Committed by Lionell
Browse files

audit-license: adapt code to use Array of licenses

parent 9a2f84d4
No related branches found
No related tags found
No related merge requests found
......@@ -330,16 +330,16 @@ module Homebrew
def audit_license
if formula.license.present?
if @spdx_data["licenses"].any? { |lic| lic["licenseId"] == formula.license }
if formula.license.any? { |lic| @spdx_data["licenses"].any? { |standard_lic| standard_lic["licenseId"] == lic } }
return unless @online
user, repo = get_repo_data(%r{https?://github\.com/([^/]+)/([^/]+)/?.*}) if @new_formula
return if user.blank?
github_license = GitHub.get_repo_license(user, repo)
return if github_license && [formula.license, "NOASSERTION"].include?(github_license)
return if github_license && (formula.license + ["NOASSERTION"]).include?(github_license)
problem "License mismatch - GitHub license is: #{github_license}, "\
problem "License mismatch - GitHub license is: #{Array(github_license)}, "\
"but Formulae license states: #{formula.license}."
else
problem "#{formula.license} is not a standard SPDX license."
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment