Merge branch 'license-audit' into license-create

This commit is contained in:
Lionell 2020-06-17 22:19:49 +08:00
commit c643777879
3 changed files with 17 additions and 12 deletions

View File

@ -111,8 +111,10 @@ module Homebrew
# Check style in a single batch run up front for performance
style_results = Style.check_style_json(style_files, options) if style_files
# load licenses
path = File.join(File.dirname(__FILE__), "spdx.json")
spdx_ids = JSON.parse(File.open(File.expand_path(path)).read)
full_path = File.join(File.dirname(__FILE__), "../data/spdx.json")
spdx_ids = File.open(full_path, "r") do |f|
JSON.parse(f.read)
end
new_formula_problem_lines = []
audit_formulae.sort.each do |f|
only = only_cops ? ["style"] : args.only

View File

@ -97,8 +97,12 @@ module Homebrew
describe "#audit_license" do
let(:spdx_ids) {
full_path = File.join(File.expand_path(File.dirname(__FILE__) + "../../../dev-cmd/"), "spdx.json")
JSON.parse(File.open(full_path).read)
# full_path = File.join(File.expand_path(File.dirname(__FILE__) + "../../../data/"), "spdx.json")
full_path = File.join(File.dirname(__FILE__), "../../data/spdx.json")
p full_path
File.open(full_path, "r") do |f|
JSON.parse(f.read)
end
}
let(:custom_spdx_id) { "zzz" }
@ -157,7 +161,6 @@ module Homebrew
it "checks online and detects that a formula-specified license is not "\
"the same as what is indicated on its Github repository" do
# odie "lol"
fa = formula_auditor "cask", <<~RUBY, online: true, spdx_ids: spdx_ids, core_tap: true
class Cask < Formula
url "https://github.com/cask/cask/archive/v0.8.4.tar.gz"