audit: handle some GitHub repo audit edge cases.

This commit is contained in:
Mike McQuaid 2015-07-08 15:19:36 +01:00
parent 51a1792e7a
commit c0c68b2b3f

View File

@ -430,7 +430,14 @@ class FormulaAuditor
_, user, repo = *regex.match(formula.homepage) unless user _, user, repo = *regex.match(formula.homepage) unless user
return if !user || !repo return if !user || !repo
repo.gsub!(/.git$/, "")
begin
metadata = GitHub.repository(user, repo) metadata = GitHub.repository(user, repo)
rescue GitHub::HTTPNotFoundError => e
return
end
problem "GitHub fork (not canonical repository)" if metadata["fork"] problem "GitHub fork (not canonical repository)" if metadata["fork"]
if (metadata["forks_count"] < 5) || (metadata["watchers_count"] < 5) || if (metadata["forks_count"] < 5) || (metadata["watchers_count"] < 5) ||
(metadata["stargazers_count"] < 10) (metadata["stargazers_count"] < 10)