Merge pull request #16476 from SMillerDev/feat/audit/wayback_deprecation
feat: add audit for wayback machine URLs
This commit is contained in:
commit
dfab16a5b7
@ -602,6 +602,27 @@ module Homebrew
|
|||||||
problem "Product is EOL since #{metadata["eol"]}, #{see_url}" if Date.parse(metadata["eol"]) <= Date.today
|
problem "Product is EOL since #{metadata["eol"]}, #{see_url}" if Date.parse(metadata["eol"]) <= Date.today
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def audit_wayback_url
|
||||||
|
return unless @strict
|
||||||
|
return unless @core_tap
|
||||||
|
return if formula.deprecated? || formula.disabled?
|
||||||
|
|
||||||
|
regex = %r{^https?://web\.archive\.org}
|
||||||
|
problem_prefix = "Formula with a Internet Archive Wayback Machine"
|
||||||
|
|
||||||
|
problem "#{problem_prefix} `url` should be deprecated with `:repo_removed`" if regex.match?(formula.stable.url)
|
||||||
|
|
||||||
|
if regex.match?(formula.homepage)
|
||||||
|
problem "#{problem_prefix} `homepage` should find an alternative `homepage` or be deprecated."
|
||||||
|
end
|
||||||
|
|
||||||
|
return unless formula.head
|
||||||
|
|
||||||
|
return unless regex.match?(formula.head.url)
|
||||||
|
|
||||||
|
problem "Remove Internet Archive Wayback Machine `head` URL"
|
||||||
|
end
|
||||||
|
|
||||||
def audit_github_repository_archived
|
def audit_github_repository_archived
|
||||||
return if formula.deprecated? || formula.disabled?
|
return if formula.deprecated? || formula.disabled?
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user