diff options
| author | Mike McQuaid | 2017-07-25 13:46:19 +0100 |
|---|---|---|
| committer | GitHub | 2017-07-25 13:46:19 +0100 |
| commit | 7041f7eb00004335c026236885f84bd8c0018c0d (patch) | |
| tree | c11a6ed19f4ff44f58a18ed4221899789168b420 /Library/Homebrew/dev-cmd | |
| parent | 0b0ab9b606d9c2ee6e79c4f63c959c7d62c13a52 (diff) | |
| parent | b7ddd271e1d3b983b0fffbb6d87f0b45a3abcb9e (diff) | |
| download | brew-7041f7eb00004335c026236885f84bd8c0018c0d.tar.bz2 | |
Merge pull request #2911 from GauthamGoli/audit_urls_rubocop_part_1
audit: Port audit_urls partially to rubocop and add corresponding tests
Diffstat (limited to 'Library/Homebrew/dev-cmd')
| -rw-r--r-- | Library/Homebrew/dev-cmd/audit.rb | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb index 4bcfdd128..327c3e811 100644 --- a/Library/Homebrew/dev-cmd/audit.rb +++ b/Library/Homebrew/dev-cmd/audit.rb @@ -1282,56 +1282,7 @@ class ResourceAuditor end def audit_urls - # Check GNU urls; doesn't apply to mirrors - if url =~ %r{^(?:https?|ftp)://ftpmirror.gnu.org/(.*)} - problem "Please use \"https://ftp.gnu.org/gnu/#{Regexp.last_match(1)}\" instead of #{url}." - end - - # Fossies upstream requests they aren't used as primary URLs - # https://github.com/Homebrew/homebrew-core/issues/14486#issuecomment-307753234 - if url =~ %r{^https?://fossies\.org/} - problem "Please don't use fossies.org in the url (using as a mirror is fine)" - end - - if mirrors.include?(url) - problem "URL should not be duplicated as a mirror: #{url}" - end - urls = [url] + mirrors - - # Check a variety of SSL/TLS URLs that don't consistently auto-redirect - # or are overly common errors that need to be reduced & fixed over time. - urls.each do |p| - case p - when %r{^http://ftp\.gnu\.org/}, - %r{^http://ftpmirror\.gnu\.org/}, - %r{^http://download\.savannah\.gnu\.org/}, - %r{^http://download-mirror\.savannah\.gnu\.org/}, - %r{^http://[^/]*\.apache\.org/}, - %r{^http://code\.google\.com/}, - %r{^http://fossies\.org/}, - %r{^http://mirrors\.kernel\.org/}, - %r{^http://(?:[^/]*\.)?bintray\.com/}, - %r{^http://tools\.ietf\.org/}, - %r{^http://launchpad\.net/}, - %r{^http://github\.com/}, - %r{^http://bitbucket\.org/}, - %r{^http://anonscm\.debian\.org/}, - %r{^http://cpan\.metacpan\.org/}, - %r{^http://hackage\.haskell\.org/}, - %r{^http://(?:[^/]*\.)?archive\.org}, - %r{^http://(?:[^/]*\.)?freedesktop\.org}, - %r{^http://(?:[^/]*\.)?mirrorservice\.org/} - problem "Please use https:// for #{p}" - when %r{^http://search\.mcpan\.org/CPAN/(.*)}i - problem "#{p} should be `https://cpan.metacpan.org/#{Regexp.last_match(1)}`" - when %r{^(http|ftp)://ftp\.gnome\.org/pub/gnome/(.*)}i - problem "#{p} should be `https://download.gnome.org/#{Regexp.last_match(2)}`" - when %r{^git://anonscm\.debian\.org/users/(.*)}i - problem "#{p} should be `https://anonscm.debian.org/git/users/#{Regexp.last_match(1)}`" - end - end - # Prefer HTTP/S when possible over FTP protocol due to possible firewalls. urls.each do |p| case p |
