diff options
| author | Mike McQuaid | 2017-06-20 14:27:51 +0100 |
|---|---|---|
| committer | GitHub | 2017-06-20 14:27:51 +0100 |
| commit | 80ce43dff1a196d021f64277a2d3b6aa3e2898f7 (patch) | |
| tree | f54eb5d756f8737351cbf0bc655a62a010f15562 /Library/Homebrew/dev-cmd | |
| parent | a1e5077adf60b6594b1c372ddfb275fb55b33c65 (diff) | |
| parent | 0e1c88e7aefb93a8e2cc927fa9a4e903ac015c57 (diff) | |
| download | brew-80ce43dff1a196d021f64277a2d3b6aa3e2898f7.tar.bz2 | |
Merge pull request #2776 from GauthamGoli/audit_checksum_rubocop_fix
audit: Fix audit_checksum method's rubocop and add more tests
Diffstat (limited to 'Library/Homebrew/dev-cmd')
| -rw-r--r-- | Library/Homebrew/dev-cmd/audit.rb | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb index 0d9a630fd..a6c71f795 100644 --- a/Library/Homebrew/dev-cmd/audit.rb +++ b/Library/Homebrew/dev-cmd/audit.rb @@ -1246,7 +1246,6 @@ class ResourceAuditor def audit audit_version - audit_checksum audit_download_strategy audit_urls self @@ -1273,28 +1272,6 @@ class ResourceAuditor problem "version #{version} should not end with an underline and a number" end - def audit_checksum - return unless checksum - - case checksum.hash_type - when :md5 - problem "MD5 checksums are deprecated, please use SHA256" - return - when :sha1 - problem "SHA1 checksums are deprecated, please use SHA256" - return - when :sha256 then len = 64 - end - - if checksum.empty? - problem "#{checksum.hash_type} is empty" - else - problem "#{checksum.hash_type} should be #{len} characters" unless checksum.hexdigest.length == len - problem "#{checksum.hash_type} contains invalid characters" unless checksum.hexdigest =~ /^[a-fA-F0-9]+$/ - problem "#{checksum.hash_type} should be lowercase" unless checksum.hexdigest == checksum.hexdigest.downcase - end - end - def audit_download_strategy if url =~ %r{^(cvs|bzr|hg|fossil)://} || url =~ %r{^(svn)\+http://} problem "Use of the #{$&} scheme is deprecated, pass `:using => :#{Regexp.last_match(1)}` instead" |
