brew style --fix

This commit is contained in:
lionellloh 2020-07-12 13:21:42 +08:00 committed by Lionell
parent 797a07d555
commit 3982810eab
3 changed files with 11 additions and 11 deletions

View File

@ -333,6 +333,7 @@ module Homebrew
non_standard_licenses = []
formula.license.each do |lic|
next if @spdx_data["licenses"].any? { |standard_lic| standard_lic["licenseId"] == lic }
non_standard_licenses << lic
end
@ -351,7 +352,6 @@ module Homebrew
problem "License mismatch - GitHub license is: #{Array(github_license)}, "\
"but Formulae license states: #{formula.license}."
elsif @new_formula
problem "No license specified for package."
end

View File

@ -2214,7 +2214,7 @@ class Formula
# <pre>license "BSD-2-Clause"</pre>
def license(args = nil)
if args.nil?
return @licenses
@licenses
else
@licenses = Array(args) unless args == ""
puts @licenses

View File

@ -1123,7 +1123,7 @@ class FormulaInstaller
next if @ignore_deps
dep_f = dep.to_formula
next unless dep_f.license.all?{ |lic| forbidden_licenses.include? lic }
next unless dep_f.license.all? { |lic| forbidden_licenses.include? lic }
raise CannotInstallFormulaError, <<~EOS
The installation of #{formula.name} has a dependency on #{dep.name} where all its licenses are forbidden: #{dep_f.license}.