Merge pull request #7877 from Homebrew/revert-7874-disable-license-check-for-new-formulae
Revert "disable license check for new formulae"
This commit is contained in:
commit
c69d97aaa5
@ -333,8 +333,7 @@ module Homebrew
|
||||
].freeze
|
||||
|
||||
def audit_license
|
||||
return if formula.license.blank?
|
||||
|
||||
if formula.license.present?
|
||||
if @spdx_data["licenses"].any? { |lic| lic["licenseId"] == formula.license }
|
||||
return unless @online
|
||||
|
||||
@ -349,6 +348,9 @@ module Homebrew
|
||||
else
|
||||
problem "#{formula.license} is not a standard SPDX license."
|
||||
end
|
||||
elsif @new_formula
|
||||
problem "No license specified for package."
|
||||
end
|
||||
end
|
||||
|
||||
def audit_deps
|
||||
|
@ -99,6 +99,18 @@ module Homebrew
|
||||
expect(fa.problems).to be_empty
|
||||
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
|
||||
fa = formula_auditor "foo", <<~RUBY, spdx_data: spdx_data, new_formula: true
|
||||
class Foo < Formula
|
||||
|
Loading…
x
Reference in New Issue
Block a user