From 3bfca5bcee54846e4e378e53b5783f50edb1ff1a Mon Sep 17 00:00:00 2001 From: lionellloh Date: Wed, 17 Jun 2020 21:45:51 +0800 Subject: [PATCH] audit: change location of spdx.json file --- Library/Homebrew/{dev-cmd => data}/spdx.json | 0 Library/Homebrew/dev-cmd/audit.rb | 4 ++-- Library/Homebrew/test/dev-cmd/audit_spec.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename Library/Homebrew/{dev-cmd => data}/spdx.json (100%) diff --git a/Library/Homebrew/dev-cmd/spdx.json b/Library/Homebrew/data/spdx.json similarity index 100% rename from Library/Homebrew/dev-cmd/spdx.json rename to Library/Homebrew/data/spdx.json diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb index cebaa0766d..f2482be03a 100644 --- a/Library/Homebrew/dev-cmd/audit.rb +++ b/Library/Homebrew/dev-cmd/audit.rb @@ -111,8 +111,8 @@ 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 = JSON.parse(File.open(full_path).read) new_formula_problem_lines = [] audit_formulae.sort.each do |f| only = only_cops ? ["style"] : args.only diff --git a/Library/Homebrew/test/dev-cmd/audit_spec.rb b/Library/Homebrew/test/dev-cmd/audit_spec.rb index 09ca81f4f1..91b1cc77ff 100644 --- a/Library/Homebrew/test/dev-cmd/audit_spec.rb +++ b/Library/Homebrew/test/dev-cmd/audit_spec.rb @@ -97,7 +97,7 @@ module Homebrew describe "#audit_license" do let(:spdx_ids) { - full_path = File.join(File.expand_path(File.dirname(__FILE__) + "../../../dev-cmd/"), "spdx.json") + full_path = File.join(File.expand_path(File.dirname(__FILE__) + "../../../data/"), "spdx.json") JSON.parse(File.open(full_path).read) }