From 2689213f92fbda2a061b959725244d513811b767 Mon Sep 17 00:00:00 2001 From: Dawid Dziurla Date: Wed, 19 Aug 2020 19:49:41 +0200 Subject: [PATCH 1/2] audit: return if no github license were found --- Library/Homebrew/dev-cmd/audit.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb index 67f325fbad304..62354a648a003 100644 --- a/Library/Homebrew/dev-cmd/audit.rb +++ b/Library/Homebrew/dev-cmd/audit.rb @@ -398,6 +398,7 @@ def audit_license return if user.blank? github_license = GitHub.get_repo_license(user, repo) + return unless github_license return if github_license && (licenses + ["NOASSERTION"]).include?(github_license) return if PERMITTED_LICENSE_MISMATCHES[github_license]&.any? { |license| licenses.include? license } return if PERMITTED_FORMULA_LICENSE_MISMATCHES[formula.name] == formula.version From 1f7df4881232246409be800783a59fce6d377483 Mon Sep 17 00:00:00 2001 From: Dawid Dziurla Date: Wed, 19 Aug 2020 23:47:20 +0200 Subject: [PATCH 2/2] audit: remove redundant check Co-authored-by: Rylan Polster --- Library/Homebrew/dev-cmd/audit.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb index 62354a648a003..08386a0f902ce 100644 --- a/Library/Homebrew/dev-cmd/audit.rb +++ b/Library/Homebrew/dev-cmd/audit.rb @@ -399,7 +399,7 @@ def audit_license github_license = GitHub.get_repo_license(user, repo) return unless github_license - return if github_license && (licenses + ["NOASSERTION"]).include?(github_license) + return if (licenses + ["NOASSERTION"]).include?(github_license) return if PERMITTED_LICENSE_MISMATCHES[github_license]&.any? { |license| licenses.include? license } return if PERMITTED_FORMULA_LICENSE_MISMATCHES[formula.name] == formula.version