Merge pull request #12259 from MikeMcQuaid/next_major_or_minor_release

Deprecations/disables for 3.3.0/4.0.0.
This commit is contained in:
Mike McQuaid 2021-10-19 17:11:42 +01:00 committed by GitHub
commit 823f663ab4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 13 additions and 125 deletions

View File

@ -110,9 +110,8 @@ module Homebrew
when :default_kegs
resolve_default_keg(name)
when :keg
odeprecated "`load_formula_or_cask` with `method: :keg`",
odisabled "`load_formula_or_cask` with `method: :keg`",
"`load_formula_or_cask` with `method: :default_kegs`"
resolve_default_keg(name)
when :kegs
_, kegs = resolve_kegs(name)
kegs

View File

@ -58,9 +58,9 @@ module Homebrew
elsif args.no_named?
puts Tap.names
else
odeprecated "`brew tap --full`" if args.full?
odisabled "`brew tap --full`" if args.full?
odeprecated "`brew tap --shallow`" if args.shallow?
odisabled "`brew tap --shallow`" if args.shallow?
tap = Tap.fetch(args.named.first)
begin

View File

@ -126,8 +126,7 @@ module Homebrew
def bump_formula_pr
args = bump_formula_pr_args.parse
# TODO: deprecate in Homebrew 3.3.0
# odeprecated "`brew bump-formula-pr --write`", "`brew bump-formula-pr --write-only`" if args.write?
odeprecated "`brew bump-formula-pr --write`", "`brew bump-formula-pr --write-only`" if args.write?
if args.revision.present? && args.tag.nil? && args.version.nil?
raise UsageError, "`--revision` must be passed with either `--tag` or `--version`!"

View File

@ -1,29 +0,0 @@
# typed: true
# frozen_string_literal: true
module Homebrew
extend T::Sig
module_function
sig { returns(CLI::Parser) }
def man_args
Homebrew::CLI::Parser.new do
description <<~EOS
Generate Homebrew's manpages.
EOS
switch "--fail-if-not-changed",
description: "Return a failing status code if no changes are detected in the manpage outputs. "\
"This can be used to notify CI when the manpages are out of date. Additionally, "\
"the date used in new manpages will match those in the existing manpages (to allow "\
"comparison without factoring in the date)."
named_args :none
hide_from_man_page!
end
end
def man
odisabled "`brew man`", "`brew generate-man-completions`"
end
end

View File

@ -43,7 +43,7 @@ module Homebrew
def pr_automerge
args = pr_automerge_args.parse
odeprecated "`brew pr-automerge --autosquash`", "`brew pr-automerge`" if args.autosquash?
odisabled "`brew pr-automerge --autosquash`", "`brew pr-automerge`" if args.autosquash?
without_labels = args.without_labels || [
"do not merge",

View File

@ -43,7 +43,7 @@ module Homebrew
workflow = args.workflow || "publish-commit-bottles.yml"
ref = args.branch || "master"
odeprecated "`brew pr-publish --autosquash`", "`brew pr-publish`" if args.autosquash?
odisabled "`brew pr-publish --autosquash`", "`brew pr-publish`" if args.autosquash?
extra_args = []
extra_args << "--autosquash" unless args.no_autosquash?

View File

@ -18,45 +18,6 @@ module Homebrew
@assertions ||= 0
end
# Test::Unit backwards compatibility methods
{
assert_include: :assert_includes,
assert_path_exist: :assert_path_exists,
assert_raise: :assert_raises,
assert_throw: :assert_throws,
assert_not_empty: :refute_empty,
assert_not_equal: :refute_equal,
assert_not_in_delta: :refute_in_delta,
assert_not_in_epsilon: :refute_in_epsilon,
assert_not_include: :refute_includes,
assert_not_includes: :refute_includes,
assert_not_instance_of: :refute_instance_of,
assert_not_kind_of: :refute_kind_of,
assert_not_match: :refute_match,
assert_no_match: :refute_match,
assert_not_nil: :refute_nil,
assert_not_operator: :refute_operator,
assert_path_not_exist: :refute_path_exists,
assert_not_predicate: :refute_predicate,
assert_not_respond_to: :refute_respond_to,
assert_not_same: :refute_same,
}.each do |old_method, new_method|
define_method(old_method) do |*args|
odisabled old_method, new_method
send(new_method, *args)
end
end
def assert_true(act, msg = nil)
odisabled "assert_true", "assert(...) or assert_equal(true, ...)"
assert_equal(true, act, msg)
end
def assert_false(act, msg = nil)
odisabled "assert_false", "assert(!...) or assert_equal(false, ...)"
assert_equal(false, act, msg)
end
# Returns the output of running cmd, and asserts the exit status.
# @api public
def shell_output(cmd, result = 0)

View File

@ -69,9 +69,7 @@ class BottleDisableReason
def initialize(type, reason)
@type = type
@reason = reason
# TODO: 3.3.0: deprecate this behaviour as it was only needed for
# Homebrew/core (where we don't want unneeded or disabled bottles any more)
# odeprecated "bottle :#{@type}" if valid?
odeprecated "bottle :#{@type}" if valid?
end
def unneeded?

View File

@ -495,13 +495,6 @@ class BottleSpecification
end
end
def cellar(_val = nil)
odisabled(
"`cellar` in a bottle block",
"`brew style --fix` on the formula to update the style or use `sha256` with a `cellar:` argument",
)
end
sig { params(tag: Utils::Bottles::Tag).returns(T::Boolean) }
def compatible_locations?(tag: Utils::Bottles.tag)
spec = collector.specification_for(tag)
@ -548,22 +541,7 @@ class BottleSpecification
key.is_a?(Symbol) && value.is_a?(String) && value.match?(sha256_regex)
end
if digest && tag
# the cellar hash key only exists on the new format
cellar = hash[:cellar]
else
# otherwise, find old `sha256 "69489ae397e4645..." => :big_sur` format
digest, tag = hash.find do |key, value|
key.is_a?(String) && value.is_a?(Symbol) && key.match?(sha256_regex)
end
if digest && tag
odisabled(
'`sha256 "digest" => :tag` in a bottle block',
'`brew style --fix` on the formula to update the style or use `sha256 tag: "digest"`',
)
end
end
cellar = hash[:cellar] if digest && tag
tag = Utils::Bottles::Tag.from_symbol(tag)

View File

@ -1,18 +0,0 @@
# typed: false
# frozen_string_literal: true
require "formula_support"
describe BottleDisableReason do
specify ":unneeded" do
bottle_disable_reason = described_class.new :unneeded, nil
expect(bottle_disable_reason).to be_unneeded
expect(bottle_disable_reason.to_s).to eq("This formula doesn't require compiling.")
end
specify ":disabled" do
bottle_disable_reason = described_class.new :disable, "reason"
expect(bottle_disable_reason).not_to be_unneeded
expect(bottle_disable_reason.to_s).to eq("reason")
end
end

View File

@ -992,7 +992,7 @@ __fish_brew_complete_arg 'ls; and not __fish_seen_argument -l cask -l casks' -a
__fish_brew_complete_arg 'ls; and not __fish_seen_argument -l formula -l formulae' -a '(__fish_brew_suggest_casks_installed)'
__fish_brew_complete_cmd 'man' 'Generate Homebrew\'s manpages'
__fish_brew_complete_cmd 'man' 'Generate Homebrew\'s manpages and shell completions'
__fish_brew_complete_arg 'man' -l debug -d 'Display any debugging information'
__fish_brew_complete_arg 'man' -l fail-if-not-changed -d 'Return a failing status code if no changes are detected in the manpage outputs. This can be used to notify CI when the manpages are out of date. Additionally, the date used in new manpages will match those in the existing manpages (to allow comparison without factoring in the date)'
__fish_brew_complete_arg 'man' -l help -d 'Show this message'

View File

@ -30,6 +30,7 @@ __brew_list_aliases() {
'-v' '--version'
lc livecheck
tc typecheck
man generate-man-completions
)
echo "${aliases}"
}
@ -176,7 +177,6 @@ __brew_internal_commands() {
'list:List all installed formulae and casks'
'livecheck:Check for newer versions of formulae and/or casks from upstream'
'log:Show the `git log` for formula or cask, or show the log for the Homebrew repository if no formula or cask is provided'
'man:Generate Homebrew'\''s manpages'
'migrate:Migrate renamed packages to new names, where formula are old names of packages'
'missing:Check the given formula kegs for missing dependencies'
'options:Show install options specific to formula'

View File

@ -1133,7 +1133,7 @@ a formula from a tap that is not `homebrew/core` use its fully-qualified form of
Display the path where *`formula`* is located.
### `generate-man-completions` [*`--fail-if-not-changed`*]
### `generate-man-completions`, `man` [*`--fail-if-not-changed`*]
Generate Homebrew's manpages and shell completions.

View File

@ -1607,7 +1607,7 @@ Overwrite the destination formula if it already exists\.
.SS "\fBformula\fR \fIformula\fR [\.\.\.]"
Display the path where \fIformula\fR is located\.
.
.SS "\fBgenerate\-man\-completions\fR [\fI\-\-fail\-if\-not\-changed\fR]"
.SS "\fBgenerate\-man\-completions\fR, \fBman\fR [\fI\-\-fail\-if\-not\-changed\fR]"
Generate Homebrew\'s manpages and shell completions\.
.
.TP