Apply suggestions from code review
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
		
							parent
							
								
									a0b0c77ee8
								
							
						
					
					
						commit
						b2cccfcf68
					
				@ -353,7 +353,7 @@ module Homebrew
 | 
				
			|||||||
        if @spdx_ids.key?(formula.license)
 | 
					        if @spdx_ids.key?(formula.license)
 | 
				
			||||||
          return unless @online
 | 
					          return unless @online
 | 
				
			||||||
 | 
					
 | 
				
			||||||
          user, repo = get_repo_data(%r{https?://github\.com/([^/]+)/([^/]+)/?.*}, false)
 | 
					          user, repo = get_repo_data(%r{https?://github\.com/([^/]+)/([^/]+)/?.*})
 | 
				
			||||||
          return if user.nil?
 | 
					          return if user.nil?
 | 
				
			||||||
 | 
					
 | 
				
			||||||
          github_license = GitHub.get_repo_license(user, repo)
 | 
					          github_license = GitHub.get_repo_license(user, repo)
 | 
				
			||||||
@ -369,19 +369,6 @@ module Homebrew
 | 
				
			|||||||
      end
 | 
					      end
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # def get_github_repo_license_data(user, repo)
 | 
					 | 
				
			||||||
    #   return unless @online
 | 
					 | 
				
			||||||
    #
 | 
					 | 
				
			||||||
    #   begin
 | 
					 | 
				
			||||||
    #     res = GitHub.open_api("#{GitHub::API_URL}/repos/#{user}/#{repo}/license")
 | 
					 | 
				
			||||||
    #     return unless res.key?("license")
 | 
					 | 
				
			||||||
    #
 | 
					 | 
				
			||||||
    #     res["license"]["spdx_id"] || nil
 | 
					 | 
				
			||||||
    #   rescue GitHub::HTTPNotFoundError
 | 
					 | 
				
			||||||
    #     nil
 | 
					 | 
				
			||||||
    #   end
 | 
					 | 
				
			||||||
    # end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    def audit_deps
 | 
					    def audit_deps
 | 
				
			||||||
      @specs.each do |spec|
 | 
					      @specs.each do |spec|
 | 
				
			||||||
        # Check for things we don't like to depend on.
 | 
					        # Check for things we don't like to depend on.
 | 
				
			||||||
@ -590,8 +577,6 @@ module Homebrew
 | 
				
			|||||||
      return unless @core_tap
 | 
					      return unless @core_tap
 | 
				
			||||||
      return unless @online
 | 
					      return unless @online
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      return unless @new_formula || !new_formula_only
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
      _, user, repo = *regex.match(formula.stable.url) if formula.stable
 | 
					      _, user, repo = *regex.match(formula.stable.url) if formula.stable
 | 
				
			||||||
      _, user, repo = *regex.match(formula.homepage) unless user
 | 
					      _, user, repo = *regex.match(formula.homepage) unless user
 | 
				
			||||||
      return if !user || !repo
 | 
					      return if !user || !repo
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user