From 0cced8e7bd2e0b5e52448dc0448a033bb03ec54b Mon Sep 17 00:00:00 2001 From: Issy Long Date: Mon, 25 May 2020 12:18:41 +0100 Subject: [PATCH 1/2] audit: Fix Regexp for stripping `.git` from repo URLs - [For a formula named turbogit](https://github.com/Homebrew/homebrew-core/pull/55208), we didn't see any of the notability checks fail CI. - The repo name was getting truncated to `turb`, which didn't exist, so the audit didn't return anything for this check. - The Regexp to strip `.git` from the end of was not escaping the `.`, so it would match anything ending in `git`, not a literal `.git`. --- 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 fb51905299856..3dae202eebe19 100644 --- a/Library/Homebrew/dev-cmd/audit.rb +++ b/Library/Homebrew/dev-cmd/audit.rb @@ -597,7 +597,7 @@ def get_repo_data(regex) _, user, repo = *regex.match(formula.homepage) unless user return if !user || !repo - repo.gsub!(/.git$/, "") + repo.delete_suffix!(".git") [user, repo] end From d14eed6cec1b459d760aa15232f0155fb0884c13 Mon Sep 17 00:00:00 2001 From: Issy Long Date: Mon, 25 May 2020 12:52:42 +0100 Subject: [PATCH 2/2] audit: Remove call to deprecated `created_pr_comment` method MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ``` ➜ brew audit --online --new-formula --verbose turbogit turbogit: * GitHub repository not notable enough (<30 forks, <30 watchers and <75 stars) * GitHub repository too new (<30 days old) Error: undefined local variable or method `created_pr_comment' for Homebrew:Module /usr/local/Homebrew/Library/Homebrew/dev-cmd/audit.rb:148:in `audit' /usr/local/Homebrew/Library/Homebrew/brew.rb:110:in `
' ``` - This was removed in 4f75a77b089e65ff9e03c65d192808aa4ea6842f. We can't post PR comments from GitHub Actions CI from forks. --- Library/Homebrew/dev-cmd/audit.rb | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb index 3dae202eebe19..cd08395aa72b6 100644 --- a/Library/Homebrew/dev-cmd/audit.rb +++ b/Library/Homebrew/dev-cmd/audit.rb @@ -144,10 +144,7 @@ def audit errors_summary = "#{problem_plural} in #{formula_plural} detected" errors_summary += ", #{corrected_problem_plural} corrected" if corrected_problem_count.positive? - if problem_count.positive? || - (new_formula_problem_count.positive? && !created_pr_comment) - ofail errors_summary - end + ofail errors_summary if problem_count.positive? || new_formula_problem_count.positive? end def format_problem_lines(problems)