Merge pull request #7874 from chenrui333/disable-license-check-for-new-formulae

disable license check for new formulae
This commit is contained in:
Bo Anderson 2020-07-01 23:18:10 +01:00 committed by GitHub
commit 05a7a2ccc8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 26 deletions

View File

@ -333,7 +333,8 @@ module Homebrew
].freeze ].freeze
def audit_license def audit_license
if formula.license.present? return if formula.license.blank?
if @spdx_data["licenses"].any? { |lic| lic["licenseId"] == formula.license } if @spdx_data["licenses"].any? { |lic| lic["licenseId"] == formula.license }
return unless @online return unless @online
@ -348,9 +349,6 @@ module Homebrew
else else
problem "#{formula.license} is not a standard SPDX license." problem "#{formula.license} is not a standard SPDX license."
end end
elsif @new_formula
problem "No license specified for package."
end
end end
def audit_deps def audit_deps

View File

@ -99,18 +99,6 @@ module Homebrew
expect(fa.problems).to be_empty expect(fa.problems).to be_empty
end end
it "detects no license info" do
fa = formula_auditor "foo", <<~RUBY, spdx_data: spdx_data, new_formula: true
class Foo < Formula
url "https://brew.sh/foo-1.0.tgz"
license ""
end
RUBY
fa.audit_license
expect(fa.problems.first).to match "No license specified for package."
end
it "detects if license is not a standard spdx-id" do it "detects if license is not a standard spdx-id" do
fa = formula_auditor "foo", <<~RUBY, spdx_data: spdx_data, new_formula: true fa = formula_auditor "foo", <<~RUBY, spdx_data: spdx_data, new_formula: true
class Foo < Formula class Foo < Formula