aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/dev-cmd/audit.rb
diff options
context:
space:
mode:
authorMisty De Meo2017-06-28 20:49:37 -0700
committerMisty De Meo2017-06-28 20:49:37 -0700
commit87fa20076c770e78516265507dd183cc6abc9c00 (patch)
treea9872cb1bab09b6953f2bae476e6cc585c578ede /Library/Homebrew/dev-cmd/audit.rb
parent13576111e0d8c335ef9fb5d6c37c4afbe083224a (diff)
downloadbrew-87fa20076c770e78516265507dd183cc6abc9c00.tar.bz2
audit: ask for full_index patches
Diffstat (limited to 'Library/Homebrew/dev-cmd/audit.rb')
-rw-r--r--Library/Homebrew/dev-cmd/audit.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb
index 1c7476c4b..5b2edfcf6 100644
--- a/Library/Homebrew/dev-cmd/audit.rb
+++ b/Library/Homebrew/dev-cmd/audit.rb
@@ -819,6 +819,13 @@ class FormulaAuditor
def patch_problems(patch)
case patch.url
+ when %r{https?://github\.com/.+/.+/(?:commit|pull)/[a-fA-F0-9]*.(?:patch|diff)}
+ unless patch.url =~ /\?full_index=\w+$/
+ problem <<-EOS.undent
+ GitHub patches should use the full_index parameter:
+ #{patch.url}?full_index=1
+ EOS
+ end
when /raw\.github\.com/, %r{gist\.github\.com/raw}, %r{gist\.github\.com/.+/raw},
%r{gist\.githubusercontent\.com/.+/raw}
unless patch.url =~ /[a-fA-F0-9]{40}/
@@ -827,7 +834,7 @@ class FormulaAuditor
when %r{https?://patch-diff\.githubusercontent\.com/raw/(.+)/(.+)/pull/(.+)\.(?:diff|patch)}
problem <<-EOS.undent
use GitHub pull request URLs:
- https://github.com/#{Regexp.last_match(1)}/#{Regexp.last_match(2)}/pull/#{Regexp.last_match(3)}.patch
+ https://github.com/#{Regexp.last_match(1)}/#{Regexp.last_match(2)}/pull/#{Regexp.last_match(3)}.patch?full_index=1
Rather than patch-diff:
#{patch.url}
EOS