audit: clean up URL audits
This commit is contained in:
parent
d4a8813e86
commit
7f55a6089e
@ -94,6 +94,7 @@ class FormulaAuditor
|
|||||||
@f = f
|
@f = f
|
||||||
@problems = []
|
@problems = []
|
||||||
@text = f.text.without_patch
|
@text = f.text.without_patch
|
||||||
|
@specs = %w{stable devel head}.map { |s| f.send(s) }.compact
|
||||||
|
|
||||||
# We need to do this in case the formula defines a patch that uses DATA.
|
# We need to do this in case the formula defines a patch that uses DATA.
|
||||||
f.class.redefine_const :DATA, ""
|
f.class.redefine_const :DATA, ""
|
||||||
@ -196,7 +197,7 @@ class FormulaAuditor
|
|||||||
problem "GitHub pages should use the github.io domain (url is #{f.homepage})"
|
problem "GitHub pages should use the github.io domain (url is #{f.homepage})"
|
||||||
end
|
end
|
||||||
|
|
||||||
urls = [(f.stable.url rescue nil), (f.devel.url rescue nil), (f.head.url rescue nil)].compact
|
urls = @specs.map(&:url)
|
||||||
|
|
||||||
# Check GNU urls; doesn't apply to mirrors
|
# Check GNU urls; doesn't apply to mirrors
|
||||||
urls.grep(%r[^(?:https?|ftp)://(?!alpha).+/gnu/]).each do |u|
|
urls.grep(%r[^(?:https?|ftp)://(?!alpha).+/gnu/]).each do |u|
|
||||||
@ -204,7 +205,7 @@ class FormulaAuditor
|
|||||||
end
|
end
|
||||||
|
|
||||||
# the rest of the checks apply to mirrors as well
|
# the rest of the checks apply to mirrors as well
|
||||||
urls.concat([(f.stable.mirrors rescue nil), (f.devel.mirrors rescue nil)].flatten.compact)
|
urls.concat(@specs.map(&:mirrors).flatten)
|
||||||
|
|
||||||
# Check SourceForge urls
|
# Check SourceForge urls
|
||||||
urls.each do |p|
|
urls.each do |p|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user