brew audit: Checks if a formula has a spdx license
This commit is contained in:
parent
8a6fa73dc1
commit
c10b6bcc3c
@ -12,6 +12,7 @@ require "date"
|
||||
require "missing_formula"
|
||||
require "digest"
|
||||
require "cli/parser"
|
||||
require 'json'
|
||||
|
||||
module Homebrew
|
||||
module_function
|
||||
@ -341,6 +342,14 @@ module Homebrew
|
||||
openssl@1.1
|
||||
].freeze
|
||||
|
||||
def audit_licenses
|
||||
path = File.join(File.dirname(__FILE__),"spdx.json")
|
||||
file = File.open(File.expand_path(path))
|
||||
valid_licenses = JSON.load(file)
|
||||
return if valid_licenses.key?(formula.license)
|
||||
problem "#{formula.license} is not an SPDX license."
|
||||
end
|
||||
|
||||
def audit_deps
|
||||
@specs.each do |spec|
|
||||
# Check for things we don't like to depend on.
|
||||
|
||||
0
Library/Homebrew/dev-cmd/spdx.json
Normal file
0
Library/Homebrew/dev-cmd/spdx.json
Normal file
Loading…
x
Reference in New Issue
Block a user