Merge pull request #7991 from Homebrew/dependabot/bundler/Library/Homebrew/rubocop-0.88.0
build(deps): bump rubocop from 0.87.1 to 0.88.0 in /Library/Homebrew
This commit is contained in:
commit
ea47dce9ee
@ -81,7 +81,7 @@ GEM
|
|||||||
rspec-support (3.9.3)
|
rspec-support (3.9.3)
|
||||||
rspec-wait (0.0.9)
|
rspec-wait (0.0.9)
|
||||||
rspec (>= 3, < 4)
|
rspec (>= 3, < 4)
|
||||||
rubocop (0.87.1)
|
rubocop (0.88.0)
|
||||||
parallel (~> 1.10)
|
parallel (~> 1.10)
|
||||||
parser (>= 2.7.1.1)
|
parser (>= 2.7.1.1)
|
||||||
rainbow (>= 2.2.2, < 4.0)
|
rainbow (>= 2.2.2, < 4.0)
|
||||||
|
|||||||
@ -208,11 +208,12 @@ rescue Exception => e # rubocop:disable Lint/RescueException
|
|||||||
# BuildErrors are specific to build processes and not other
|
# BuildErrors are specific to build processes and not other
|
||||||
# children, which is why we create the necessary state here
|
# children, which is why we create the necessary state here
|
||||||
# and not in Utils.safe_fork.
|
# and not in Utils.safe_fork.
|
||||||
if error_hash["json_class"] == "BuildError"
|
case error_hash["json_class"]
|
||||||
|
when "BuildError"
|
||||||
error_hash["cmd"] = e.cmd
|
error_hash["cmd"] = e.cmd
|
||||||
error_hash["args"] = e.args
|
error_hash["args"] = e.args
|
||||||
error_hash["env"] = e.env
|
error_hash["env"] = e.env
|
||||||
elsif error_hash["json_class"] == "ErrorDuringExecution"
|
when "ErrorDuringExecution"
|
||||||
error_hash["cmd"] = e.cmd
|
error_hash["cmd"] = e.cmd
|
||||||
error_hash["status"] = e.status.exitstatus
|
error_hash["status"] = e.status.exitstatus
|
||||||
error_hash["output"] = e.output
|
error_hash["output"] = e.output
|
||||||
|
|||||||
@ -77,7 +77,7 @@ module Cask
|
|||||||
Manpage,
|
Manpage,
|
||||||
PostflightBlock,
|
PostflightBlock,
|
||||||
Zap,
|
Zap,
|
||||||
].each_with_index.flat_map { |classes, i| [*classes].map { |c| [c, i] } }.to_h
|
].each_with_index.flat_map { |classes, i| Array(classes).map { |c| [c, i] } }.to_h
|
||||||
|
|
||||||
(@@sort_order[self.class] <=> @@sort_order[other.class]).to_i
|
(@@sort_order[self.class] <=> @@sort_order[other.class]).to_i
|
||||||
end
|
end
|
||||||
|
|||||||
@ -34,7 +34,7 @@ module Cask
|
|||||||
directives.assert_valid_keys!(*ORDERED_DIRECTIVES)
|
directives.assert_valid_keys!(*ORDERED_DIRECTIVES)
|
||||||
|
|
||||||
super(cask)
|
super(cask)
|
||||||
directives[:signal] = [*directives[:signal]].flatten.each_slice(2).to_a
|
directives[:signal] = Array(directives[:signal]).flatten.each_slice(2).to_a
|
||||||
@directives = directives
|
@directives = directives
|
||||||
|
|
||||||
return unless directives.key?(:kext)
|
return unless directives.key?(:kext)
|
||||||
@ -49,7 +49,7 @@ module Cask
|
|||||||
end
|
end
|
||||||
|
|
||||||
def summarize
|
def summarize
|
||||||
to_h.flat_map { |key, val| [*val].map { |v| "#{key.inspect} => #{v.inspect}" } }.join(", ")
|
to_h.flat_map { |key, val| Array(val).map { |v| "#{key.inspect} => #{v.inspect}" } }.join(", ")
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|||||||
@ -18,7 +18,7 @@ module Cask
|
|||||||
def initialize(**pairs)
|
def initialize(**pairs)
|
||||||
pairs.assert_valid_keys!(*VALID_KEYS)
|
pairs.assert_valid_keys!(*VALID_KEYS)
|
||||||
|
|
||||||
super(pairs.transform_values { |v| Set.new([*v]) })
|
super(pairs.transform_values { |v| Set.new(Array(v)) })
|
||||||
|
|
||||||
self.default = Set.new
|
self.default = Set.new
|
||||||
end
|
end
|
||||||
|
|||||||
@ -213,10 +213,11 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
|
|
||||||
def min_named(count_or_type)
|
def min_named(count_or_type)
|
||||||
if count_or_type.is_a?(Integer)
|
case count_or_type
|
||||||
|
when Integer
|
||||||
@min_named_args = count_or_type
|
@min_named_args = count_or_type
|
||||||
@min_named_type = nil
|
@min_named_type = nil
|
||||||
elsif count_or_type.is_a?(Symbol)
|
when Symbol
|
||||||
@min_named_args = 1
|
@min_named_args = 1
|
||||||
@min_named_type = count_or_type
|
@min_named_type = count_or_type
|
||||||
else
|
else
|
||||||
@ -225,10 +226,11 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
|
|
||||||
def named(count_or_type)
|
def named(count_or_type)
|
||||||
if count_or_type.is_a?(Integer)
|
case count_or_type
|
||||||
|
when Integer
|
||||||
@max_named_args = @min_named_args = count_or_type
|
@max_named_args = @min_named_args = count_or_type
|
||||||
@min_named_type = nil
|
@min_named_type = nil
|
||||||
elsif count_or_type.is_a?(Symbol)
|
when Symbol
|
||||||
@max_named_args = @min_named_args = 1
|
@max_named_args = @min_named_args = 1
|
||||||
@min_named_type = count_or_type
|
@min_named_type = count_or_type
|
||||||
else
|
else
|
||||||
|
|||||||
@ -199,10 +199,11 @@ class Reporter
|
|||||||
|
|
||||||
if paths.any? { |p| tap.cask_file?(p) }
|
if paths.any? { |p| tap.cask_file?(p) }
|
||||||
# Currently only need to handle Cask deletion/migration.
|
# Currently only need to handle Cask deletion/migration.
|
||||||
if status == "D"
|
case status
|
||||||
|
when "D"
|
||||||
# Have a dedicated report array for deleted casks.
|
# Have a dedicated report array for deleted casks.
|
||||||
@report[:DC] << tap.formula_file_to_name(src)
|
@report[:DC] << tap.formula_file_to_name(src)
|
||||||
elsif status == "M"
|
when "M"
|
||||||
# Report updated casks
|
# Report updated casks
|
||||||
@report[:MC] << tap.formula_file_to_name(src)
|
@report[:MC] << tap.formula_file_to_name(src)
|
||||||
end
|
end
|
||||||
|
|||||||
@ -274,7 +274,8 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
|
|
||||||
if forced_version && forced_version != "0"
|
if forced_version && forced_version != "0"
|
||||||
if requested_spec == :stable
|
case requested_spec
|
||||||
|
when :stable
|
||||||
replacement_pairs << if File.read(formula.path).include?("version \"#{old_formula_version}\"")
|
replacement_pairs << if File.read(formula.path).include?("version \"#{old_formula_version}\"")
|
||||||
[
|
[
|
||||||
old_formula_version.to_s,
|
old_formula_version.to_s,
|
||||||
@ -291,19 +292,20 @@ module Homebrew
|
|||||||
"\\1\\2\\1version \"#{forced_version}\"\n",
|
"\\1\\2\\1version \"#{forced_version}\"\n",
|
||||||
]
|
]
|
||||||
end
|
end
|
||||||
elsif requested_spec == :devel
|
when :devel
|
||||||
replacement_pairs << [
|
replacement_pairs << [
|
||||||
/( devel do.+?version ")#{old_formula_version}("\n.+?end\n)/m,
|
/( devel do.+?version ")#{old_formula_version}("\n.+?end\n)/m,
|
||||||
"\\1#{forced_version}\\2",
|
"\\1#{forced_version}\\2",
|
||||||
]
|
]
|
||||||
end
|
end
|
||||||
elsif forced_version && forced_version == "0"
|
elsif forced_version && forced_version == "0"
|
||||||
if requested_spec == :stable
|
case requested_spec
|
||||||
|
when :stable
|
||||||
replacement_pairs << [
|
replacement_pairs << [
|
||||||
/^ version "[\w.\-+]+"\n/m,
|
/^ version "[\w.\-+]+"\n/m,
|
||||||
"",
|
"",
|
||||||
]
|
]
|
||||||
elsif requested_spec == :devel
|
when :devel
|
||||||
replacement_pairs << [
|
replacement_pairs << [
|
||||||
/( devel do.+?)^ +version "[^\n]+"\n(.+?end\n)/m,
|
/( devel do.+?)^ +version "[^\n]+"\n(.+?end\n)/m,
|
||||||
"\\1\\2",
|
"\\1\\2",
|
||||||
|
|||||||
@ -124,10 +124,11 @@ module Homebrew
|
|||||||
ronn.close_write
|
ronn.close_write
|
||||||
ronn_output = ronn.read
|
ronn_output = ronn.read
|
||||||
odie "Got no output from ronn!" if ronn_output.blank?
|
odie "Got no output from ronn!" if ronn_output.blank?
|
||||||
if format_flag == "--markdown"
|
case format_flag
|
||||||
|
when "--markdown"
|
||||||
ronn_output = ronn_output.gsub(%r{<var>(.*?)</var>}, "*`\\1`*")
|
ronn_output = ronn_output.gsub(%r{<var>(.*?)</var>}, "*`\\1`*")
|
||||||
.gsub(/\n\n\n+/, "\n\n")
|
.gsub(/\n\n\n+/, "\n\n")
|
||||||
elsif format_flag == "--roff"
|
when "--roff"
|
||||||
ronn_output = ronn_output.gsub(%r{<code>(.*?)</code>}, "\\fB\\1\\fR")
|
ronn_output = ronn_output.gsub(%r{<code>(.*?)</code>}, "\\fB\\1\\fR")
|
||||||
.gsub(%r{<var>(.*?)</var>}, "\\fI\\1\\fR")
|
.gsub(%r{<var>(.*?)</var>}, "\\fI\\1\\fR")
|
||||||
.gsub(/(^\[?\\fB.+): /, "\\1\n ")
|
.gsub(/(^\[?\\fB.+): /, "\\1\n ")
|
||||||
|
|||||||
@ -524,7 +524,7 @@ class ErrorDuringExecution < RuntimeError
|
|||||||
redacted_cmd = redact_secrets(cmd.shelljoin.gsub('\=', "="), secrets)
|
redacted_cmd = redact_secrets(cmd.shelljoin.gsub('\=', "="), secrets)
|
||||||
s = +"Failure while executing; `#{redacted_cmd}` exited with #{exitstatus}."
|
s = +"Failure while executing; `#{redacted_cmd}` exited with #{exitstatus}."
|
||||||
|
|
||||||
unless [*output].empty?
|
if Array(output).present?
|
||||||
format_output_line = lambda do |type_line|
|
format_output_line = lambda do |type_line|
|
||||||
type, line = *type_line
|
type, line = *type_line
|
||||||
if type == :stderr
|
if type == :stderr
|
||||||
@ -543,7 +543,7 @@ class ErrorDuringExecution < RuntimeError
|
|||||||
end
|
end
|
||||||
|
|
||||||
def stderr
|
def stderr
|
||||||
[*output].select { |type,| type == :stderr }.map(&:last).join
|
Array(output).select { |type,| type == :stderr }.map(&:last).join
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -27,7 +27,7 @@ module Language
|
|||||||
f = find_openjdk_formula(version)
|
f = find_openjdk_formula(version)
|
||||||
return f.opt_libexec if f
|
return f.opt_libexec if f
|
||||||
|
|
||||||
req = JavaRequirement.new [*version]
|
req = JavaRequirement.new Array(version)
|
||||||
raise UnsatisfiedRequirements, req.message unless req.satisfied?
|
raise UnsatisfiedRequirements, req.message unless req.satisfied?
|
||||||
|
|
||||||
req.java_home
|
req.java_home
|
||||||
|
|||||||
@ -262,7 +262,7 @@ module Language
|
|||||||
# the contents of a `requirements.txt`.
|
# the contents of a `requirements.txt`.
|
||||||
# @return [void]
|
# @return [void]
|
||||||
def pip_install(targets)
|
def pip_install(targets)
|
||||||
targets = [targets] unless targets.is_a? Array
|
targets = Array(targets)
|
||||||
targets.each do |t|
|
targets.each do |t|
|
||||||
if t.respond_to? :stage
|
if t.respond_to? :stage
|
||||||
next if t.name == "homebrew-virtualenv"
|
next if t.name == "homebrew-virtualenv"
|
||||||
@ -292,7 +292,7 @@ module Language
|
|||||||
private
|
private
|
||||||
|
|
||||||
def do_install(targets)
|
def do_install(targets)
|
||||||
targets = [targets] unless targets.is_a? Array
|
targets = Array(targets)
|
||||||
@formula.system @venv_root/"bin/pip", "install",
|
@formula.system @venv_root/"bin/pip", "install",
|
||||||
"-v", "--no-deps", "--no-binary", ":all:",
|
"-v", "--no-deps", "--no-binary", ":all:",
|
||||||
"--ignore-installed", *targets
|
"--ignore-installed", *targets
|
||||||
|
|||||||
@ -42,7 +42,7 @@ module OS
|
|||||||
end
|
end
|
||||||
|
|
||||||
def languages
|
def languages
|
||||||
@languages ||= [*ENV["LANG"]&.slice(/[a-z]+/)].uniq
|
@languages ||= Array(ENV["LANG"]&.slice(/[a-z]+/)).uniq
|
||||||
end
|
end
|
||||||
|
|
||||||
def language
|
def language
|
||||||
|
|||||||
@ -29,7 +29,7 @@ class MacOSRequirement < Requirement
|
|||||||
end
|
end
|
||||||
|
|
||||||
satisfy(build_env: false) do
|
satisfy(build_env: false) do
|
||||||
next [*@version].any? { |v| MacOS.version.public_send(@comparator, v) } if version_specified?
|
next Array(@version).any? { |v| MacOS.version.public_send(@comparator, v) } if version_specified?
|
||||||
next true if OS.mac?
|
next true if OS.mac?
|
||||||
next true if @version
|
next true if @version
|
||||||
|
|
||||||
|
|||||||
@ -19,7 +19,7 @@ module Searchable
|
|||||||
def search_regex(regex)
|
def search_regex(regex)
|
||||||
select do |*args|
|
select do |*args|
|
||||||
args = yield(*args) if block_given?
|
args = yield(*args) if block_given?
|
||||||
args = [*args].compact
|
args = Array(args).compact
|
||||||
args.any? { |arg| arg.match?(regex) }
|
args.any? { |arg| arg.match?(regex) }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -28,7 +28,7 @@ module Searchable
|
|||||||
simplified_string = simplify_string(string)
|
simplified_string = simplify_string(string)
|
||||||
select do |*args|
|
select do |*args|
|
||||||
args = yield(*args) if block_given?
|
args = yield(*args) if block_given?
|
||||||
args = [*args].compact
|
args = Array(args).compact
|
||||||
args.any? { |arg| simplify_string(arg).include?(simplified_string) }
|
args.any? { |arg| simplify_string(arg).include?(simplified_string) }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -61,7 +61,7 @@ class SystemCommand
|
|||||||
@executable = executable
|
@executable = executable
|
||||||
@args = args
|
@args = args
|
||||||
@sudo = sudo
|
@sudo = sudo
|
||||||
@input = [*input]
|
@input = Array(input)
|
||||||
@print_stdout = print_stdout
|
@print_stdout = print_stdout
|
||||||
@print_stderr = print_stderr
|
@print_stderr = print_stderr
|
||||||
@verbose = verbose
|
@verbose = verbose
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user