Replace discontinued? with deprecated?

This commit is contained in:
Rylan Polster 2023-12-04 13:43:33 -05:00
parent 53c1e6ecdb
commit 7eb3f1a314
No known key found for this signature in database
GPG Key ID: 46A744940CFF4D64
3 changed files with 26 additions and 10 deletions

View File

@ -289,7 +289,7 @@ module Cask
sig { params(livecheck_result: T.any(NilClass, T::Boolean, Symbol)).void } sig { params(livecheck_result: T.any(NilClass, T::Boolean, Symbol)).void }
def audit_hosting_with_livecheck(livecheck_result: audit_livecheck_version) def audit_hosting_with_livecheck(livecheck_result: audit_livecheck_version)
return if cask.discontinued? return if cask.deprecated? || cask.disabled?
return if cask.version&.latest? return if cask.version&.latest?
return unless cask.url return unless cask.url
return if block_url_offline? return if block_url_offline?
@ -544,7 +544,7 @@ module Cask
) )
end end
# Respect cask skip conditions (e.g. discontinued, latest, unversioned) # Respect cask skip conditions (e.g. deprecated, disabled, latest, unversioned)
skip_info ||= Homebrew::Livecheck::SkipConditions.skip_information(cask) skip_info ||= Homebrew::Livecheck::SkipConditions.skip_information(cask)
return :skip if skip_info.present? return :skip if skip_info.present?
@ -682,8 +682,8 @@ module Cask
sig { void } sig { void }
def audit_github_repository_archived def audit_github_repository_archived
# Discontinued casks may have an archived repo. # Deprecated/disabled casks may have an archived repo.
return if cask.discontinued? return if cask.deprecated? || cask.disabled?
user, repo = get_repo_data(%r{https?://github\.com/([^/]+)/([^/]+)/?.*}) if online? user, repo = get_repo_data(%r{https?://github\.com/([^/]+)/([^/]+)/?.*}) if online?
return if user.nil? return if user.nil?
@ -696,8 +696,8 @@ module Cask
sig { void } sig { void }
def audit_gitlab_repository_archived def audit_gitlab_repository_archived
# Discontinued casks may have an archived repo. # Deprecated/disabled casks may have an archived repo.
return if cask.discontinued? return if cask.deprecated? || cask.disabled?
user, repo = get_repo_data(%r{https?://gitlab\.com/([^/]+)/([^/]+)/?.*}) if online? user, repo = get_repo_data(%r{https?://gitlab\.com/([^/]+)/([^/]+)/?.*}) if online?
return if user.nil? return if user.nil?

View File

@ -163,6 +163,7 @@ module Cask
end end
caveat :discontinued do caveat :discontinued do
# odeprecated "`caveats :discontinued`", "`deprecated!`"
@discontinued = true @discontinued = true
<<~EOS <<~EOS
#{@cask} has been officially discontinued upstream. #{@cask} has been officially discontinued upstream.

View File

@ -119,10 +119,24 @@ module Homebrew
verbose: T::Boolean, verbose: T::Boolean,
).returns(Hash) ).returns(Hash)
} }
def cask_discontinued(cask, livecheckable, full_name: false, verbose: false) def cask_deprecated(cask, livecheckable, full_name: false, verbose: false)
return {} if !cask.discontinued? || livecheckable return {} if !cask.deprecated? || livecheckable
Livecheck.status_hash(cask, "discontinued", full_name: full_name, verbose: verbose) Livecheck.status_hash(cask, "deprecated", full_name: full_name, verbose: verbose)
end
sig {
params(
cask: Cask::Cask,
livecheckable: T::Boolean,
full_name: T::Boolean,
verbose: T::Boolean,
).returns(Hash)
}
def cask_disabled(cask, livecheckable, full_name: false, verbose: false)
return {} if !cask.disabled? || livecheckable
Livecheck.status_hash(cask, "disabled", full_name: full_name, verbose: verbose)
end end
sig { sig {
@ -165,7 +179,8 @@ module Homebrew
# Skip conditions for casks. # Skip conditions for casks.
CASK_CHECKS = [ CASK_CHECKS = [
:package_or_resource_skip, :package_or_resource_skip,
:cask_discontinued, :cask_deprecated,
:cask_disabled,
:cask_version_latest, :cask_version_latest,
:cask_url_unversioned, :cask_url_unversioned,
].freeze ].freeze