brew.rb: handle missing args.

This commit is contained in:
Mike McQuaid 2024-03-07 16:20:20 +00:00
parent 3840d7145c
commit ea2892f8ee
No known key found for this signature in database
237 changed files with 1133 additions and 1142 deletions

View File

@ -95,7 +95,7 @@ module Homebrew
end
mtime = insecure_download ? Time.new(1970, 1, 1) : Time.now
FileUtils.touch(target, mtime: mtime) unless skip_download
FileUtils.touch(target, mtime:) unless skip_download
JSON.parse(target.read, freeze: true)
rescue JSON::ParserError
target.unlink

View File

@ -83,7 +83,7 @@ module Homebrew
def self.write_names(regenerate: false)
download_and_cache_data! unless cache.key?("casks")
Homebrew::API.write_names_file(all_casks.keys, "cask", regenerate: regenerate)
Homebrew::API.write_names_file(all_casks.keys, "cask", regenerate:)
end
end
end

View File

@ -119,7 +119,7 @@ module Homebrew
def self.write_names_and_aliases(regenerate: false)
download_and_cache_data! unless cache.key?("formulae")
return unless Homebrew::API.write_names_file(all_formulae.keys, "formula", regenerate: regenerate)
return unless Homebrew::API.write_names_file(all_formulae.keys, "formula", regenerate:)
(HOMEBREW_CACHE_API/"formula_aliases.txt").open("w") do |file|
all_aliases.each do |alias_name, real_name|

View File

@ -78,7 +78,7 @@ begin
# - no arguments are passed
if empty_argv || help_flag
require "help"
Homebrew::Help.help cmd, remaining_args: args.remaining, empty_argv: empty_argv
Homebrew::Help.help cmd, remaining_args: args.remaining, empty_argv:
# `Homebrew::Help.help` never returns, except for unknown commands.
end
@ -133,14 +133,14 @@ rescue UsageError => e
Homebrew::Help.help cmd, remaining_args: args.remaining, usage_error: e.message
rescue SystemExit => e
onoe "Kernel.exit" if args.debug? && !e.success?
$stderr.puts Utils::Backtrace.clean(e) if args.debug?
$stderr.puts Utils::Backtrace.clean(e) if args&.debug? || ARGV.include?("--debug")
raise
rescue Interrupt
$stderr.puts # seemingly a newline is typical
exit 130
rescue BuildError => e
Utils::Analytics.report_build_error(e)
e.dump(verbose: args.verbose?)
e.dump(verbose: args&.verbose?)
if e.formula.head? || e.formula.deprecated? || e.formula.disabled?
reason = if e.formula.head?
@ -167,7 +167,7 @@ rescue RuntimeError, SystemCallError => e
raise if e.message.empty?
onoe e
$stderr.puts Utils::Backtrace.clean(e) if args.debug?
$stderr.puts Utils::Backtrace.clean(e) if args&.debug? || ARGV.include?("--debug")
exit 1
rescue MethodDeprecatedError => e
@ -176,7 +176,7 @@ rescue MethodDeprecatedError => e
$stderr.puts "If reporting this issue please do so at (not Homebrew/brew or Homebrew/homebrew-core):"
$stderr.puts " #{Formatter.url(e.issues_url)}"
end
$stderr.puts Utils::Backtrace.clean(e) if args.debug?
$stderr.puts Utils::Backtrace.clean(e) if args&.debug? || ARGV.include?("--debug")
exit 1
rescue Exception => e # rubocop:disable Lint/RescueException
onoe e

View File

@ -80,7 +80,7 @@ class Build
ENV.deps = formula_deps
ENV.run_time_deps = run_time_deps
ENV.setup_build_environment(
formula: formula,
formula:,
cc: args.cc,
build_bottle: args.build_bottle?,
bottle_arch: args.bottle_arch,
@ -93,7 +93,7 @@ class Build
end
else
ENV.setup_build_environment(
formula: formula,
formula:,
cc: args.cc,
build_bottle: args.build_bottle?,
bottle_arch: args.bottle_arch,
@ -225,7 +225,7 @@ begin
formula = args.named.to_formulae.first
options = Options.create(args.flags_only)
build = Build.new(formula, options, args: args)
build = Build.new(formula, options, args:)
build.install
rescue Exception => e # rubocop:disable Lint/RescueException
error_hash = JSON.parse e.to_json

View File

@ -113,7 +113,7 @@ module Cask
plist_status = command.run(
"/bin/launchctl",
args: ["list", service],
sudo: sudo,
sudo:,
sudo_as_root: sudo,
print_stderr: false,
).stdout
@ -121,7 +121,7 @@ module Cask
command.run!(
"/bin/launchctl",
args: ["remove", service],
sudo: sudo,
sudo:,
sudo_as_root: sudo,
)
sleep 1
@ -133,7 +133,7 @@ module Cask
paths.each { |elt| elt.prepend(Dir.home).freeze } unless sudo
paths = paths.map { |elt| Pathname(elt) }.select(&:exist?)
paths.each do |path|
command.run!("/bin/rm", args: ["-f", "--", path], sudo: sudo, sudo_as_root: sudo)
command.run!("/bin/rm", args: ["-f", "--", path], sudo:, sudo_as_root: sudo)
end
# undocumented and untested: pass a path to uninstall :launchctl
next unless Pathname(service).exist?
@ -141,13 +141,13 @@ module Cask
command.run!(
"/bin/launchctl",
args: ["unload", "-w", "--", service],
sudo: sudo,
sudo:,
sudo_as_root: sudo,
)
command.run!(
"/bin/rm",
args: ["-f", "--", service],
sudo: sudo,
sudo:,
sudo_as_root: sudo,
)
sleep 1
@ -511,13 +511,13 @@ module Cask
# Directory counts as empty if it only contains a `.DS_Store`.
if children.include?(ds_store = resolved_path/".DS_Store")
Utils.gain_permissions_remove(ds_store, command: command)
Utils.gain_permissions_remove(ds_store, command:)
children.delete(ds_store)
end
next false unless recursive_rmdir(*children, command: command)
next false unless recursive_rmdir(*children, command:)
Utils.gain_permissions_rmdir(resolved_path, command: command)
Utils.gain_permissions_rmdir(resolved_path, command:)
true
end

View File

@ -31,11 +31,6 @@ module Cask
def resolve_target(target)
super(target, base_dir: nil)
end
sig { params(cask: Cask, source: T.any(String, Pathname), target: T.any(String, Pathname)).void }
def initialize(cask, source, target:)
super(cask, source, target: target)
end
end
end
end

View File

@ -10,7 +10,7 @@ module Cask
# @api private
class Binary < Symlinked
def link(command: nil, **options)
super(command: command, **options)
super(command:, **options)
return if source.executable?
if source.writable?

View File

@ -94,7 +94,7 @@ module Cask
end
def to_h
{ path: path }.tap do |h|
{ path: }.tap do |h|
h[:args] = args unless is_a?(ManualInstaller)
end
end

View File

@ -46,7 +46,7 @@ module Cask
if target.parent.writable? && !force
target.rmdir
else
Utils.gain_permissions_remove(target, command: command)
Utils.gain_permissions_remove(target, command:)
end
end
else
@ -55,7 +55,7 @@ module Cask
same = command.run(
"/usr/bin/diff",
args: ["--recursive", "--brief", source, target],
verbose: verbose,
verbose:,
print_stdout: verbose,
).success?
@ -76,22 +76,22 @@ module Cask
raise CaskError, "#{message}." unless force
opoo "#{message}; overwriting."
delete(target, force: force, command: command, **options)
delete(target, force:, command:, **options)
end
end
ohai "Moving #{self.class.english_name} '#{source.basename}' to '#{target}'"
Utils.gain_permissions_mkpath(target.dirname, command: command) unless target.dirname.exist?
Utils.gain_permissions_mkpath(target.dirname, command:) unless target.dirname.exist?
if target.directory? && Quarantine.app_management_permissions_granted?(app: target, command: command)
if target.directory? && Quarantine.app_management_permissions_granted?(app: target, command:)
if target.writable?
source.children.each { |child| FileUtils.move(child, target/child.basename) }
else
command.run!("/bin/cp", args: ["-pR", *source.children, target],
sudo: true)
end
Quarantine.copy_xattrs(source, target, command: command)
Quarantine.copy_xattrs(source, target, command:)
source.rmtree
elsif target.dirname.writable?
FileUtils.move(source, target)
@ -109,7 +109,7 @@ module Cask
def post_move(command)
FileUtils.ln_sf target, source
add_altname_metadata(target, source.basename, command: command)
add_altname_metadata(target, source.basename, command:)
end
def matching_artifact?(cask)
@ -129,7 +129,7 @@ module Cask
raise CaskError, "#{message}." unless force
opoo "#{message}; overwriting."
delete(source, force: force, command: command, **options)
delete(source, force:, command:, **options)
end
unless target.exist?
@ -144,7 +144,7 @@ module Cask
# We need to preserve extended attributes between copies.
command.run!("/bin/cp", args: ["-pR", target, source], sudo: !source.parent.writable?)
delete(target, force: force, command: command, **options)
delete(target, force:, command:, **options)
end
def delete(target, force: false, successor: nil, command: nil, **_)
@ -154,7 +154,7 @@ module Cask
return unless Utils.path_occupied?(target)
if target.directory? && matching_artifact?(successor) && Quarantine.app_management_permissions_granted?(
app: target, command: command,
app: target, command:,
)
# If an app folder is deleted, macOS considers the app uninstalled and removes some data.
# Remove only the contents to handle this case.
@ -162,13 +162,13 @@ module Cask
if target.writable? && !force
child.rmtree
else
Utils.gain_permissions_remove(child, command: command)
Utils.gain_permissions_remove(child, command:)
end
end
elsif target.parent.writable? && !force
target.rmtree
else
Utils.gain_permissions_remove(target, command: command)
Utils.gain_permissions_remove(target, command:)
end
end
end

View File

@ -66,9 +66,9 @@ module Cask
"/usr/sbin/installer",
sudo: true,
sudo_as_root: true,
args: args,
args:,
print_stdout: true,
env: env,
env:,
)
end
end

View File

@ -57,30 +57,30 @@ module Cask
if force && target.symlink? &&
(target.realpath == source.realpath || target.realpath.to_s.start_with?("#{cask.caskroom_path}/"))
opoo "#{message}; overwriting."
Utils.gain_permissions_remove(target, command: command)
Utils.gain_permissions_remove(target, command:)
else
raise CaskError, "#{message}."
end
end
ohai "Linking #{self.class.english_name} '#{source.basename}' to '#{target}'"
create_filesystem_link(command: command)
create_filesystem_link(command:)
end
def unlink(command: nil, **)
return unless target.symlink?
ohai "Unlinking #{self.class.english_name} '#{target}'"
Utils.gain_permissions_remove(target, command: command)
Utils.gain_permissions_remove(target, command:)
end
def create_filesystem_link(command: nil)
Utils.gain_permissions_mkpath(target.dirname, command: command)
Utils.gain_permissions_mkpath(target.dirname, command:)
command.run! "/bin/ln", args: ["-h", "-f", "-s", "--", source, target],
sudo: !target.dirname.writable?
add_altname_metadata(source, target.basename, command: command)
add_altname_metadata(source, target.basename, command:)
end
end
end

View File

@ -41,7 +41,7 @@ module Cask
download = online || signing if download.nil?
@cask = cask
@download = Download.new(cask, quarantine: quarantine) if download
@download = Download.new(cask, quarantine:) if download
@online = online
@strict = strict
@signing = signing
@ -95,7 +95,7 @@ module Cask
# Only raise non-critical audits if the user specified `--strict`.
return if strict_only && !@strict
errors << ({ message: message, location: location, corrected: false })
errors << ({ message:, location:, corrected: false })
end
def result
@ -663,7 +663,7 @@ module Cask
tag = SharedAudits.github_tag_from_url(cask.url)
tag ||= cask.version
error = SharedAudits.github_release(user, repo, tag, cask: cask)
error = SharedAudits.github_release(user, repo, tag, cask:)
add_error error, location: cask.url.location if error
end
@ -678,7 +678,7 @@ module Cask
tag = SharedAudits.gitlab_tag_from_url(cask.url)
tag ||= cask.version
error = SharedAudits.gitlab_release(user, repo, tag, cask: cask)
error = SharedAudits.gitlab_release(user, repo, tag, cask:)
add_error error, location: cask.url.location if error
end
@ -783,7 +783,7 @@ module Cask
validate_url_for_https_availability(
homepage, SharedAudits::URL_TYPE_HOMEPAGE,
user_agents: user_agents,
user_agents:,
check_content: true,
strict: strict?
)
@ -843,7 +843,7 @@ module Cask
add_error problem, location: location unless exception
elsif exception
add_error "#{url_to_check} is in the secure connection audit skiplist but does not need to be skipped",
location: location
location:
end
end

View File

@ -86,7 +86,7 @@ module Cask
def audit_languages(languages)
original_config = cask.config
localized_config = original_config.merge(Config.new(explicit: { languages: languages }))
localized_config = original_config.merge(Config.new(explicit: { languages: }))
cask.config = localized_config
audit_cask_instance(cask)

View File

@ -116,7 +116,7 @@ module Cask
def timestamped_versions(caskroom_path: self.caskroom_path)
relative_paths = Pathname.glob(metadata_timestamped_path(
version: "*", timestamp: "*",
caskroom_path: caskroom_path
caskroom_path:
))
.map { |p| p.relative_path_from(p.parent.parent) }
# Sorbet is unaware that Pathname is sortable: https://github.com/sorbet/sorbet/issues/6844
@ -227,8 +227,8 @@ module Cask
end
def outdated?(greedy: false, greedy_latest: false, greedy_auto_updates: false)
!outdated_version(greedy: greedy, greedy_latest: greedy_latest,
greedy_auto_updates: greedy_auto_updates).nil?
!outdated_version(greedy:, greedy_latest:,
greedy_auto_updates:).nil?
end
def outdated_version(greedy: false, greedy_latest: false, greedy_auto_updates: false)
@ -252,8 +252,8 @@ module Cask
def outdated_info(greedy, verbose, json, greedy_latest, greedy_auto_updates)
return token if !verbose && !json
installed_version = outdated_version(greedy: greedy, greedy_latest: greedy_latest,
greedy_auto_updates: greedy_auto_updates).to_s
installed_version = outdated_version(greedy:, greedy_latest:,
greedy_auto_updates:).to_s
if json
{
@ -375,10 +375,10 @@ module Cask
if @dsl.on_system_blocks_exist?
begin
MacOSVersion::SYMBOLS.keys.product(OnSystem::ARCH_OPTIONS).each do |os, arch|
bottle_tag = ::Utils::Bottles::Tag.new(system: os, arch: arch)
bottle_tag = ::Utils::Bottles::Tag.new(system: os, arch:)
next unless bottle_tag.valid_combination?
Homebrew::SimulateSystem.with os: os, arch: arch do
Homebrew::SimulateSystem.with(os:, arch:) do
refresh
to_h.each do |key, value|

View File

@ -44,7 +44,7 @@ module Cask
).returns(Cask)
}
def cask(header_token, **options, &block)
Cask.new(header_token, source: content, tap: tap, **options, config: @config, &block)
Cask.new(header_token, source: content, tap:, **options, config: @config, &block)
end
end
@ -127,9 +127,7 @@ module Cask
@content = path.read(encoding: "UTF-8")
@config = config
if path.extname == ".json"
return FromAPILoader.new(token, from_json: JSON.parse(@content)).load(config: config)
end
return FromAPILoader.new(token, from_json: JSON.parse(@content)).load(config:) if path.extname == ".json"
begin
instance_eval(content, path).tap do |cask|
@ -207,7 +205,7 @@ module Cask
def self.try_new(ref, warn: false)
ref = ref.to_s
return unless (token_tap_type = CaskLoader.tap_cask_token_type(ref, warn: warn))
return unless (token_tap_type = CaskLoader.tap_cask_token_type(ref, warn:))
token, tap, = token_tap_type
new("#{tap}/#{token}")
@ -278,7 +276,7 @@ module Cask
ref = "#{CoreCaskTap.instance}/#{token}"
token, tap, = CaskLoader.tap_cask_token_type(ref, warn: warn)
token, tap, = CaskLoader.tap_cask_token_type(ref, warn:)
new("#{tap}/#{token}")
end
@ -295,7 +293,7 @@ module Cask
cask_options = {
loaded_from_api: true,
source: JSON.pretty_generate(json_cask),
config: config,
config:,
loader: self,
}
@ -449,7 +447,7 @@ module Cask
return unless (token = ref[HOMEBREW_DEFAULT_TAP_CASK_REGEX, :token])
return unless (tap = CoreCaskTap.instance).installed?
return unless (loader = super("#{tap}/#{token}", warn: warn))
return unless (loader = super("#{tap}/#{token}", warn:))
loader if loader.path.exist?
end
@ -470,12 +468,12 @@ module Cask
# If it exists in the default tap, never treat it as ambiguous with another tap.
if (core_cask_tap = CoreCaskTap.instance).installed? &&
(loader= super("#{core_cask_tap}/#{token}", warn: warn))&.path&.exist?
(loader= super("#{core_cask_tap}/#{token}", warn:))&.path&.exist?
return loader
end
loaders = Tap.select { |tap| tap.installed? && !tap.core_cask_tap? }
.filter_map { |tap| super("#{tap}/#{token}", warn: warn) }
.filter_map { |tap| super("#{tap}/#{token}", warn:) }
.select { |tap| tap.path.exist? }
case loaders.count
@ -532,7 +530,7 @@ module Cask
end
def self.load(ref, config: nil, warn: true)
self.for(ref, warn: warn).load(config: config)
self.for(ref, warn:).load(config:)
end
sig { params(tapped_token: String, warn: T::Boolean).returns(T.nilable([String, Tap, T.nilable(Symbol)])) }
@ -582,7 +580,7 @@ module Cask
FromInstalledPathLoader,
NullLoader,
].each do |loader_class|
if (loader = loader_class.try_new(ref, warn: warn))
if (loader = loader_class.try_new(ref, warn:))
$stderr.puts "#{$PROGRAM_NAME} (#{loader.class}): loading #{ref}" if debug?
return loader
end

View File

@ -44,18 +44,18 @@ module Cask
"We'll set permissions properly so we won't need sudo in the future."
end
SystemCommand.run("/bin/mkdir", args: ["-p", path], sudo: sudo)
SystemCommand.run("/bin/chmod", args: ["g+rwx", path], sudo: sudo)
SystemCommand.run("/usr/sbin/chown", args: [User.current, path], sudo: sudo)
SystemCommand.run("/usr/bin/chgrp", args: ["admin", path], sudo: sudo)
SystemCommand.run("/bin/mkdir", args: ["-p", path], sudo:)
SystemCommand.run("/bin/chmod", args: ["g+rwx", path], sudo:)
SystemCommand.run("/usr/sbin/chown", args: [User.current, path], sudo:)
SystemCommand.run("/usr/bin/chgrp", args: ["admin", path], sudo:)
end
sig { params(config: T.nilable(Config)).returns(T::Array[Cask]) }
def self.casks(config: nil)
tokens.sort.filter_map do |token|
CaskLoader.load(token, config: config, warn: false)
CaskLoader.load(token, config:, warn: false)
rescue TapCaskAmbiguityError => e
T.must(e.loaders.first).load(config: config)
T.must(e.loaders.first).load(config:)
rescue
# Don't blow up because of a single unavailable cask.
nil

View File

@ -66,7 +66,7 @@ module Cask
default: config.fetch("default", {}),
env: config.fetch("env", {}),
explicit: config.fetch("explicit", {}),
ignore_invalid_keys: ignore_invalid_keys,
ignore_invalid_keys:,
)
end
@ -199,9 +199,9 @@ module Cask
sig { params(options: T.untyped).returns(String) }
def to_json(*options)
{
default: default,
env: env,
explicit: explicit,
default:,
env:,
explicit:,
}.to_json(*options)
end
end

View File

@ -52,7 +52,7 @@ module Cask
downloader.quiet! if quiet
begin
super(verify_download_integrity: false, timeout: timeout)
super(verify_download_integrity: false, timeout:)
rescue DownloadError => e
error = CaskError.new("Download failed on Cask '#{cask}' with message: #{e.cause}")
error.set_backtrace e.backtrace
@ -68,7 +68,7 @@ module Cask
def time_file_size(timeout: nil)
raise ArgumentError, "not supported for this download strategy" unless downloader.is_a?(CurlDownloadStrategy)
T.cast(downloader, CurlDownloadStrategy).resolved_time_file_size(timeout: timeout)
T.cast(downloader, CurlDownloadStrategy).resolved_time_file_size(timeout:)
end
def basename

View File

@ -209,9 +209,9 @@ module Cask
set_unique_stanza(:url, args.empty? && options.empty? && !block) do
if block
URL.new(*args, **options, caller_location: caller_location, dsl: self, &block)
URL.new(*args, **options, caller_location:, dsl: self, &block)
else
URL.new(*args, **options, caller_location: caller_location)
URL.new(*args, **options, caller_location:)
end
end
end
@ -249,7 +249,7 @@ module Cask
set_unique_stanza(:sha256, should_return) do
@on_system_blocks_exist = true if arm.present? || intel.present?
val = arg || on_arch_conditional(arm: arm, intel: intel)
val = arg || on_arch_conditional(arm:, intel:)
case val
when :no_check
val
@ -268,7 +268,7 @@ module Cask
set_unique_stanza(:arch, should_return) do
@on_system_blocks_exist = true
on_arch_conditional(arm: arm, intel: intel)
on_arch_conditional(arm:, intel:)
end
end

View File

@ -68,7 +68,7 @@ module Cask
verify_has_sha if require_sha? && !force?
check_requirements
download(quiet: quiet, timeout: timeout)
download(quiet:, timeout:)
satisfy_cask_and_formula_dependencies
end
@ -109,7 +109,7 @@ module Cask
@cask.config = @cask.default_config.merge(old_config)
install_artifacts(predecessor: predecessor)
install_artifacts(predecessor:)
if (tap = @cask.tap) && tap.should_report_analytics?
::Utils::Analytics.report_package_event(:cask_install, package_name: @cask.token, tap_name: tap.name,
@ -178,8 +178,8 @@ on_request: true)
sig { params(quiet: T.nilable(T::Boolean), timeout: T.nilable(T.any(Integer, Float))).returns(Pathname) }
def download(quiet: nil, timeout: nil)
# Store cask download path in cask to prevent multiple downloads in a row when checking if it's outdated
@cask.download ||= downloader.fetch(quiet: quiet, verify_download_integrity: @verify_download_integrity,
timeout: timeout)
@cask.download ||= downloader.fetch(quiet:, verify_download_integrity: @verify_download_integrity,
timeout:)
end
def verify_has_sha
@ -209,21 +209,21 @@ on_request: true)
if (nested_container = @cask.container&.nested)
Dir.mktmpdir("cask-installer", HOMEBREW_TEMP) do |tmpdir|
tmpdir = Pathname(tmpdir)
primary_container.extract(to: tmpdir, basename: basename, verbose: verbose?)
primary_container.extract(to: tmpdir, basename:, verbose: verbose?)
FileUtils.chmod_R "+rw", tmpdir/nested_container, force: true, verbose: verbose?
UnpackStrategy.detect(tmpdir/nested_container, merge_xattrs: true)
.extract_nestedly(to: to, verbose: verbose?)
.extract_nestedly(to:, verbose: verbose?)
end
else
primary_container.extract_nestedly(to: to, basename: basename, verbose: verbose?)
primary_container.extract_nestedly(to:, basename:, verbose: verbose?)
end
return unless quarantine?
return unless Quarantine.available?
Quarantine.propagate(from: primary_container.path, to: to)
Quarantine.propagate(from: primary_container.path, to:)
end
sig { params(predecessor: T.nilable(Cask)).void }
@ -241,7 +241,7 @@ on_request: true)
next if artifact.is_a?(Artifact::Binary) && !binaries?
artifact.install_phase(
command: @command, verbose: verbose?, adopt: adopt?, force: force?, predecessor: predecessor,
command: @command, verbose: verbose?, adopt: adopt?, force: force?, predecessor:,
)
already_installed_artifacts.unshift(artifact)
end
@ -401,7 +401,7 @@ on_request: true)
def uninstall(successor: nil)
load_installed_caskfile!
oh1 "Uninstalling Cask #{Formatter.identifier(@cask)}"
uninstall_artifacts(clear: true, successor: successor)
uninstall_artifacts(clear: true, successor:)
if !reinstall? && !upgrade?
remove_download_sha
remove_config_file
@ -422,7 +422,7 @@ on_request: true)
sig { params(successor: T.nilable(Cask)).void }
def start_upgrade(successor:)
uninstall_artifacts(successor: successor)
uninstall_artifacts(successor:)
backup
end
@ -445,7 +445,7 @@ on_request: true)
def revert_upgrade(predecessor:)
opoo "Reverting upgrade for Cask #{@cask}"
restore_backup
install_artifacts(predecessor: predecessor)
install_artifacts(predecessor:)
end
def finalize_upgrade
@ -471,7 +471,7 @@ on_request: true)
verbose: verbose?,
skip: clear,
force: force?,
successor: successor,
successor:,
upgrade: upgrade?,
reinstall: reinstall?,
)
@ -485,7 +485,7 @@ on_request: true)
verbose: verbose?,
skip: clear,
force: force?,
successor: successor,
successor:,
)
end
end

View File

@ -18,7 +18,7 @@ module Cask
raise CaskError, "Cannot create metadata path with empty version." if cask_version.empty?
metadata_main_container_path(caskroom_path: caskroom_path).join(cask_version)
metadata_main_container_path(caskroom_path:).join(cask_version)
end
def metadata_timestamped_path(version: self.version, timestamp: :latest, create: false,
@ -26,10 +26,10 @@ module Cask
raise CaskError, "Cannot create metadata path when timestamp is :latest." if create && timestamp == :latest
path = if timestamp == :latest
Pathname.glob(metadata_versioned_path(version: version, caskroom_path: caskroom_path).join("*")).max
Pathname.glob(metadata_versioned_path(version:, caskroom_path:).join("*")).max
else
timestamp = new_timestamp if timestamp == :now
metadata_versioned_path(version: version, caskroom_path: caskroom_path).join(timestamp)
metadata_versioned_path(version:, caskroom_path:).join(timestamp)
end
if create && !path.directory?
@ -45,8 +45,8 @@ module Cask
raise CaskError, "Cannot create metadata subdir when timestamp is :latest." if create && timestamp == :latest
raise CaskError, "Cannot create metadata subdir for empty leaf." if !leaf.respond_to?(:empty?) || leaf.empty?
parent = metadata_timestamped_path(version: version, timestamp: timestamp, create: create,
caskroom_path: caskroom_path)
parent = metadata_timestamped_path(version:, timestamp:, create:,
caskroom_path:)
return if parent.nil?

View File

@ -27,7 +27,7 @@ module Cask
return if new_cask.token == old_cask.token
migrator = new(old_cask, new_cask)
migrator.migrate(dry_run: dry_run)
migrator.migrate(dry_run:)
end
sig { params(dry_run: T::Boolean).void }

View File

@ -21,14 +21,14 @@ module Cask
casks.each do |cask|
Installer.new(cask,
binaries: binaries,
verbose: verbose,
force: force,
skip_cask_deps: skip_cask_deps,
require_sha: require_sha,
binaries:,
verbose:,
force:,
skip_cask_deps:,
require_sha:,
reinstall: true,
quarantine: quarantine,
zap: zap).install
quarantine:,
zap:).install
end
end
end

View File

@ -12,7 +12,7 @@ module Cask
raise CaskNotInstalledError, cask if !cask.installed? && !force
Installer.new(cask, binaries: binaries, force: force, verbose: verbose).uninstall
Installer.new(cask, binaries:, force:, verbose:).uninstall
end
end
end

View File

@ -44,8 +44,8 @@ module Cask
outdated_casks = if casks.empty?
Caskroom.casks(config: Config.from_args(args)).select do |cask|
cask.outdated?(greedy: greedy, greedy_latest: greedy_latest,
greedy_auto_updates: greedy_auto_updates)
cask.outdated?(greedy:, greedy_latest:,
greedy_auto_updates:)
end
else
casks.select do |cask|
@ -113,8 +113,8 @@ module Cask
upgradable_casks.each do |(old_cask, new_cask)|
upgrade_cask(
old_cask, new_cask,
binaries: binaries, force: force, skip_cask_deps: skip_cask_deps, verbose: verbose,
quarantine: quarantine, require_sha: require_sha
binaries:, force:, skip_cask_deps:, verbose:,
quarantine:, require_sha:
)
rescue => e
new_exception = e.exception("#{new_cask.full_name}: #{e}")
@ -153,9 +153,9 @@ module Cask
old_config = old_cask.config
old_options = {
binaries: binaries,
verbose: verbose,
force: force,
binaries:,
verbose:,
force:,
upgrade: true,
}.compact
@ -165,13 +165,13 @@ module Cask
new_cask.config = new_cask.default_config.merge(old_config)
new_options = {
binaries: binaries,
verbose: verbose,
force: force,
skip_cask_deps: skip_cask_deps,
require_sha: require_sha,
binaries:,
verbose:,
force:,
skip_cask_deps:,
require_sha:,
upgrade: true,
quarantine: quarantine,
quarantine:,
}.compact
new_cask_installer =

View File

@ -191,26 +191,26 @@ module Cask
super(
if block
LazyObject.new do
uri2, options = *BlockDSL.new(uri, dsl: dsl, &block).call
uri2, options = *BlockDSL.new(uri, dsl:, &block).call
options ||= {}
DSL.new(uri2, **options)
end
else
DSL.new(
T.must(uri),
verified: verified,
using: using,
tag: tag,
branch: branch,
revisions: revisions,
revision: revision,
trust_cert: trust_cert,
cookies: cookies,
referer: referer,
header: header,
user_agent: user_agent,
data: data,
only_path: only_path,
verified:,
using:,
tag:,
branch:,
revisions:,
revision:,
trust_cert:,
cookies:,
referer:,
header:,
user_agent:,
data:,
only_path:,
)
end
)

View File

@ -269,7 +269,7 @@ module Homebrew
.sort_by(&:name)
.reject { |f| Cleanup.skip_clean_formula?(f) }
.each do |formula|
cleanup_formula(formula, quiet: quiet, ds_store: false, cache_db: false)
cleanup_formula(formula, quiet:, ds_store: false, cache_db: false)
end
Cleanup.autoremove(dry_run: dry_run?) if Homebrew::EnvConfig.autoremove?
@ -326,16 +326,16 @@ module Homebrew
end
def cleanup_formula(formula, quiet: false, ds_store: true, cache_db: true)
formula.eligible_kegs_for_cleanup(quiet: quiet)
formula.eligible_kegs_for_cleanup(quiet:)
.each(&method(:cleanup_keg))
cleanup_cache(Pathname.glob(cache/"#{formula.name}--*").map { |path| { path: path, type: nil } })
cleanup_cache(Pathname.glob(cache/"#{formula.name}--*").map { |path| { path:, type: nil } })
rm_ds_store([formula.rack]) if ds_store
cleanup_cache_db(formula.rack) if cache_db
cleanup_lockfiles(FormulaLock.new(formula.name).path)
end
def cleanup_cask(cask, ds_store: true)
cleanup_cache(Pathname.glob(cache/"Cask/#{cask.token}--*").map { |path| { path: path, type: :cask } })
cleanup_cache(Pathname.glob(cache/"Cask/#{cask.token}--*").map { |path| { path:, type: :cask } })
rm_ds_store([cask.caskroom_path]) if ds_store
cleanup_lockfiles(CaskLock.new(cask.token).path)
end
@ -363,10 +363,10 @@ module Homebrew
api_source_files = (cache/"api-source").glob("*/*/*/*/*") # org/repo/git_head/type/file.rb
gh_actions_artifacts = (cache/"gh-actions-artifact").directory? ? (cache/"gh-actions-artifact").children : []
files.map { |path| { path: path, type: nil } } +
cask_files.map { |path| { path: path, type: :cask } } +
api_source_files.map { |path| { path: path, type: :api_source } } +
gh_actions_artifacts.map { |path| { path: path, type: :gh_actions_artifact } }
files.map { |path| { path:, type: nil } } +
cask_files.map { |path| { path:, type: :cask } } +
api_source_files.map { |path| { path:, type: :api_source } } +
gh_actions_artifacts.map { |path| { path:, type: :gh_actions_artifact } }
end
def cleanup_empty_api_source_directories(directory = cache/"api-source")

View File

@ -40,8 +40,8 @@ module Homebrew
self[:named] = NamedArgs.new(
*named_args.freeze,
parent: self,
cask_options: cask_options,
without_api: without_api,
cask_options:,
without_api:,
**options,
)
end
@ -131,7 +131,7 @@ module Homebrew
oses.product(arches).select do |os, arch|
if skip_invalid_combinations
bottle_tag = Utils::Bottles::Tag.new(system: os, arch: arch)
bottle_tag = Utils::Bottles::Tag.new(system: os, arch:)
bottle_tag.valid_combination?
else
true

View File

@ -79,8 +79,8 @@ module Homebrew
)
@to_formulae_and_casks ||= {}
@to_formulae_and_casks[only] ||= downcased_unique_named.flat_map do |name|
options = { warn: warn }.compact
load_formula_or_cask(name, only: only, method: method, **options)
options = { warn: }.compact
load_formula_or_cask(name, only:, method:, **options)
rescue FormulaUnreadableError, FormulaClassUnavailableError,
TapFormulaUnreadableError, TapFormulaClassUnavailableError,
Cask::CaskUnreadableError
@ -100,7 +100,7 @@ module Homebrew
def to_formulae_to_casks(only: parent&.only_formula_or_cask, method: nil)
@to_formulae_to_casks ||= {}
@to_formulae_to_casks[[method, only]] = to_formulae_and_casks(only: only, method: method)
@to_formulae_to_casks[[method, only]] = to_formulae_and_casks(only:, method:)
.partition { |o| o.is_a?(Formula) || o.is_a?(Keg) }
.map(&:freeze).freeze
end
@ -108,7 +108,7 @@ module Homebrew
def to_formulae_and_casks_and_unavailable(only: parent&.only_formula_or_cask, method: nil)
@to_formulae_casks_unknowns ||= {}
@to_formulae_casks_unknowns[method] = downcased_unique_named.map do |name|
load_formula_or_cask(name, only: only, method: method)
load_formula_or_cask(name, only:, method:)
rescue FormulaOrCaskUnavailableError => e
e
end.uniq.freeze
@ -122,7 +122,7 @@ module Homebrew
begin
formula = case method
when nil, :factory
options = { warn: warn, force_bottle: @force_bottle, flags: @flags }.compact
options = { warn:, force_bottle: @force_bottle, flags: @flags }.compact
Formulary.factory(name, *@override_spec, **options)
when :resolve
resolve_formula(name)
@ -155,8 +155,8 @@ module Homebrew
begin
config = Cask::Config.from_args(@parent) if @cask_options
options = { warn: warn }.compact
cask = Cask::CaskLoader.load(name, config: config, **options)
options = { warn: }.compact
cask = Cask::CaskLoader.load(name, config:, **options)
if unreadable_error.present?
onoe <<~EOS
@ -177,8 +177,8 @@ module Homebrew
# If we're trying to get a keg-like Cask, do our best to handle it
# not being readable and return something that can be used.
if want_keg_like_cask
cask_version = Cask::Cask.new(name, config: config).installed_version
cask = Cask::Cask.new(name, config: config) do
cask_version = Cask::Cask.new(name, config:).installed_version
cask = Cask::Cask.new(name, config:) do
version cask_version if cask_version
end
return cask
@ -214,12 +214,12 @@ module Homebrew
sig { params(uniq: T::Boolean).returns(T::Array[Formula]) }
def to_resolved_formulae(uniq: true)
@to_resolved_formulae ||= to_formulae_and_casks(only: :formula, method: :resolve, uniq: uniq)
@to_resolved_formulae ||= to_formulae_and_casks(only: :formula, method: :resolve, uniq:)
.freeze
end
def to_resolved_formulae_to_casks(only: parent&.only_formula_or_cask)
to_formulae_to_casks(only: only, method: :resolve)
to_formulae_to_casks(only:, method: :resolve)
end
LOCAL_PATH_REGEX = %r{^/|[.]|/$}
@ -314,7 +314,7 @@ module Homebrew
method = all_kegs ? :kegs : :default_kegs
@to_kegs_to_casks ||= {}
@to_kegs_to_casks[method] ||=
to_formulae_and_casks(only: only, ignore_unavailable: ignore_unavailable, method: method)
to_formulae_and_casks(only:, ignore_unavailable:, method:)
.partition { |o| o.is_a?(Keg) }
.map(&:freeze).freeze
end

View File

@ -159,8 +159,8 @@ module Homebrew
global_switch = names.first.is_a?(Symbol)
return if global_switch
description = option_description(description, *names, hidden: hidden)
process_option(*names, description, type: :switch, hidden: hidden) unless disable
description = option_description(description, *names, hidden:)
process_option(*names, description, type: :switch, hidden:) unless disable
if replacement || disable
description += " (#{disable ? "disabled" : "deprecated"}#{"; replaced by #{replacement}" if replacement})"
@ -171,11 +171,11 @@ module Homebrew
odeprecated "the `#{names.first}` switch", replacement, disable: disable if !replacement.nil? || disable
value = true if names.none? { |name| name.start_with?("--[no-]") }
set_switch(*names, value: value, from: :args)
set_switch(*names, value:, from: :args)
end
names.each do |name|
set_constraints(name, depends_on: depends_on)
set_constraints(name, depends_on:)
end
env_value = value_for_env(env)
@ -211,8 +211,8 @@ module Homebrew
def comma_array(name, description: nil, hidden: false)
name = name.chomp "="
description = option_description(description, name, hidden: hidden)
process_option(name, description, type: :comma_array, hidden: hidden)
description = option_description(description, name, hidden:)
process_option(name, description, type: :comma_array, hidden:)
@parser.on(name, OptionParser::REQUIRED_ARGUMENT, Array, *wrap_option_desc(description)) do |list|
@args[option_to_name(name)] = list
end
@ -225,9 +225,9 @@ module Homebrew
[OptionParser::OPTIONAL_ARGUMENT, :optional_flag]
end
names.map! { |name| name.chomp "=" }
description = option_description(description, *names, hidden: hidden)
description = option_description(description, *names, hidden:)
if replacement.nil?
process_option(*names, description, type: flag_type, hidden: hidden)
process_option(*names, description, type: flag_type, hidden:)
else
description += " (disabled#{"; replaced by #{replacement}" if replacement.present?})"
end
@ -240,7 +240,7 @@ module Homebrew
end
names.each do |name|
set_constraints(name, depends_on: depends_on)
set_constraints(name, depends_on:)
end
end
@ -329,9 +329,9 @@ module Homebrew
name = o.flag
description = "`#{f.name}`: #{o.description}"
if name.end_with? "="
flag name, description: description
flag(name, description:)
else
switch name, description: description
switch name, description:
end
conflicts "--cask", name
@ -339,7 +339,7 @@ module Homebrew
end
end
remaining, non_options = parse_remaining(argv, ignore_invalid_options: ignore_invalid_options)
remaining, non_options = parse_remaining(argv, ignore_invalid_options:)
named_args = if ignore_invalid_options
[]
@ -601,11 +601,11 @@ module Homebrew
exception = if @min_named_args && @max_named_args && @min_named_args == @max_named_args &&
args.size != @max_named_args
NumberOfNamedArgumentsError.new(@min_named_args, types: types)
NumberOfNamedArgumentsError.new(@min_named_args, types:)
elsif @min_named_args && args.size < @min_named_args
MinNamedArgumentsError.new(@min_named_args, types: types)
MinNamedArgumentsError.new(@min_named_args, types:)
elsif @max_named_args && args.size > @max_named_args
MaxNamedArgumentsError.new(@max_named_args, types: types)
MaxNamedArgumentsError.new(@max_named_args, types:)
end
raise exception if exception

View File

@ -63,9 +63,9 @@ module Homebrew
ref = formula.loaded_from_api? ? formula.full_name : formula.path
os_arch_combinations.each do |os, arch|
SimulateSystem.with os: os, arch: arch do
SimulateSystem.with(os:, arch:) do
formula = Formulary.factory(ref)
print_formula_cache(formula, os: os, arch: arch, args: args)
print_formula_cache(formula, os:, arch:, args:)
end
end
else
@ -75,7 +75,7 @@ module Homebrew
os_arch_combinations.each do |os, arch|
next if os == :linux
SimulateSystem.with os: os, arch: arch do
SimulateSystem.with(os:, arch:) do
cask = Cask::CaskLoader.load(ref)
print_cask_cache(cask)
end
@ -97,7 +97,7 @@ module Homebrew
bottle_tag = if (bottle_tag = args.bottle_tag&.to_sym)
Utils::Bottles::Tag.from_symbol(bottle_tag)
else
Utils::Bottles::Tag.new(system: os, arch: arch)
Utils::Bottles::Tag.new(system: os, arch:)
end
bottle = formula.bottle_for_tag(bottle_tag)

View File

@ -48,7 +48,7 @@ module Homebrew
end
end
cleanup = Cleanup.new(*args.named, dry_run: args.dry_run?, scrub: args.s?, days: days)
cleanup = Cleanup.new(*args.named, dry_run: args.dry_run?, scrub: args.s?, days:)
if args.prune_prefix?
cleanup.prune_prefix_symlinks_and_directories
return

View File

@ -119,7 +119,7 @@ module Homebrew
end
if args.graph?
dot_code = dot_code(dependents, recursive: recursive, args: args)
dot_code = dot_code(dependents, recursive:, args:)
if args.dot?
puts dot_code
else
@ -128,15 +128,15 @@ module Homebrew
return
end
puts_deps_tree dependents, recursive: recursive, args: args
puts_deps_tree(dependents, recursive:, args:)
return
elsif all
puts_deps sorted_dependents(
Formula.all(eval_all: args.eval_all?) + Cask::Cask.all(eval_all: args.eval_all?),
), recursive: recursive, args: args
puts_deps(sorted_dependents(
Formula.all(eval_all: args.eval_all?) + Cask::Cask.all(eval_all: args.eval_all?),
), recursive:, args:)
return
elsif !args.no_named? && args.for_each?
puts_deps sorted_dependents(args.named.to_formulae_and_casks), recursive: recursive, args: args
puts_deps(sorted_dependents(args.named.to_formulae_and_casks), recursive:, args:)
return
end
@ -151,16 +151,16 @@ module Homebrew
else
sorted_dependents(Formula.installed + Cask::Caskroom.casks)
end
puts_deps sorted_dependents_formulae_and_casks, recursive: recursive, args: args
puts_deps(sorted_dependents_formulae_and_casks, recursive:, args:)
return
end
dependents = dependents(args.named.to_formulae_and_casks)
check_head_spec(dependents) if args.HEAD?
all_deps = deps_for_dependents(dependents, recursive: recursive, args: args, &(args.union? ? :| : :&))
condense_requirements(all_deps, args: args)
all_deps.map! { |d| dep_display_name(d, args: args) }
all_deps = deps_for_dependents(dependents, recursive:, args:, &(args.union? ? :| : :&))
condense_requirements(all_deps, args:)
all_deps.map! { |d| dep_display_name(d, args:) }
all_deps.uniq!
all_deps.sort! unless args.topological?
puts all_deps
@ -218,7 +218,7 @@ module Homebrew
end
def self.deps_for_dependents(dependents, args:, recursive: false, &block)
dependents.map { |d| deps_for_dependent(d, recursive: recursive, args: args) }.reduce(&block)
dependents.map { |d| deps_for_dependent(d, recursive:, args:) }.reduce(&block)
end
def self.check_head_spec(dependents)
@ -230,10 +230,10 @@ module Homebrew
def self.puts_deps(dependents, args:, recursive: false)
check_head_spec(dependents) if args.HEAD?
dependents.each do |dependent|
deps = deps_for_dependent(dependent, recursive: recursive, args: args)
condense_requirements(deps, args: args)
deps = deps_for_dependent(dependent, recursive:, args:)
condense_requirements(deps, args:)
deps.sort_by!(&:name)
deps.map! { |d| dep_display_name(d, args: args) }
deps.map! { |d| dep_display_name(d, args:) }
puts "#{dependent.full_name}: #{deps.join(" ")}"
end
end
@ -241,7 +241,7 @@ module Homebrew
def self.dot_code(dependents, recursive:, args:)
dep_graph = {}
dependents.each do |d|
graph_deps(d, dep_graph: dep_graph, recursive: recursive, args: args)
graph_deps(d, dep_graph:, recursive:, args:)
end
dot_code = dep_graph.map do |d, deps|
@ -264,7 +264,7 @@ module Homebrew
def self.graph_deps(formula, dep_graph:, recursive:, args:)
return if dep_graph.key?(formula)
dependables = dependables(formula, args: args)
dependables = dependables(formula, args:)
dep_graph[formula] = dependables
return unless recursive
@ -272,9 +272,9 @@ module Homebrew
next unless dep.is_a? Dependency
graph_deps(Formulary.factory(dep.name),
dep_graph: dep_graph,
dep_graph:,
recursive: true,
args: args)
args:)
end
end
@ -282,7 +282,7 @@ module Homebrew
check_head_spec(dependents) if args.HEAD?
dependents.each do |d|
puts d.full_name
recursive_deps_tree(d, dep_stack: [], prefix: "", recursive: recursive, args: args)
recursive_deps_tree(d, dep_stack: [], prefix: "", recursive:, args:)
puts
end
end
@ -297,7 +297,7 @@ module Homebrew
end
def self.recursive_deps_tree(formula, dep_stack:, prefix:, recursive:, args:)
dependables = dependables(formula, args: args)
dependables = dependables(formula, args:)
max = dependables.length - 1
dep_stack.push formula.name
dependables.each_with_index do |dep, i|
@ -307,7 +307,7 @@ module Homebrew
"├──"
end
display_s = "#{tree_lines} #{dep_display_name(dep, args: args)}"
display_s = "#{tree_lines} #{dep_display_name(dep, args:)}"
# Detect circular dependencies and consider them a failure if present.
is_circular = dep_stack.include?(dep.name)
@ -329,10 +329,10 @@ module Homebrew
next unless dep.is_a? Dependency
recursive_deps_tree(Formulary.factory(dep.name),
dep_stack: dep_stack,
dep_stack:,
prefix: prefix + prefix_addition,
recursive: true,
args: args)
args:)
end
dep_stack.pop

View File

@ -68,7 +68,7 @@ module Homebrew
else
query = args.named.join(" ")
string_or_regex = Search.query_regexp(query)
Search.search_descriptions(string_or_regex, args, search_type: search_type)
Search.search_descriptions(string_or_regex, args, search_type:)
end
end
end

View File

@ -98,7 +98,7 @@ module Homebrew
ref = formula.loaded_from_api? ? formula.full_name : formula.path
os_arch_combinations.each do |os, arch|
SimulateSystem.with os: os, arch: arch do
SimulateSystem.with(os:, arch:) do
formula = Formulary.factory(ref, args.HEAD? ? :head : :stable)
formula.print_tap_action verb: "Fetching"
@ -118,7 +118,7 @@ module Homebrew
bottle_tag = if (bottle_tag = args.bottle_tag&.to_sym)
Utils::Bottles::Tag.from_symbol(bottle_tag)
else
Utils::Bottles::Tag.new(system: os, arch: arch)
Utils::Bottles::Tag.new(system: os, arch:)
end
bottle = formula.bottle_for_tag(bottle_tag)
@ -131,10 +131,10 @@ module Homebrew
begin
bottle.fetch_tab
rescue DownloadError
retry if retry_fetch?(bottle, args: args)
retry if retry_fetch?(bottle, args:)
raise
end
fetch_formula(bottle, args: args)
fetch_formula(bottle, args:)
rescue Interrupt
raise
rescue => e
@ -150,14 +150,14 @@ module Homebrew
next if fetched_bottle
fetch_formula(formula, args: args)
fetch_formula(formula, args:)
formula.resources.each do |r|
fetch_resource(r, args: args)
r.patches.each { |p| fetch_patch(p, args: args) if p.external? }
fetch_resource(r, args:)
r.patches.each { |p| fetch_patch(p, args:) if p.external? }
end
formula.patchlist.each { |p| fetch_patch(p, args: args) if p.external? }
formula.patchlist.each { |p| fetch_patch(p, args:) if p.external? }
end
end
else
@ -167,7 +167,7 @@ module Homebrew
os_arch_combinations.each do |os, arch|
next if os == :linux
SimulateSystem.with os: os, arch: arch do
SimulateSystem.with(os:, arch:) do
cask = Cask::CaskLoader.load(ref)
if cask.url.nil? || cask.sha256.nil?
@ -178,8 +178,8 @@ module Homebrew
quarantine = args.quarantine?
quarantine = true if quarantine.nil?
download = Cask::Download.new(cask, quarantine: quarantine)
fetch_cask(download, args: args)
download = Cask::Download.new(cask, quarantine:)
fetch_cask(download, args:)
end
end
end
@ -188,28 +188,28 @@ module Homebrew
def self.fetch_resource(resource, args:)
puts "Resource: #{resource.name}"
fetch_fetchable resource, args: args
fetch_fetchable resource, args:
rescue ChecksumMismatchError => e
retry if retry_fetch?(resource, args: args)
retry if retry_fetch?(resource, args:)
opoo "Resource #{resource.name} reports different sha256: #{e.expected}"
end
def self.fetch_formula(formula, args:)
fetch_fetchable formula, args: args
fetch_fetchable(formula, args:)
rescue ChecksumMismatchError => e
retry if retry_fetch?(formula, args: args)
retry if retry_fetch?(formula, args:)
opoo "Formula reports different sha256: #{e.expected}"
end
def self.fetch_cask(cask_download, args:)
fetch_fetchable cask_download, args: args
fetch_fetchable(cask_download, args:)
rescue ChecksumMismatchError => e
retry if retry_fetch?(cask_download, args: args)
retry if retry_fetch?(cask_download, args:)
opoo "Cask reports different sha256: #{e.expected}"
end
def self.fetch_patch(patch, args:)
fetch_fetchable patch, args: args
fetch_fetchable(patch, args:)
rescue ChecksumMismatchError => e
opoo "Patch reports different sha256: #{e.expected}"
Homebrew.failed = true
@ -242,7 +242,7 @@ module Homebrew
begin
download = formula.fetch(verify_download_integrity: false)
rescue DownloadError
retry if retry_fetch?(formula, args: args)
retry if retry_fetch?(formula, args:)
raise
end

View File

@ -125,6 +125,6 @@ module Homebrew
Install.perform_preinstall_checks(all_fatal: true)
Install.perform_build_from_source_checks(all_fatal: true)
gistify_logs(args.named.to_resolved_formulae.first, args: args)
gistify_logs(args.named.to_resolved_formulae.first, args:)
end
end

View File

@ -96,11 +96,11 @@ module Homebrew
end
end
print_analytics(args: args)
print_analytics(args:)
elsif args.json
all = args.eval_all?
print_json(all, args: args)
print_json(all, args:)
elsif args.github?
raise FormulaOrCaskUnspecifiedError if args.no_named?
@ -108,7 +108,7 @@ module Homebrew
elsif args.no_named?
print_statistics
else
print_info(args: args)
print_info(args:)
end
end
@ -123,7 +123,7 @@ module Homebrew
sig { params(args: CLI::Args).void }
def print_analytics(args:)
if args.no_named?
Utils::Analytics.output(args: args)
Utils::Analytics.output(args:)
return
end
@ -132,11 +132,11 @@ module Homebrew
case obj
when Formula
Utils::Analytics.formula_output(obj, args: args)
Utils::Analytics.formula_output(obj, args:)
when Cask::Cask
Utils::Analytics.cask_output(obj, args: args)
Utils::Analytics.cask_output(obj, args:)
when FormulaOrCaskUnavailableError
Utils::Analytics.output(filter: obj.name, args: args)
Utils::Analytics.output(filter: obj.name, args:)
else
raise
end
@ -150,9 +150,9 @@ module Homebrew
case obj
when Formula
info_formula(obj, args: args)
info_formula(obj, args:)
when Cask::Cask
info_cask(obj, args: args)
info_cask(obj, args:)
when FormulaUnreadableError, FormulaClassUnavailableError,
TapFormulaUnreadableError, TapFormulaClassUnavailableError,
Cask::CaskUnreadableError
@ -341,7 +341,7 @@ module Homebrew
caveats = Caveats.new(formula)
ohai "Caveats", caveats.to_s unless caveats.empty?
Utils::Analytics.formula_output(formula, args: args)
Utils::Analytics.formula_output(formula, args:)
end
def decorate_dependencies(dependencies)

View File

@ -258,7 +258,7 @@ module Homebrew
require_sha: args.require_sha?,
skip_cask_deps: args.skip_cask_deps?,
verbose: args.verbose?,
args: args,
args:,
)
end
end

View File

@ -86,10 +86,10 @@ module Homebrew
puts full_cask_names if full_cask_names.present?
end
elsif args.pinned?
filtered_list(args: args)
filtered_list(args:)
elsif args.versions?
filtered_list(args: args) unless args.cask?
list_casks(args: args) if args.cask? || (!args.formula? && !args.multiple? && args.no_named?)
filtered_list(args:) unless args.cask?
list_casks(args:) if args.cask? || (!args.formula? && !args.multiple? && args.no_named?)
elsif args.no_named?
ENV["CLICOLOR"] = nil
@ -117,7 +117,7 @@ module Homebrew
system_command! "find", args: casks.map(&:caskroom_path) + find_args, print_stdout: true if casks.present?
else
kegs.each { |keg| PrettyListing.new keg } if kegs.present?
list_casks(args: args) if casks.present?
list_casks(args:) if casks.present?
end
end
end

View File

@ -41,11 +41,11 @@ module Homebrew
ENV["PATH"] = PATH.new(ORIGINAL_PATHS).to_s
if args.no_named?
git_log HOMEBREW_REPOSITORY, args: args
git_log(HOMEBREW_REPOSITORY, args:)
else
path = args.named.to_paths.first
tap = Tap.from_path(path)
git_log path.dirname, path, tap, args: args
git_log path.dirname, path, tap, args:
end
end

View File

@ -35,9 +35,9 @@ module Homebrew
all = args.eval_all?
if all
puts_options Formula.all(eval_all: args.eval_all?).sort, args: args
puts_options(Formula.all(eval_all: args.eval_all?).sort, args:)
elsif args.installed?
puts_options Formula.installed.sort, args: args
puts_options(Formula.installed.sort, args:)
elsif args.command.present?
cmd_options = Commands.command_options(args.command)
odie "Unknown command: #{args.command}" if cmd_options.nil?
@ -51,7 +51,7 @@ module Homebrew
elsif args.no_named?
raise FormulaUnspecifiedError
else
puts_options args.named.to_formulae, args: args
puts_options args.named.to_formulae, args:
end
end

View File

@ -55,16 +55,16 @@ module Homebrew
odie "`brew outdated --json=v1` is no longer supported. Use brew outdated --json=v2 instead."
when :v2, :default
formulae, casks = if args.formula?
[outdated_formulae(args: args), []]
[outdated_formulae(args:), []]
elsif args.cask?
[[], outdated_casks(args: args)]
[[], outdated_casks(args:)]
else
outdated_formulae_casks args: args
outdated_formulae_casks(args:)
end
json = {
"formulae" => json_info(formulae, args: args),
"casks" => json_info(casks, args: args),
"formulae" => json_info(formulae, args:),
"casks" => json_info(casks, args:),
}
puts JSON.pretty_generate(json)
@ -72,14 +72,14 @@ module Homebrew
else
outdated = if args.formula?
outdated_formulae args: args
outdated_formulae(args:)
elsif args.cask?
outdated_casks args: args
outdated_casks(args:)
else
outdated_formulae_casks(args: args).flatten
outdated_formulae_casks(args:).flatten
end
print_outdated(outdated, args: args)
print_outdated(outdated, args:)
end
Homebrew.failed = args.named.present? && outdated.present?
@ -137,7 +137,7 @@ module Homebrew
{ name: f.full_name,
installed_versions: outdated_versions.map(&:to_s),
current_version: current_version,
current_version:,
pinned: f.pinned?,
pinned_version: f.pinned_version }
else
@ -166,14 +166,14 @@ module Homebrew
end
def self.outdated_formulae(args:)
select_outdated((args.named.to_resolved_formulae.presence || Formula.installed), args: args).sort
select_outdated((args.named.to_resolved_formulae.presence || Formula.installed), args:).sort
end
def self.outdated_casks(args:)
if args.named.present?
select_outdated(args.named.to_casks, args: args)
select_outdated(args.named.to_casks, args:)
else
select_outdated(Cask::Caskroom.casks, args: args)
select_outdated(Cask::Caskroom.casks, args:)
end
end
@ -185,7 +185,7 @@ module Homebrew
casks = Cask::Caskroom.casks
end
[select_outdated(formulae, args: args).sort, select_outdated(casks, args: args)]
[select_outdated(formulae, args:).sort, select_outdated(casks, args:)]
end
def self.select_outdated(formulae_or_casks, args:)

View File

@ -59,7 +59,7 @@ module Homebrew
Uninstall.uninstall_kegs(
kegs_by_rack,
casks: casks,
casks:,
force: args.force?,
ignore_dependencies: args.ignore_dependencies?,
named_args: args.named,

View File

@ -109,7 +109,7 @@ module Homebrew
odie "update-report should not be called directly!" if initial_revision.empty? || current_revision.empty?
if initial_revision != current_revision
auto_update_header args: args
auto_update_header(args:)
updated = true
@ -219,7 +219,7 @@ module Homebrew
end
unless updated_taps.empty?
auto_update_header args: args
auto_update_header(args:)
puts "Updated #{Utils.pluralize("tap", updated_taps.count, include_count: true)} (#{updated_taps.to_sentence})."
updated = true
end
@ -689,7 +689,7 @@ class Reporter
end
next if oldnames_to_migrate.empty?
Migrator.migrate_if_needed(formula, force: force)
Migrator.migrate_if_needed(formula, force:)
end
end
@ -743,7 +743,7 @@ class ReporterHub
def add(reporter, auto_update: false)
@reporters << reporter
report = reporter.report(auto_update: auto_update).delete_if { |_k, v| v.empty? }
report = reporter.report(auto_update:).delete_if { |_k, v| v.empty? }
@hash.update(report) { |_key, oldval, newval| oldval.concat(newval) }
end

View File

@ -137,8 +137,8 @@ module Homebrew
only_upgrade_formulae = formulae.present? && casks.blank?
only_upgrade_casks = casks.present? && formulae.blank?
upgrade_outdated_formulae(formulae, args: args) unless only_upgrade_casks
upgrade_outdated_casks(casks, args: args) unless only_upgrade_formulae
upgrade_outdated_formulae(formulae, args:) unless only_upgrade_casks
upgrade_outdated_casks(casks, args:) unless only_upgrade_formulae
Cleanup.periodic_clean!(dry_run: args.dry_run?)
@ -269,7 +269,7 @@ module Homebrew
require_sha: args.require_sha?,
skip_cask_deps: args.skip_cask_deps?,
verbose: args.verbose?,
args: args,
args:,
)
end
end

View File

@ -69,7 +69,7 @@ module Homebrew
# If the formula doesn't exist: fake the needed formula object name.
# This is a legacy use of OpenStruct that should be refactored.
# rubocop:disable Style/OpenStructUse
args.named.map { |name| OpenStruct.new name: name, full_name: name }
args.named.map { |name| OpenStruct.new name:, full_name: name }
# rubocop:enable Style/OpenStructUse
end
@ -80,7 +80,7 @@ module Homebrew
!args.include_optional? &&
!args.skip_recommended?
uses = intersection_of_dependents(use_runtime_dependents, used_formulae, args: args)
uses = intersection_of_dependents(use_runtime_dependents, used_formulae, args:)
return if uses.empty?

View File

@ -116,7 +116,7 @@ module Commands
def self.official_external_commands_paths(quiet:)
OFFICIAL_CMD_TAPS.flat_map do |tap_name, cmds|
tap = Tap.fetch(tap_name)
tap.install(quiet: quiet) unless tap.installed?
tap.install(quiet:) unless tap.installed?
cmds.map(&method(:external_ruby_v2_cmd_path)).compact
end
end

View File

@ -54,7 +54,7 @@ class CompilerFailure
version = 9999
exact_major_match = false
end
new(type, version, exact_major_match: exact_major_match, &block)
new(type, version, exact_major_match:, &block)
end
def fails_with?(compiler)

View File

@ -25,7 +25,7 @@ module DependenciesHelpers
cache_key = "recursive_includes_#{includes}_#{ignores}"
klass.expand(root_dependent, cache_key: cache_key) do |dependent, dep|
klass.expand(root_dependent, cache_key:) do |dependent, dep|
klass.prune if ignores.any? { |ignore| dep.public_send(ignore) }
klass.prune if includes.none? do |include|
# Ignore indirect test dependencies

View File

@ -74,7 +74,7 @@ class Dependency
end
def satisfied?(inherited_options = [], minimum_version: nil, minimum_revision: nil)
installed?(minimum_version: minimum_version, minimum_revision: minimum_revision) &&
installed?(minimum_version:, minimum_revision:) &&
missing_options(inherited_options).empty?
end
@ -133,14 +133,14 @@ class Dependency
when :skip
next if @expand_stack.include? dep.name
expanded_deps.concat(expand(dep.to_formula, cache_key: cache_key, &block))
expanded_deps.concat(expand(dep.to_formula, cache_key:, &block))
when :keep_but_prune_recursive_deps
expanded_deps << dep
else
next if @expand_stack.include? dep.name
dep_formula = dep.to_formula
expanded_deps.concat(expand(dep_formula, cache_key: cache_key, &block))
expanded_deps.concat(expand(dep_formula, cache_key:, &block))
# Fixes names for renamed/aliased formulae.
dep = dep.dup_with_formula_name(dep_formula)
@ -249,7 +249,7 @@ class UsesFromMacOSDependency < Dependency
sig { params(minimum_version: T.nilable(Version), minimum_revision: T.nilable(Integer)).returns(T::Boolean) }
def installed?(minimum_version: nil, minimum_revision: nil)
use_macos_install? || super(minimum_version: minimum_version, minimum_revision: minimum_revision)
use_macos_install? || super(minimum_version:, minimum_revision:)
end
sig { returns(T::Boolean) }
@ -276,7 +276,7 @@ class UsesFromMacOSDependency < Dependency
sig { override.params(formula: Formula).returns(T.self_type) }
def dup_with_formula_name(formula)
self.class.new(formula.full_name.to_s, tags, bounds: bounds)
self.class.new(formula.full_name.to_s, tags, bounds:)
end
sig { returns(String) }

View File

@ -34,7 +34,7 @@ class DescriptionCacheStore < CacheStore
return unless eval_all
return unless database.empty?
Formula.all(eval_all: eval_all).each { |f| update!(f.full_name, f.desc) }
Formula.all(eval_all:).each { |f| update!(f.full_name, f.desc) }
end
# Use an update report to update the {DescriptionCacheStore}.
@ -100,7 +100,7 @@ class CaskDescriptionCacheStore < DescriptionCacheStore
return unless eval_all
return unless database.empty?
Cask::Cask.all(eval_all: eval_all)
Cask::Cask.all(eval_all:)
.each { |c| update!(c.full_name, [c.name.join(", "), c.desc.presence]) }
end

View File

@ -11,7 +11,7 @@ require "search"
class Descriptions
# Given a regex, find all formulae whose specified fields contain a match.
def self.search(string_or_regex, field, cache_store, eval_all = Homebrew::EnvConfig.eval_all?)
cache_store.populate_if_empty!(eval_all: eval_all)
cache_store.populate_if_empty!(eval_all:)
results = case field
when :name

View File

@ -210,20 +210,20 @@ module Homebrew
only = only_cops ? ["style"] : args.only
options = {
new_formula: new_formula,
strict: strict,
online: online,
new_formula:,
strict:,
online:,
git: args.git?,
only: only,
only:,
except: args.except,
spdx_license_data: spdx_license_data,
spdx_exception_data: spdx_exception_data,
spdx_license_data:,
spdx_exception_data:,
style_offenses: style_offenses&.for_path(f.path),
tap_audit: tap_audit,
tap_audit:,
}.compact
errors = os_arch_combinations.flat_map do |os, arch|
SimulateSystem.with os: os, arch: arch do
SimulateSystem.with(os:, arch:) do
odebug "Auditing Formula #{f} on os #{os} and arch #{arch}"
audit_proc = proc { FormulaAuditor.new(Formulary.factory(path), **options).tap(&:audit) }
@ -251,7 +251,7 @@ module Homebrew
errors = os_arch_combinations.flat_map do |os, arch|
next [] if os == :linux
SimulateSystem.with os: os, arch: arch do
SimulateSystem.with(os:, arch:) do
odebug "Auditing Cask #{cask} on os #{os} and arch #{arch}"
Cask::Auditor.audit(

View File

@ -96,13 +96,13 @@ module Homebrew
if args.merge?
Homebrew.install_bundler_gems!(groups: ["ast"])
return merge(args: args)
return merge(args:)
end
gnu_tar_formula_ensure_installed_if_needed!(only_json_tab: args.only_json_tab?)
args.named.to_resolved_formulae(uniq: false).each do |formula|
bottle_formula formula, args: args
bottle_formula formula, args:
end
end
@ -153,7 +153,7 @@ module Homebrew
end
end
keg_contain_absolute_symlink_starting_with?(string, keg, args: args) || result
keg_contain_absolute_symlink_starting_with?(string, keg, args:) || result
end
def self.keg_contain_absolute_symlink_starting_with?(string, keg, args:)
@ -482,7 +482,7 @@ module Homebrew
else
HOMEBREW_REPOSITORY
end.to_s
if keg_contain?(repository_reference, keg, ignores + ALLOWABLE_HOMEBREW_REPOSITORY_LINKS, args: args)
if keg_contain?(repository_reference, keg, ignores + ALLOWABLE_HOMEBREW_REPOSITORY_LINKS, args:)
odie "Bottle contains non-relocatable reference to #{repository_reference}!"
end
@ -490,16 +490,16 @@ module Homebrew
if args.skip_relocation?
skip_relocation = true
else
relocatable = false if keg_contain?(prefix_check, keg, ignores, formula_and_runtime_deps_names, args: args)
relocatable = false if keg_contain?(cellar, keg, ignores, formula_and_runtime_deps_names, args: args)
if keg_contain?(HOMEBREW_LIBRARY.to_s, keg, ignores, formula_and_runtime_deps_names, args: args)
relocatable = false if keg_contain?(prefix_check, keg, ignores, formula_and_runtime_deps_names, args:)
relocatable = false if keg_contain?(cellar, keg, ignores, formula_and_runtime_deps_names, args:)
if keg_contain?(HOMEBREW_LIBRARY.to_s, keg, ignores, formula_and_runtime_deps_names, args:)
relocatable = false
end
if prefix != prefix_check
relocatable = false if keg_contain_absolute_symlink_starting_with?(prefix, keg, args: args)
relocatable = false if keg_contain?("#{prefix}/etc", keg, ignores, args: args)
relocatable = false if keg_contain?("#{prefix}/var", keg, ignores, args: args)
relocatable = false if keg_contain?("#{prefix}/share/vim", keg, ignores, args: args)
relocatable = false if keg_contain_absolute_symlink_starting_with?(prefix, keg, args:)
relocatable = false if keg_contain?("#{prefix}/etc", keg, ignores, args:)
relocatable = false if keg_contain?("#{prefix}/var", keg, ignores, args:)
relocatable = false if keg_contain?("#{prefix}/share/vim", keg, ignores, args:)
end
skip_relocation = relocatable && !keg.require_relocation?
end
@ -661,7 +661,7 @@ module Homebrew
tag.to_sym
end
sha256_hash = { cellar: cellar, tag_sym => tag_hash["sha256"] }
sha256_hash = { cellar:, tag_sym => tag_hash["sha256"] }
bottle.sha256 sha256_hash
break if all_bottle
@ -735,7 +735,7 @@ module Homebrew
require "utils/ast"
formula_ast = Utils::AST::FormulaAST.new(path.read)
checksums = old_checksums(formula, formula_ast, bottle_hash, args: args)
checksums = old_checksums(formula, formula_ast, bottle_hash, args:)
update_or_add = checksums.nil? ? "add" : "update"
checksums&.each(&bottle.method(:sha256))

View File

@ -123,7 +123,7 @@ module Homebrew
raise UsageError, "No `--version`, `--url` or `--sha256` argument specified!"
end
check_pull_requests(cask, args: args, new_version: new_version)
check_pull_requests(cask, args:, new_version:)
replacement_pairs ||= []
branch_name = "bump-#{cask.token}"
@ -149,7 +149,7 @@ module Homebrew
# For simplicity, our naming defers to the arm version if we multiple architectures are specified
branch_version = new_version.arm || new_version.general
if branch_version.is_a?(Cask::DSL::Version)
commit_version = shortened_version(branch_version, cask: cask)
commit_version = shortened_version(branch_version, cask:)
branch_name = "bump-#{cask.token}-#{branch_version.tr(",:", "-")}"
commit_message ||= "#{cask.token} #{commit_version}"
end
@ -166,18 +166,18 @@ module Homebrew
read_only_run: args.dry_run?,
silent: args.quiet?)
run_cask_audit(cask, old_contents, args: args)
run_cask_style(cask, old_contents, args: args)
run_cask_audit(cask, old_contents, args:)
run_cask_style(cask, old_contents, args:)
pr_info = {
branch_name: branch_name,
commit_message: commit_message,
old_contents: old_contents,
branch_name:,
commit_message:,
old_contents:,
pr_message: "Created with `brew bump-cask-pr`.",
sourcefile_path: cask.sourcefile_path,
tap: cask.tap,
}
GitHub.create_bump_pr(pr_info, args: args)
GitHub.create_bump_pr(pr_info, args:)
end
sig { params(version: Cask::DSL::Version, cask: Cask::Cask).returns(Cask::DSL::Version) }
@ -201,7 +201,7 @@ module Homebrew
# When blocks are absent, arch is not relevant. For consistency, we simulate the arm architecture.
arch_options = cask.on_system_blocks_exist? ? OnSystem::ARCH_OPTIONS : [:arm]
arch_options.each do |arch|
SimulateSystem.with arch: arch do
SimulateSystem.with(arch:) do
old_cask = Cask::CaskLoader.load(cask.sourcefile_path)
old_version = old_cask.version
bump_version = new_version.send(arch) || new_version.general
@ -272,7 +272,7 @@ module Homebrew
cask.token,
tap_remote_repo,
state: "closed",
version: shortened_version(version, cask: cask),
version: shortened_version(version, cask:),
file: cask.sourcefile_path.relative_path_from(cask.tap.path).to_s,
quiet: args.quiet?,
)

View File

@ -134,10 +134,10 @@ module Homebrew
remote_branch = formula.tap.git_repo.origin_branch_name
previous_branch = "-"
check_open_pull_requests(formula, tap_remote_repo, args: args)
check_open_pull_requests(formula, tap_remote_repo, args:)
new_version = args.version
check_new_version(formula, tap_remote_repo, version: new_version, args: args) if new_version.present?
check_new_version(formula, tap_remote_repo, version: new_version, args:) if new_version.present?
opoo "This formula has patches that may be resolved upstream." if formula.patchlist.present?
if formula.resources.any? { |resource| !resource.name.start_with?("homebrew-") }
@ -149,7 +149,7 @@ module Homebrew
new_mirror ||= determine_mirror(new_url)
new_mirrors ||= [new_mirror] if new_mirror.present?
check_for_mirrors(formula, old_mirrors, new_mirrors, args: args) if new_url.present?
check_for_mirrors(formula, old_mirrors, new_mirrors, args:) if new_url.present?
old_hash = formula_spec.checksum&.hexdigest
new_hash = args.sha256
@ -161,10 +161,10 @@ module Homebrew
old_version = old_formula_version.to_s
forced_version = new_version.present?
new_url_hash = if new_url.present? && new_hash.present?
check_new_version(formula, tap_remote_repo, url: new_url, args: args) if new_version.blank?
check_new_version(formula, tap_remote_repo, url: new_url, args:) if new_version.blank?
true
elsif new_tag.present? && new_revision.present?
check_new_version(formula, tap_remote_repo, url: old_url, tag: new_tag, args: args) if new_version.blank?
check_new_version(formula, tap_remote_repo, url: old_url, tag: new_tag, args:) if new_version.blank?
false
elsif old_hash.blank?
if new_tag.blank? && new_version.blank? && new_revision.blank?
@ -179,7 +179,7 @@ module Homebrew
and old tag are both #{new_tag}.
EOS
end
check_new_version(formula, tap_remote_repo, url: old_url, tag: new_tag, args: args) if new_version.blank?
check_new_version(formula, tap_remote_repo, url: old_url, tag: new_tag, args:) if new_version.blank?
resource_path, forced_version = fetch_resource_and_forced_version(formula, new_version, old_url, tag: new_tag)
new_revision = Utils.popen_read("git", "-C", resource_path.to_s, "rev-parse", "-q", "--verify", "HEAD")
new_revision = new_revision.strip
@ -206,7 +206,7 @@ module Homebrew
#{new_url}
EOS
end
check_new_version(formula, tap_remote_repo, url: new_url, args: args) if new_version.blank?
check_new_version(formula, tap_remote_repo, url: new_url, args:) if new_version.blank?
resource_path, forced_version = fetch_resource_and_forced_version(formula, new_version, new_url)
Utils::Tar.validate_file(resource_path)
new_hash = resource_path.sha256
@ -344,7 +344,7 @@ module Homebrew
ignore_non_pypi_packages: true
end
run_audit(formula, alias_rename, old_contents, args: args)
run_audit(formula, alias_rename, old_contents, args:)
pr_message = "Created with `brew bump-formula-pr`."
if resources_checked.nil? && formula.resources.any? { |resource| !resource.name.start_with?("homebrew-") }
@ -379,18 +379,18 @@ module Homebrew
pr_info = {
sourcefile_path: formula.path,
old_contents: old_contents,
old_contents:,
additional_files: alias_rename,
remote: remote,
remote_branch: remote_branch,
remote:,
remote_branch:,
branch_name: "bump-#{formula.name}-#{new_formula_version}",
commit_message: "#{formula.name} #{new_formula_version}",
previous_branch: previous_branch,
previous_branch:,
tap: formula.tap,
tap_remote_repo: tap_remote_repo,
pr_message: pr_message,
tap_remote_repo:,
pr_message:,
}
GitHub.create_bump_pr(pr_info, args: args)
GitHub.create_bump_pr(pr_info, args:)
end
def determine_mirror(url)
@ -456,7 +456,7 @@ module Homebrew
end
check_throttle(formula, version)
check_closed_pull_requests(formula, tap_remote_repo, args: args, version: version)
check_closed_pull_requests(formula, tap_remote_repo, args:, version:)
end
def check_throttle(formula, new_version)
@ -472,7 +472,7 @@ module Homebrew
def check_closed_pull_requests(formula, tap_remote_repo, args:, version:)
# if we haven't already found open requests, try for an exact match across closed requests
GitHub.check_for_duplicate_pull_requests(formula.name, tap_remote_repo,
version: version,
version:,
state: "closed",
file: formula.path.relative_path_from(formula.tap.path).to_s,
quiet: args.quiet?)

View File

@ -150,14 +150,14 @@ module Homebrew
package_data = if formula_or_cask.is_a?(Formula) && formula_or_cask.versioned_formula?
nil
else
Repology.single_package_query(name, repository: repository)
Repology.single_package_query(name, repository:)
end
retrieve_and_display_info_and_open_pr(
formula_or_cask,
name,
package_data&.values&.first,
args: args,
args:,
ambiguous_cask: ambiguous_casks.include?(formula_or_cask),
)
end
@ -218,8 +218,8 @@ module Homebrew
formula_or_cask,
name,
repositories,
args: args,
ambiguous_cask: ambiguous_cask,
args:,
ambiguous_cask:,
)
end
end
@ -283,7 +283,7 @@ module Homebrew
version_info = Livecheck.latest_version(
formula_or_cask,
referenced_formula_or_cask: referenced_formula_or_cask,
referenced_formula_or_cask:,
json: true, full_name: false, verbose: true, debug: false
)
return "unable to get versions" if version_info.blank?
@ -306,7 +306,7 @@ module Homebrew
def retrieve_pull_requests(formula_or_cask, name, state:, version: nil)
tap_remote_repo = formula_or_cask.tap&.remote_repo || formula_or_cask.tap&.full_name
pull_requests = begin
GitHub.fetch_pull_requests(name, tap_remote_repo, state: state, version: version)
GitHub.fetch_pull_requests(name, tap_remote_repo, state:, version:)
rescue GitHub::API::ValidationFailedError => e
odebug "Error fetching pull requests for #{formula_or_cask} #{name}: #{e}"
nil
@ -340,7 +340,7 @@ module Homebrew
arch_options = is_cask_with_blocks ? OnSystem::ARCH_OPTIONS : [:arm]
arch_options.each do |arch|
SimulateSystem.with arch: arch do
SimulateSystem.with(arch:) do
version_key = is_cask_with_blocks ? arch : :general
# We reload the formula/cask here to ensure we're getting the correct version for the current arch
@ -415,14 +415,14 @@ module Homebrew
end.presence
VersionBumpInfo.new(
type: type,
multiple_versions: multiple_versions,
version_name: version_name,
current_version: current_version,
repology_latest: repology_latest,
new_version: new_version,
open_pull_requests: open_pull_requests,
closed_pull_requests: closed_pull_requests,
type:,
multiple_versions:,
version_name:,
current_version:,
repology_latest:,
new_version:,
open_pull_requests:,
closed_pull_requests:,
)
end
@ -436,10 +436,10 @@ module Homebrew
).void
}
def retrieve_and_display_info_and_open_pr(formula_or_cask, name, repositories, args:, ambiguous_cask: false)
version_info = retrieve_versions_by_arch(formula_or_cask: formula_or_cask,
repositories: repositories,
args: args,
name: name)
version_info = retrieve_versions_by_arch(formula_or_cask:,
repositories:,
args:,
name:)
current_version = version_info.current_version
new_version = version_info.new_version

View File

@ -71,7 +71,7 @@ module Homebrew
# committer details to match the ones on GitHub.
# TODO: Switch to using the GitHub APIs instead of `git log` if
# they ever support trailers.
results[username] = scan_repositories(repos, username, args, from: from)
results[username] = scan_repositories(repos, username, args, from:)
grand_totals[username] = total(results[username])
contributions = contribution_types.filter_map do |type|
@ -85,7 +85,7 @@ module Homebrew
puts [
"#{username} contributed",
*contributions.to_sentence,
"#{time_period(from: from, to: args.to)}.",
"#{time_period(from:, to: args.to)}.",
].join(" ")
end
@ -167,7 +167,7 @@ module Homebrew
data[repo] = {
author: author_commits,
committer: committer_commits,
coauthorship: git_log_trailers_cmd(T.must(repo_path), person, "Co-authored-by", from: from, to: args.to),
coauthorship: git_log_trailers_cmd(T.must(repo_path), person, "Co-authored-by", from:, to: args.to),
review: count_reviews(repo_full_name, person, args),
}
end
@ -203,7 +203,7 @@ module Homebrew
sig { params(repo_full_name: String, person: String, args: Homebrew::CLI::Args).returns(Integer) }
def count_reviews(repo_full_name, person, args)
GitHub.count_issues("", is: "pr", repo: repo_full_name, reviewed_by: person, review: "approved", args: args)
GitHub.count_issues("", is: "pr", repo: repo_full_name, reviewed_by: person, review: "approved", args:)
rescue GitHub::API::ValidationFailedError
if args.verbose?
onoe "Couldn't search GitHub for PRs by #{person}. Their profile might be private. Defaulting to 0."

View File

@ -74,9 +74,9 @@ module Homebrew
args = create_args.parse
path = if args.cask?
create_cask(args: args)
create_cask(args:)
else
create_formula(args: args)
create_formula(args:)
end
exec_editor path
@ -181,7 +181,7 @@ module Homebrew
args.set_version,
tap: args.tap,
url: args.named.first,
mode: mode,
mode:,
license: args.set_license,
fetch: !args.no_fetch?,
head: args.HEAD?,

View File

@ -36,6 +36,6 @@ module Homebrew
Homebrew.forget_user_gem_groups!
end
Homebrew.install_bundler_gems!(groups: groups)
Homebrew.install_bundler_gems!(groups:)
end
end

View File

@ -12,7 +12,7 @@ class String
end
def c(config: nil)
Cask::CaskLoader.load(self, config: config)
Cask::CaskLoader.load(self, config:)
end
end
@ -22,7 +22,7 @@ class Symbol
end
def c(config: nil)
to_s.c(config: config)
to_s.c(config:)
end
end

View File

@ -163,12 +163,12 @@ module Homebrew
package_name = package_file.basename.to_s.chomp(".rb")
odebug "Cherry-picking #{package_file}: #{commit}"
Utils::Git.cherry_pick!(git_repo.to_s, commit, verbose: verbose, resolve: resolve)
Utils::Git.cherry_pick!(git_repo.to_s, commit, verbose:, resolve:)
old_package = Utils::Git.file_at_commit(git_repo.to_s, file, "HEAD^")
new_package = Utils::Git.file_at_commit(git_repo.to_s, file, "HEAD")
bump_subject = determine_bump_subject(old_package, new_package, package_file, reason: reason).strip
bump_subject = determine_bump_subject(old_package, new_package, package_file, reason:).strip
subject, body, trailers = separate_commit_message(git_repo.commit_message)
if subject != bump_subject && !subject.start_with?("#{package_name}:")
@ -214,13 +214,13 @@ module Homebrew
trailers = [trailers + co_author_trailers].flatten.uniq.compact
# Apply the patch series but don't commit anything yet.
Utils::Git.cherry_pick!(git_repo.pathname, "--no-commit", *commits, verbose: verbose, resolve: resolve)
Utils::Git.cherry_pick!(git_repo.pathname, "--no-commit", *commits, verbose:, resolve:)
# Determine the bump subject by comparing the original state of the tree to its current state.
package_file = git_repo.pathname / file
old_package = Utils::Git.file_at_commit(git_repo.pathname, file, "#{commits.first}^")
new_package = package_file.read
bump_subject = determine_bump_subject(old_package, new_package, package_file, reason: reason)
bump_subject = determine_bump_subject(old_package, new_package, package_file, reason:)
# Commit with the new subject, body, and trailers.
safe_system("git", "-C", git_repo.pathname, "commit", "--quiet",
@ -273,14 +273,14 @@ module Homebrew
if files.length == 1 && files_to_commits[files.first].length == 1
# If there's a 1:1 mapping of commits to files, just cherry pick and (maybe) reword.
reword_package_commit(
commit, files.first, git_repo: git_repo, reason: reason, verbose: verbose, resolve: resolve
commit, files.first, git_repo:, reason:, verbose:, resolve:
)
processed_commits << commit
elsif files.length == 1 && files_to_commits[files.first].length > 1
# If multiple commits modify a single file, squash them down into a single commit.
file = files.first
commits = files_to_commits[file]
squash_package_commits(commits, file, git_repo: git_repo, reason: reason, verbose: verbose, resolve: resolve)
squash_package_commits(commits, file, git_repo:, reason:, verbose:, resolve:)
processed_commits += commits
else
# We can't split commits (yet) so just raise an error.
@ -362,7 +362,7 @@ module Homebrew
def self.pr_check_conflicts(repo, pull_request)
long_build_pr_files = GitHub.issues(
repo: repo, state: "open", labels: "no long build conflict",
repo:, state: "open", labels: "no long build conflict",
).each_with_object({}) do |long_build_pr, hash|
next unless long_build_pr.key?("pull_request")
@ -459,15 +459,15 @@ module Homebrew
odebug "Pull request merge-base: #{original_commit}"
unless args.no_commit?
cherry_pick_pr!(user, repo, pr, path: tap.path, args: args) unless args.no_cherry_pick?
cherry_pick_pr!(user, repo, pr, path: tap.path, args:) unless args.no_cherry_pick?
if args.autosquash? && !args.dry_run?
autosquash!(original_commit, tap: tap, cherry_picked: !args.no_cherry_pick?,
autosquash!(original_commit, tap:, cherry_picked: !args.no_cherry_pick?,
verbose: args.verbose?, resolve: args.resolve?, reason: args.message)
end
signoff!(git_repo, pull_request: pr, dry_run: args.dry_run?) unless args.clean?
end
unless formulae_need_bottles?(tap, original_commit, pr_labels, args: args)
unless formulae_need_bottles?(tap, original_commit, pr_labels, args:)
ohai "Skipping artifacts for ##{pr} as the formulae don't need bottles"
next
end

View File

@ -102,7 +102,7 @@ module Homebrew
end
end
rescue Exception => e # rubocop:disable Lint/RescueException
retry if retry_test?(f, args: args)
retry if retry_test?(f, args:)
ofail "#{f.full_name}: failed"
$stderr.puts e, Utils::Backtrace.clean(e)
ensure

View File

@ -41,7 +41,7 @@ module Homebrew
update = args.update? || args.update_all?
groups = update ? Homebrew.valid_gem_groups : ["typecheck"]
Homebrew.install_bundler_gems!(groups: groups)
Homebrew.install_bundler_gems!(groups:)
HOMEBREW_LIBRARY_PATH.cd do
if update

View File

@ -65,7 +65,7 @@ module Homebrew
raise "Unknown arch #{@bottle_tag.arch}."
end
Homebrew::SimulateSystem.with os: os, arch: arch do
Homebrew::SimulateSystem.with(os:, arch:) do
all = args.eval_all?
if args.total?
if !all && !Homebrew::EnvConfig.eval_all?

View File

@ -33,7 +33,7 @@ module Homebrew
members = {
plc: GitHub.members_by_team("Homebrew", "plc"),
tsc: GitHub.members_by_team("Homebrew", "tsc"),
maintainers: maintainers,
maintainers:,
}
sentences = {}

View File

@ -21,7 +21,7 @@ module Homebrew
def self.missing_deps(formulae, hide = nil)
missing = {}
formulae.each do |f|
missing_dependencies = f.missing_dependencies(hide: hide)
missing_dependencies = f.missing_dependencies(hide:)
next if missing_dependencies.empty?
yield f.full_name, missing_dependencies if block_given?

View File

@ -107,7 +107,7 @@ class AbstractDownloadStrategy
UnpackStrategy.detect(cached_location,
prioritize_extension: true,
ref_type: @ref_type, ref: @ref)
.extract_nestedly(basename: basename,
.extract_nestedly(basename:,
prioritize_extension: true,
verbose: verbose? && !quiet?)
chdir(&block) if block
@ -162,7 +162,7 @@ class AbstractDownloadStrategy
end
def silent_command(*args, **options)
system_command(*args, print_stderr: false, env: env, **options)
system_command(*args, print_stderr: false, env:, **options)
end
def command!(*args, **options)
@ -442,7 +442,7 @@ class CurlDownloadStrategy < AbstractFileDownloadStrategy
puts "Already downloaded: #{cached_location}"
else
begin
_fetch(url: url, resolved_url: resolved_url, timeout: Utils::Timer.remaining!(end_time))
_fetch(url:, resolved_url:, timeout: Utils::Timer.remaining!(end_time))
rescue ErrorDuringExecution
raise CurlDownloadStrategyError, url
end
@ -473,7 +473,7 @@ class CurlDownloadStrategy < AbstractFileDownloadStrategy
end
def resolved_time_file_size(timeout: nil)
_, _, time, file_size = resolve_url_basename_time_file_size(url, timeout: timeout)
_, _, time, file_size = resolve_url_basename_time_file_size(url, timeout:)
[time, file_size]
end
@ -489,7 +489,7 @@ class CurlDownloadStrategy < AbstractFileDownloadStrategy
return @resolved_info_cache[url] if @resolved_info_cache.include?(url)
begin
parsed_output = curl_headers(url.to_s, wanted_headers: ["content-disposition"], timeout: timeout)
parsed_output = curl_headers(url.to_s, wanted_headers: ["content-disposition"], timeout:)
rescue ErrorDuringExecution
return [url, parse_basename(url), nil, nil, false]
end
@ -559,7 +559,7 @@ class CurlDownloadStrategy < AbstractFileDownloadStrategy
end
def _curl_download(resolved_url, to, timeout)
curl_download resolved_url, to: to, try_partial: @try_partial, timeout: timeout
curl_download resolved_url, to:, try_partial: @try_partial, timeout:
end
# Curl options to be always passed to curl,
@ -611,7 +611,7 @@ class HomebrewCurlDownloadStrategy < CurlDownloadStrategy
def _curl_download(resolved_url, to, timeout)
raise HomebrewCurlDownloadStrategyError, url unless Formula["curl"].any_version_installed?
curl_download resolved_url, to: to, try_partial: @try_partial, timeout: timeout, use_homebrew_curl: true
curl_download resolved_url, to:, try_partial: @try_partial, timeout:, use_homebrew_curl: true
end
def curl_output(*args, **options)
@ -666,7 +666,7 @@ class CurlApacheMirrorDownloadStrategy < CurlDownloadStrategy
def resolve_url_basename_time_file_size(url, timeout: nil)
if url == self.url
super("#{apache_mirrors["preferred"]}#{apache_mirrors["path_info"]}", timeout: timeout)
super("#{apache_mirrors["preferred"]}#{apache_mirrors["path_info"]}", timeout:)
else
super
end
@ -698,7 +698,7 @@ class CurlPostDownloadStrategy < CurlDownloadStrategy
query.nil? ? [url, "-X", "POST"] : [url, "-d", query]
end
curl_download(*args, to: temporary_path, try_partial: @try_partial, timeout: timeout)
curl_download(*args, to: temporary_path, try_partial: @try_partial, timeout:)
end
end
@ -709,7 +709,7 @@ end
class NoUnzipCurlDownloadStrategy < CurlDownloadStrategy
def stage
UnpackStrategy::Uncompressed.new(cached_location)
.extract(basename: basename,
.extract(basename:,
verbose: verbose? && !quiet?)
yield if block_given?
end
@ -821,18 +821,18 @@ class SubversionDownloadStrategy < VCSDownloadStrategy
def clone_repo(timeout: nil)
case @ref_type
when :revision
fetch_repo cached_location, @url, @ref, timeout: timeout
fetch_repo cached_location, @url, @ref, timeout:
when :revisions
# nil is OK for main_revision, as fetch_repo will then get latest
main_revision = @ref[:trunk]
fetch_repo cached_location, @url, main_revision, ignore_externals: true, timeout: timeout
fetch_repo(cached_location, @url, main_revision, ignore_externals: true, timeout:)
externals do |external_name, external_url|
fetch_repo cached_location/external_name, external_url, @ref[external_name], ignore_externals: true,
timeout: timeout
timeout:
end
else
fetch_repo cached_location, @url, timeout: timeout
fetch_repo cached_location, @url, timeout:
end
end
alias update clone_repo
@ -893,10 +893,10 @@ class GitDownloadStrategy < VCSDownloadStrategy
sig { params(timeout: T.nilable(Time)).void }
def update(timeout: nil)
config_repo
update_repo(timeout: timeout)
checkout(timeout: timeout)
update_repo(timeout:)
checkout(timeout:)
reset
update_submodules(timeout: timeout) if submodules?
update_submodules(timeout:) if submodules?
end
def shallow_dir?
@ -1018,8 +1018,8 @@ class GitDownloadStrategy < VCSDownloadStrategy
configure_sparse_checkout if partial_clone_sparse_checkout?
checkout(timeout: timeout)
update_submodules(timeout: timeout) if submodules?
checkout(timeout:)
update_submodules(timeout:) if submodules?
end
sig { params(timeout: T.nilable(Time)).void }

View File

@ -75,7 +75,7 @@ class Downloadable
raise ArgumentError, "attempted to use a Downloadable without a URL!" if primary_url.blank?
download_strategy.new(primary_url, download_name, version,
mirrors: mirrors, cache: cache, **T.must(@url).specs)
mirrors:, cache:, **T.must(@url).specs)
end
end
@ -84,7 +84,7 @@ class Downloadable
cache.mkpath
begin
downloader.fetch(timeout: timeout)
downloader.fetch(timeout:)
rescue ErrorDuringExecution, CurlDownloadStrategyError => e
raise DownloadError.new(self, e)
end

View File

@ -44,10 +44,10 @@ module EnvActivation
def with_build_environment(env: nil, cc: nil, build_bottle: false, bottle_arch: nil, debug_symbols: false, &_block)
old_env = to_hash.dup
tmp_env = to_hash.dup.extend(EnvActivation)
T.cast(tmp_env, EnvActivation).activate_extensions!(env: env)
T.cast(tmp_env, EnvActivation).activate_extensions!(env:)
T.cast(tmp_env, T.any(Superenv, Stdenv))
.setup_build_environment(cc: cc, build_bottle: build_bottle, bottle_arch: bottle_arch,
debug_symbols: debug_symbols)
.setup_build_environment(cc:, build_bottle:, bottle_arch:,
debug_symbols:)
replace(tmp_env)
begin

View File

@ -55,7 +55,7 @@ module Kernel
end
def oh1(title, truncate: :auto)
puts oh1_title(title, truncate: truncate)
puts oh1_title(title, truncate:)
end
# Print a message prefixed with "Warning" (do this rarely).
@ -156,7 +156,7 @@ module Kernel
end
def odisabled(method, replacement = nil, **options)
options = { disable: true, caller: caller }.merge(options)
options = { disable: true, caller: }.merge(options)
# This odeprecated should stick around indefinitely.
odeprecated(method, replacement, **options)
end
@ -364,8 +364,8 @@ module Kernel
end
# Call this method itself with redirected stdout
redirect_stdout(file) do
return ensure_formula_installed!(formula_or_name, latest: latest,
reason: reason, output_to_stderr: false)
return ensure_formula_installed!(formula_or_name, latest:,
reason:, output_to_stderr: false)
end
end
@ -403,7 +403,7 @@ module Kernel
].compact.first
return executable if executable.exist?
ensure_formula_installed!(formula_name, reason: reason).opt_bin/name
ensure_formula_installed!(formula_name, reason:).opt_bin/name
end
def paths
@ -429,7 +429,7 @@ module Kernel
if ((size * 10).to_i % 10).zero?
"#{size.to_i}#{unit}"
else
"#{format("%<size>.1f", size: size)}#{unit}"
"#{format("%<size>.1f", size:)}#{unit}"
end
end

View File

@ -4,8 +4,8 @@
module Stdenv
def setup_build_environment(formula: nil, cc: nil, build_bottle: false, bottle_arch: nil, testing_formula: false,
debug_symbols: false)
generic_setup_build_environment(formula: formula, cc: cc, build_bottle: build_bottle, bottle_arch: bottle_arch,
testing_formula: testing_formula, debug_symbols: debug_symbols)
generic_setup_build_environment(formula:, cc:, build_bottle:, bottle_arch:,
testing_formula:, debug_symbols:)
prepend_path "CPATH", HOMEBREW_PREFIX/"include"
prepend_path "LIBRARY_PATH", HOMEBREW_PREFIX/"lib"

View File

@ -15,8 +15,8 @@ module Superenv
# @private
def setup_build_environment(formula: nil, cc: nil, build_bottle: false, bottle_arch: nil, testing_formula: false,
debug_symbols: false)
generic_setup_build_environment(formula: formula, cc: cc, build_bottle: build_bottle, bottle_arch: bottle_arch,
testing_formula: testing_formula, debug_symbols: debug_symbols)
generic_setup_build_environment(formula:, cc:, build_bottle:, bottle_arch:,
testing_formula:, debug_symbols:)
self["HOMEBREW_OPTIMIZATION_LEVEL"] = "O2"
self["HOMEBREW_DYNAMIC_LINKER"] = determine_dynamic_linker_path
self["HOMEBREW_RPATH_PATHS"] = determine_rpath_paths(@formula)

View File

@ -31,7 +31,7 @@ module Homebrew
private_constant :GCC_RUNTIME_LIBS
def self.perform_preinstall_checks(all_fatal: false, cc: nil)
generic_perform_preinstall_checks(all_fatal: all_fatal, cc: cc)
generic_perform_preinstall_checks(all_fatal:, cc:)
symlink_ld_so
setup_preferred_gcc_libs
end

View File

@ -29,7 +29,7 @@ class LinkageChecker
private
def check_dylibs(rebuild_cache:)
generic_check_dylibs(rebuild_cache: rebuild_cache)
generic_check_dylibs(rebuild_cache:)
# glibc and gcc are implicit dependencies.
# No other linkage to system libraries is expected or desired.

View File

@ -14,9 +14,9 @@ module SharedEnvExtension
}
def setup_build_environment(formula: nil, cc: nil, build_bottle: false, bottle_arch: nil, testing_formula: false,
debug_symbols: false)
generic_shared_setup_build_environment(formula: formula, cc: cc, build_bottle: build_bottle,
bottle_arch: bottle_arch, testing_formula: testing_formula,
debug_symbols: debug_symbols)
generic_shared_setup_build_environment(formula:, cc:, build_bottle:,
bottle_arch:, testing_formula:,
debug_symbols:)
# Normalise the system Perl version used, where multiple may be available
self["VERSIONER_PERL_VERSION"] = MacOS.preferred_perl_version

View File

@ -12,8 +12,8 @@ module Stdenv
def setup_build_environment(formula: nil, cc: nil, build_bottle: false, bottle_arch: nil, testing_formula: false,
debug_symbols: false)
generic_setup_build_environment(formula: formula, cc: cc, build_bottle: build_bottle, bottle_arch: bottle_arch,
testing_formula: testing_formula, debug_symbols: debug_symbols)
generic_setup_build_environment(formula:, cc:, build_bottle:, bottle_arch:,
testing_formula:, debug_symbols:)
append "LDFLAGS", "-Wl,-headerpad_max_install_names"
@ -23,7 +23,7 @@ module Stdenv
self["LC_CTYPE"] = "C"
# Add lib and include etc. from the current macosxsdk to compiler flags:
macosxsdk(formula: @formula, testing_formula: testing_formula)
macosxsdk(formula: @formula, testing_formula:)
return unless MacOS::Xcode.without_clt?

View File

@ -99,8 +99,8 @@ module Superenv
MacOS::CLT::PKG_PATH
end
generic_setup_build_environment(formula: formula, cc: cc, build_bottle: build_bottle, bottle_arch: bottle_arch,
testing_formula: testing_formula, debug_symbols: debug_symbols)
generic_setup_build_environment(formula:, cc:, build_bottle:, bottle_arch:,
testing_formula:, debug_symbols:)
# Filter out symbols known not to be defined since GNU Autotools can't
# reliably figure this out with Xcode 8 and above.

View File

@ -18,8 +18,8 @@ class Formula
).returns(T::Array[String])
}
def std_cmake_args(install_prefix: prefix, install_libdir: "lib", find_framework: "LAST")
args = generic_std_cmake_args(install_prefix: install_prefix, install_libdir: install_libdir,
find_framework: find_framework)
args = generic_std_cmake_args(install_prefix:, install_libdir:,
find_framework:)
# Avoid false positives for clock_gettime support on 10.11.
# CMake cache entries for other weak symbols may be added here as needed.

View File

@ -133,7 +133,7 @@ class Keg
VARIABLE_REFERENCE_RX = /^@(loader_|executable_|r)path/
def each_linkage_for(file, linkage_type, resolve_variable_references: false, &block)
file.public_send(linkage_type, resolve_variable_references: resolve_variable_references)
file.public_send(linkage_type, resolve_variable_references:)
.grep_v(VARIABLE_REFERENCE_RX)
.each(&block)
end

View File

@ -17,7 +17,7 @@ module UnpackStrategy
# (Also, Homebrew's ZIP artifact automatically deletes this folder.)
return system_command! "ditto",
args: ["-x", "-k", path, unpack_dir],
verbose: verbose,
verbose:,
print_stderr: false
end
@ -26,9 +26,9 @@ module UnpackStrategy
rescue ErrorDuringExecution => e
raise unless e.stderr.include?("End-of-central-directory signature not found.")
system_command! "ditto",
system_command!("ditto",
args: ["-x", "-k", path, unpack_dir],
verbose: verbose
verbose:)
nil
end
@ -45,12 +45,12 @@ module UnpackStrategy
# `ditto` keeps Finder attributes intact and does not skip volume labels
# like `unzip` does, which can prevent disk images from being unzipped.
system_command! "ditto",
system_command!("ditto",
args: ["-x", "-k", path, tmp_unpack_dir],
verbose: verbose
verbose:)
volumes.each do |volume|
FileUtils.mv tmp_unpack_dir/volume, unpack_dir/volume, verbose: verbose
FileUtils.mv tmp_unpack_dir/volume, unpack_dir/volume, verbose:
end
end
end

View File

@ -1408,7 +1408,7 @@ class Formula
def brew(fetch: true, keep_tmp: false, debug_symbols: false, interactive: false)
@prefix_returns_versioned_prefix = true
active_spec.fetch if fetch
stage(interactive: interactive, debug_symbols: debug_symbols) do |staging|
stage(interactive:, debug_symbols:) do |staging|
staging.retain! if keep_tmp || debug_symbols
prepare_patches
@ -1505,7 +1505,7 @@ class Formula
end
if current_version ||
((head_version = latest_head_version) && !head_version_outdated?(head_version, fetch_head: fetch_head))
((head_version = latest_head_version) && !head_version_outdated?(head_version, fetch_head:))
[]
else
all_kegs += old_installed_formulae.flat_map(&:installed_kegs)
@ -1564,7 +1564,7 @@ class Formula
# @private
sig { params(fetch_head: T::Boolean).returns(T::Boolean) }
def outdated?(fetch_head: false)
!outdated_kegs(fetch_head: fetch_head).empty?
!outdated_kegs(fetch_head:).empty?
rescue Migrator::MigrationNeededError
true
end
@ -2077,14 +2077,14 @@ class Formula
# @private
def recursive_dependencies(&block)
cache_key = "Formula#recursive_dependencies" unless block
Dependency.expand(self, cache_key: cache_key, &block)
Dependency.expand(self, cache_key:, &block)
end
# The full set of Requirements for this formula's dependency tree.
# @private
def recursive_requirements(&block)
cache_key = "Formula#recursive_requirements" unless block
Requirement.expand(self, cache_key: cache_key, &block)
Requirement.expand(self, cache_key:, &block)
end
# Returns a Keg for the opt_prefix or installed_prefix if they exist.
@ -2140,8 +2140,8 @@ class Formula
Formula.cache[:runtime_formula_dependencies] ||= {}
Formula.cache[:runtime_formula_dependencies][cache_key] ||= runtime_dependencies(
read_from_tab: read_from_tab,
undeclared: undeclared,
read_from_tab:,
undeclared:,
).filter_map do |d|
d.to_formula
rescue FormulaUnavailableError
@ -2198,7 +2198,7 @@ class Formula
all_dependables.map do |dependable|
{
dependable: dependable,
dependable:,
# Now find the list of specs each dependency was a part of.
specs: dependables.filter_map { |spec, spec_deps| spec if spec_deps&.include?(dependable) },
}
@ -2384,15 +2384,15 @@ class Formula
if path.exist? && on_system_blocks_exist?
formula_contents = path.read
OnSystem::ALL_OS_ARCH_COMBINATIONS.each do |os, arch|
bottle_tag = Utils::Bottles::Tag.new(system: os, arch: arch)
bottle_tag = Utils::Bottles::Tag.new(system: os, arch:)
next unless bottle_tag.valid_combination?
Homebrew::SimulateSystem.with os: os, arch: arch do
Homebrew::SimulateSystem.with(os:, arch:) do
variations_namespace = Formulary.class_s("#{namespace_prefix}#{bottle_tag.to_sym.capitalize}")
variations_formula_class = Formulary.load_formula(name, path, formula_contents, variations_namespace,
flags: self.class.build_flags, ignore_errors: true)
variations_formula = variations_formula_class.new(name, path, :stable,
alias_path: alias_path, force_bottle: force_bottle)
alias_path:, force_bottle:)
variations_formula.public_send(hash_method).each do |key, value|
next if value.to_s == hash[key].to_s
@ -2563,7 +2563,7 @@ class Formula
# @private
def fetch(verify_download_integrity: true)
active_spec.fetch(verify_download_integrity: verify_download_integrity)
active_spec.fetch(verify_download_integrity:)
end
# @private
@ -2661,7 +2661,7 @@ class Formula
).void
}
def inreplace(paths, before = nil, after = nil, audit_result = true, &block) # rubocop:disable Style/OptionalBooleanParameter
Utils::Inreplace.inreplace(paths, before, after, audit_result: audit_result, &block)
Utils::Inreplace.inreplace(paths, before, after, audit_result:, &block)
rescue Utils::Inreplace::Error => e
onoe e.to_s
raise BuildError.new(self, "inreplace", Array(paths), {})
@ -2686,7 +2686,7 @@ class Formula
# @private
def declared_runtime_dependencies
cache_key = "Formula#declared_runtime_dependencies" unless build.any_args_or_options?
Dependency.expand(self, cache_key: cache_key) do |_, dependency|
Dependency.expand(self, cache_key:) do |_, dependency|
Dependency.prune if dependency.build?
next if dependency.required?
@ -2984,7 +2984,7 @@ class Formula
end
def stage(interactive: false, debug_symbols: false)
active_spec.stage(debug_symbols: debug_symbols) do |staging|
active_spec.stage(debug_symbols:) do |staging|
@source_modified_time = active_spec.source_modified_time
@buildpath = Pathname.pwd
env_home = T.must(buildpath)/".brew_home"

View File

@ -566,7 +566,7 @@ module Homebrew
user_agents: [:browser, :default],
check_content: true,
strict: @strict,
use_homebrew_curl: use_homebrew_curl,
use_homebrew_curl:,
))
problem http_content_problem
end
@ -693,7 +693,7 @@ module Homebrew
ra = ResourceAuditor.new(
spec, spec_name,
online: @online, strict: @strict, only: @only, except: except,
online: @online, strict: @strict, only: @only, except:,
use_homebrew_curl: spec.using == :homebrew_curl
).audit
ra.problems.each do |message|
@ -782,7 +782,7 @@ module Homebrew
tag ||= stable.version
if @online
error = SharedAudits.gitlab_release(owner, repo, tag, formula: formula)
error = SharedAudits.gitlab_release(owner, repo, tag, formula:)
problem error if error
end
when %r{^https://github.com/([\w-]+)/([\w-]+)}
@ -792,7 +792,7 @@ module Homebrew
tag ||= formula.stable.specs[:tag]
if @online
error = SharedAudits.github_release(owner, repo, tag, formula: formula)
error = SharedAudits.github_release(owner, repo, tag, formula:)
problem error if error
end
end
@ -956,11 +956,11 @@ module Homebrew
private
def problem(message, location: nil, corrected: false)
@problems << ({ message: message, location: location, corrected: corrected })
@problems << ({ message:, location:, corrected: })
end
def new_formula_problem(message, location: nil, corrected: false)
@new_formula_problems << ({ message: message, location: location, corrected: corrected })
@new_formula_problems << ({ message:, location:, corrected: })
end
def head_only?(formula)
@ -976,7 +976,7 @@ module Homebrew
return false if variations.blank?
MacOSVersion::SYMBOLS.keys.product(OnSystem::ARCH_OPTIONS).each do |os, arch|
bottle_tag = Utils::Bottles::Tag.new(system: os, arch: arch)
bottle_tag = Utils::Bottles::Tag.new(system: os, arch:)
next unless bottle_tag.valid_combination?
variation_dependencies = variations.dig(bottle_tag.to_sym, "dependencies")

View File

@ -420,7 +420,7 @@ class FormulaInstaller
if (tap = formula.tap) && tap.should_report_analytics?
Utils::Analytics.report_package_event(:formula_install, package_name: formula.name, tap_name: tap.name,
on_request: installed_on_request?, options: options)
on_request: installed_on_request?, options:)
end
self.class.attempted << formula
@ -597,7 +597,7 @@ on_request: installed_on_request?, options: options)
def expand_dependencies_for_formula(formula, inherited_options)
# Cache for this expansion only. FormulaInstaller has a lot of inputs which can alter expansion.
cache_key = "FormulaInstaller-#{formula.full_name}-#{Time.now.to_f}"
Dependency.expand(formula, cache_key: cache_key) do |dependent, dep|
Dependency.expand(formula, cache_key:) do |dependent, dep|
inherited_options[dep.name] |= inherited_options_for(dep)
build = effective_build_options_for(
dependent,
@ -732,7 +732,7 @@ on_request: installed_on_request?, options: options)
fi = FormulaInstaller.new(
df,
options: options,
options:,
link_keg: keg_had_linked_keg ? keg_was_linked : nil,
installed_as_dependency: true,
installed_on_request: df.any_version_installed? && tab.present? && tab.installed_on_request,
@ -1280,7 +1280,7 @@ on_request: installed_on_request?, options: options)
keg = Keg.new(formula.prefix)
skip_linkage = formula.bottle_specification.skip_relocation?
keg.replace_placeholders_with_locations tab.changed_files, skip_linkage: skip_linkage
keg.replace_placeholders_with_locations(tab.changed_files, skip_linkage:)
cellar = formula.bottle_specification.tag_to_cellar(Utils::Bottles.tag)
return if [:any, :any_skip_relocation].include?(cellar)

View File

@ -145,7 +145,7 @@ module Formulary
def self.load_formula_from_path(name, path, flags:, ignore_errors:)
contents = path.open("r") { |f| ensure_utf8_encoding(f).read }
namespace = "FormulaNamespace#{namespace_key(path.to_s)}"
klass = load_formula(name, path, contents, namespace, flags: flags, ignore_errors: ignore_errors)
klass = load_formula(name, path, contents, namespace, flags:, ignore_errors:)
platform_cache[:path] ||= {}
platform_cache[:path][path] = klass
end
@ -305,7 +305,7 @@ module Formulary
rebuild bottles_stable["rebuild"]
bottles_stable["files"].each do |tag, bottle_spec|
cellar = Formulary.convert_to_string_or_symbol bottle_spec["cellar"]
sha256 cellar: cellar, tag.to_sym => bottle_spec["sha256"]
sha256 cellar:, tag.to_sym => bottle_spec["sha256"]
end
end
end
@ -434,8 +434,8 @@ module Formulary
flags: T.unsafe(nil)
)
options = {
force_bottle: force_bottle,
flags: flags,
force_bottle:,
flags:,
}.compact
if name.include?("/") || File.exist?(name)
@ -523,12 +523,12 @@ module Formulary
# a formula that was loaded in another way.
def get_formula(spec, alias_path: nil, force_bottle: false, flags: [], ignore_errors: false)
alias_path ||= self.alias_path
klass(flags: flags, ignore_errors: ignore_errors)
.new(name, path, spec, alias_path: alias_path, tap: tap, force_bottle: force_bottle)
klass(flags:, ignore_errors:)
.new(name, path, spec, alias_path:, tap:, force_bottle:)
end
def klass(flags:, ignore_errors:)
load_file(flags: flags, ignore_errors: ignore_errors) unless Formulary.formula_class_defined_from_path?(path)
load_file(flags:, ignore_errors:) unless Formulary.formula_class_defined_from_path?(path)
Formulary.formula_class_get_from_path(path)
end
@ -537,7 +537,7 @@ module Formulary
def load_file(flags:, ignore_errors:)
raise FormulaUnavailableError, name unless path.file?
Formulary.load_formula_from_path(name, path, flags: flags, ignore_errors: ignore_errors)
Formulary.load_formula_from_path(name, path, flags:, ignore_errors:)
end
end
@ -574,9 +574,9 @@ module Formulary
def get_formula(spec, force_bottle: false, flags: [], ignore_errors: false, **)
formula = begin
contents = Utils::Bottles.formula_contents @bottle_filename, name: name
Formulary.from_contents(name, path, contents, spec, force_bottle: force_bottle,
flags: flags, ignore_errors: ignore_errors)
contents = Utils::Bottles.formula_contents(@bottle_filename, name:)
Formulary.from_contents(name, path, contents, spec, force_bottle:,
flags:, ignore_errors:)
rescue FormulaUnreadableError => e
opoo <<~EOS
Unreadable formula in #{@bottle_filename}:
@ -620,18 +620,18 @@ module Formulary
path = alias_path.resolved_path
{
alias_path: alias_path,
tap: tap,
alias_path:,
tap:,
}
else
{
tap: tap,
tap:,
}
end
elsif (tap = Homebrew::API.tap_from_source_download(path))
# Don't treat cache symlinks as aliases.
{
tap: tap,
tap:,
}
else
{}
@ -651,7 +651,7 @@ module Formulary
options = {
alias_path: (alias_path if alias_dir == tap&.alias_dir),
tap: tap,
tap:,
}.compact
super(name, path, **options)
@ -667,7 +667,7 @@ module Formulary
def self.try_new(ref, from: T.unsafe(nil), warn: false)
ref = ref.to_s
new(ref, from: from) if URL_START_REGEX.match?(ref)
new(ref, from:) if URL_START_REGEX.match?(ref)
end
attr_reader :url
@ -722,7 +722,7 @@ module Formulary
def self.try_new(ref, from: T.unsafe(nil), warn: false)
ref = ref.to_s
return unless (name_tap_type = Formulary.tap_formula_name_type(ref, warn: warn))
return unless (name_tap_type = Formulary.tap_formula_name_type(ref, warn:))
name, tap, type = name_tap_type
path = Formulary.find_formula_in_tap(name, tap)
@ -734,14 +734,14 @@ module Formulary
{}
end
new(name, path, tap: tap, **options)
new(name, path, tap:, **options)
end
sig { params(name: String, path: Pathname, tap: Tap, alias_name: String).void }
def initialize(name, path, tap:, alias_name: T.unsafe(nil))
options = {
alias_path: (tap.alias_dir/alias_name if alias_name),
tap: tap,
tap:,
}.compact
super(name, path, **options)
@ -779,12 +779,12 @@ module Formulary
# If it exists in the default tap, never treat it as ambiguous with another tap.
if (core_tap = CoreTap.instance).installed? &&
(loader = super("#{core_tap}/#{name}", warn: warn))&.path&.exist?
(loader = super("#{core_tap}/#{name}", warn:))&.path&.exist?
return loader
end
loaders = Tap.select { |tap| tap.installed? && !tap.core_tap? }
.filter_map { |tap| super("#{tap}/#{name}", warn: warn) }
.filter_map { |tap| super("#{tap}/#{name}", warn:) }
.select { |tap| tap.path.exist? }
case loaders.count
@ -861,7 +861,7 @@ module Formulary
def klass(flags:, ignore_errors:)
namespace = "FormulaNamespace#{Digest::MD5.hexdigest(contents.to_s)}"
Formulary.load_formula(name, path, contents, namespace, flags: flags, ignore_errors: ignore_errors)
Formulary.load_formula(name, path, contents, namespace, flags:, ignore_errors:)
end
end
@ -885,7 +885,7 @@ module Formulary
ref = "#{CoreTap.instance}/#{name}"
return unless (name_tap_type = Formulary.tap_formula_name_type(ref, warn: warn))
return unless (name_tap_type = Formulary.tap_formula_name_type(ref, warn:))
name, tap, type = name_tap_type
@ -895,28 +895,28 @@ module Formulary
{}
end
new(name, tap: tap, **options)
new(name, tap:, **options)
end
sig { params(name: String, tap: Tap, alias_name: String).void }
def initialize(name, tap: T.unsafe(nil), alias_name: T.unsafe(nil))
options = {
alias_path: (CoreTap.instance.alias_dir/alias_name if alias_name),
tap: tap,
tap:,
}.compact
super(name, Formulary.core_path(name), **options)
end
def klass(flags:, ignore_errors:)
load_from_api(flags: flags) unless Formulary.formula_class_defined_from_api?(name)
load_from_api(flags:) unless Formulary.formula_class_defined_from_api?(name)
Formulary.formula_class_get_from_api(name)
end
private
def load_from_api(flags:)
Formulary.load_formula_from_api(name, flags: flags)
Formulary.load_formula_from_api(name, flags:)
end
end
@ -954,11 +954,11 @@ module Formulary
return platform_cache[:formulary_factory][cache_key]
end
loader_options = { from: from, warn: warn }.compact
formula_options = { alias_path: alias_path,
force_bottle: force_bottle,
flags: flags,
ignore_errors: ignore_errors }.compact
loader_options = { from:, warn: }.compact
formula_options = { alias_path:,
force_bottle:,
flags:,
ignore_errors: }.compact
formula = loader_for(ref, **loader_options)
.get_formula(spec, **formula_options)
@ -997,9 +997,9 @@ module Formulary
keg = kegs.find(&:linked?) || kegs.find(&:optlinked?) || kegs.max_by(&:version)
options = {
alias_path: alias_path,
force_bottle: force_bottle,
flags: flags,
alias_path:,
force_bottle:,
flags:,
}.compact
if keg
@ -1041,11 +1041,11 @@ module Formulary
formula_name = keg.rack.basename.to_s
options = {
alias_path: alias_path,
alias_path:,
from: :keg,
warn: false,
force_bottle: force_bottle,
flags: flags,
force_bottle:,
flags:,
}.compact
f = if tap.nil?
@ -1088,10 +1088,10 @@ module Formulary
ignore_errors: T.unsafe(nil)
)
options = {
alias_path: alias_path,
force_bottle: force_bottle,
flags: flags,
ignore_errors: ignore_errors,
alias_path:,
force_bottle:,
flags:,
ignore_errors:,
}.compact
FormulaContentsLoader.new(name, path, contents).get_formula(spec, **options)
end
@ -1166,7 +1166,7 @@ module Formulary
end
def self.loader_for(ref, from: T.unsafe(nil), warn: true)
options = { from: from, warn: warn }.compact
options = { from:, warn: }.compact
[
FromBottleLoader,

View File

@ -38,14 +38,14 @@ class GitRepository
# Gets the full commit hash of the HEAD commit.
sig { params(safe: T::Boolean).returns(T.nilable(String)) }
def head_ref(safe: false)
popen_git("rev-parse", "--verify", "--quiet", "HEAD", safe: safe)
popen_git("rev-parse", "--verify", "--quiet", "HEAD", safe:)
end
# Gets a short commit hash of the HEAD commit.
sig { params(length: T.nilable(Integer), safe: T::Boolean).returns(T.nilable(String)) }
def short_head_ref(length: nil, safe: false)
short_arg = length.present? ? "--short=#{length}" : "--short"
popen_git("rev-parse", short_arg, "--verify", "--quiet", "HEAD", safe: safe)
popen_git("rev-parse", short_arg, "--verify", "--quiet", "HEAD", safe:)
end
# Gets the relative date of the last commit, e.g. "1 hour ago"
@ -57,7 +57,7 @@ class GitRepository
# Gets the name of the currently checked-out branch, or HEAD if the repository is in a detached HEAD state.
sig { params(safe: T::Boolean).returns(T.nilable(String)) }
def branch_name(safe: false)
popen_git("rev-parse", "--abbrev-ref", "HEAD", safe: safe)
popen_git("rev-parse", "--abbrev-ref", "HEAD", safe:)
end
# Change the name of a local branch
@ -104,7 +104,7 @@ class GitRepository
# Gets the full commit message of the specified commit, or of the HEAD commit if unspecified.
sig { params(commit: String, safe: T::Boolean).returns(T.nilable(String)) }
def commit_message(commit = "HEAD", safe: false)
popen_git("log", "-1", "--pretty=%B", commit, "--", safe: safe, err: :out)&.strip
popen_git("log", "-1", "--pretty=%B", commit, "--", safe:, err: :out)&.strip
end
sig { returns(String) }
@ -128,6 +128,6 @@ class GitRepository
raise "Git is unavailable"
end
Utils.popen_read(Utils::Git.git, *args, safe: safe, chdir: pathname, err: err).chomp.presence
Utils.popen_read(Utils::Git.git, *args, safe:, chdir: pathname, err:).chomp.presence
end
end

View File

@ -67,7 +67,7 @@ class GitHubPackages
bottles_hash.each do |formula_full_name, bottle_hash|
# First, check that we won't encounter an error in the middle of uploading bottles.
preupload_check(user, token, skopeo, formula_full_name, bottle_hash,
keep_old: keep_old, dry_run: dry_run, warn_on_error: warn_on_error)
keep_old:, dry_run:, warn_on_error:)
end
# We intentionally iterate over `bottles_hash` twice to
@ -76,7 +76,7 @@ class GitHubPackages
bottles_hash.each do |formula_full_name, bottle_hash|
# Next, upload the bottles after checking them all.
upload_bottle(user, token, skopeo, formula_full_name, bottle_hash,
keep_old: keep_old, dry_run: dry_run, warn_on_error: warn_on_error)
keep_old:, dry_run:, warn_on_error:)
end
# rubocop:enable Style/CombinableLoops
end
@ -207,7 +207,7 @@ class GitHubPackages
puts "#{skopeo} #{args.join(" ")} --src-creds=#{user}:$HOMEBREW_GITHUB_PACKAGES_TOKEN"
else
args << "--src-creds=#{user}:#{token}"
system_command!(skopeo, verbose: true, print_stdout: true, args: args)
system_command!(skopeo, verbose: true, print_stdout: true, args:)
end
end
@ -263,7 +263,7 @@ class GitHubPackages
def upload_bottle(user, token, skopeo, formula_full_name, bottle_hash, keep_old:, dry_run:, warn_on_error:)
# We run the preupload check twice to prevent TOCTOU bugs.
result = preupload_check(user, token, skopeo, formula_full_name, bottle_hash,
keep_old: keep_old, dry_run: dry_run, warn_on_error: warn_on_error)
keep_old:, dry_run:, warn_on_error:)
formula_name, org, repo, version, rebuild, version_rebuild, image_name, image_uri, keep_old = *result
@ -272,7 +272,7 @@ class GitHubPackages
root.mkpath
if keep_old
download(user, token, skopeo, image_uri, root, dry_run: dry_run)
download(user, token, skopeo, image_uri, root, dry_run:)
else
write_image_layout(root)
end
@ -368,8 +368,8 @@ class GitHubPackages
end
platform_hash = {
architecture: architecture,
os: os,
architecture:,
os:,
"os.version" => os_version,
}.compact_blank
@ -446,7 +446,7 @@ class GitHubPackages
args << "--dest-creds=#{user}:#{token}"
retry_count = 0
begin
system_command!(skopeo, verbose: true, print_stdout: true, args: args)
system_command!(skopeo, verbose: true, print_stdout: true, args:)
rescue ErrorDuringExecution
retry_count += 1
odie "Cannot perform an upload to registry after retrying multiple times!" if retry_count >= 10
@ -486,8 +486,8 @@ class GitHubPackages
def write_image_index(manifests, blobs, annotations)
image_index = {
schemaVersion: 2,
manifests: manifests,
annotations: annotations,
manifests:,
annotations:,
}
validate_schema!(IMAGE_INDEX_SCHEMA_URI, image_index)
write_hash(blobs, image_index)
@ -500,7 +500,7 @@ class GitHubPackages
mediaType: "application/vnd.oci.image.index.v1+json",
digest: "sha256:#{index_json_sha256}",
size: index_json_size,
annotations: annotations,
annotations:,
}],
}
validate_schema!(IMAGE_INDEX_SCHEMA_URI, index_json)

View File

@ -34,7 +34,7 @@ class GitHubReleases
remote_file = tag_hash["filename"]
local_file = tag_hash["local_filename"]
odebug "Uploading #{remote_file}"
GitHub.upload_release_asset user, repo, release["id"], local_file: local_file, remote_file: remote_file
GitHub.upload_release_asset user, repo, release["id"], local_file:, remote_file:
end
end
end

View File

@ -100,7 +100,7 @@ class GitHubRunnerMatrix
raise "Unexpected platform: #{platform}" if VALID_PLATFORMS.exclude?(platform)
raise "Unexpected arch: #{arch}" if VALID_ARCHES.exclude?(arch)
runner = GitHubRunner.new(platform: platform, arch: arch, spec: spec, macos_version: macos_version)
runner = GitHubRunner.new(platform:, arch:, spec:, macos_version:)
runner.active = active_runner?(runner)
runner.freeze
end
@ -147,7 +147,7 @@ class GitHubRunnerMatrix
spec = MacOSRunnerSpec.new(
name: "macOS #{version}-x86_64",
runner: runner,
runner:,
timeout: runner_timeout,
cleanup: !runner.end_with?(ephemeral_suffix),
)
@ -167,7 +167,7 @@ class GitHubRunnerMatrix
runner_timeout /= 2 if runner_timeout < GITHUB_ACTIONS_LONG_TIMEOUT
spec = MacOSRunnerSpec.new(
name: "macOS #{version}-arm64",
runner: runner,
runner:,
timeout: runner_timeout,
cleanup: !runner.end_with?(ephemeral_suffix),
)
@ -214,7 +214,7 @@ class GitHubRunnerMatrix
next false unless formula.public_send(:"#{arch}_compatible?")
next false if macos_version.present? && !formula.compatible_with?(macos_version)
compatible_dependents = formula.dependents(platform: platform, arch: arch, macos_version: macos_version&.to_sym)
compatible_dependents = formula.dependents(platform:, arch:, macos_version: macos_version&.to_sym)
.dup
compatible_dependents.select! do |dependent_f|

View File

@ -59,7 +59,7 @@ module Homebrew
# Display command-specific (or generic) help in response to `UsageError`.
if usage_error
$stderr.puts path ? command_help(cmd, path, remaining_args: remaining_args) : HOMEBREW_HELP
$stderr.puts path ? command_help(cmd, path, remaining_args:) : HOMEBREW_HELP
$stderr.puts
onoe usage_error
exit 1
@ -69,7 +69,7 @@ module Homebrew
return if path.nil?
# Display help for internal command (or generic help if undocumented).
puts command_help(cmd, path, remaining_args: remaining_args)
puts command_help(cmd, path, remaining_args:)
exit 0
end
@ -78,7 +78,7 @@ module Homebrew
output = if Commands.valid_internal_cmd?(cmd) ||
Commands.valid_internal_dev_cmd?(cmd) ||
Commands.external_ruby_v2_cmd_path(cmd)
parser_help(path, remaining_args: remaining_args)
parser_help(path, remaining_args:)
end
output ||= comment_help(path)

View File

@ -78,7 +78,7 @@ module Homebrew
installed_head_version = formula.latest_head_version
if installed_head_version &&
!formula.head_version_outdated?(installed_head_version, fetch_head: fetch_head)
!formula.head_version_outdated?(installed_head_version, fetch_head:)
new_head_installed = true
end
prefix_installed = formula.prefix.exist? && !formula.prefix.children.empty?
@ -245,30 +245,30 @@ module Homebrew
skip_post_install: false
)
formula_installers = formulae_to_install.filter_map do |formula|
Migrator.migrate_if_needed(formula, force: force, dry_run: dry_run)
Migrator.migrate_if_needed(formula, force:, dry_run:)
build_options = formula.build
formula_installer = FormulaInstaller.new(
formula,
options: build_options.used_options,
build_bottle: build_bottle,
force_bottle: force_bottle,
bottle_arch: bottle_arch,
ignore_deps: ignore_deps,
only_deps: only_deps,
include_test_formulae: include_test_formulae,
build_from_source_formulae: build_from_source_formulae,
cc: cc,
git: git,
interactive: interactive,
keep_tmp: keep_tmp,
debug_symbols: debug_symbols,
force: force,
overwrite: overwrite,
debug: debug,
quiet: quiet,
verbose: verbose,
skip_post_install: skip_post_install,
build_bottle:,
force_bottle:,
bottle_arch:,
ignore_deps:,
only_deps:,
include_test_formulae:,
build_from_source_formulae:,
cc:,
git:,
interactive:,
keep_tmp:,
debug_symbols:,
force:,
overwrite:,
debug:,
quiet:,
verbose:,
skip_post_install:,
)
begin
@ -355,7 +355,7 @@ module Homebrew
upgrade = formula.linked? && formula.outdated? && !formula.head? && !Homebrew::EnvConfig.no_install_upgrade?
Upgrade.install_formula(formula_installer, upgrade: upgrade)
Upgrade.install_formula(formula_installer, upgrade:)
end
end
end

View File

@ -408,16 +408,16 @@ class Keg
ObserverPathnameExtension.reset_counts!
optlink(verbose: verbose, dry_run: dry_run, overwrite: overwrite) unless dry_run
optlink(verbose:, dry_run:, overwrite:) unless dry_run
# yeah indeed, you have to force anything you need in the main tree into
# these dirs REMEMBER that *NOT* everything needs to be in the main tree
link_dir("etc", verbose: verbose, dry_run: dry_run, overwrite: overwrite) { :mkpath }
link_dir("bin", verbose: verbose, dry_run: dry_run, overwrite: overwrite) { :skip_dir }
link_dir("sbin", verbose: verbose, dry_run: dry_run, overwrite: overwrite) { :skip_dir }
link_dir("include", verbose: verbose, dry_run: dry_run, overwrite: overwrite) { :link }
link_dir("etc", verbose:, dry_run:, overwrite:) { :mkpath }
link_dir("bin", verbose:, dry_run:, overwrite:) { :skip_dir }
link_dir("sbin", verbose:, dry_run:, overwrite:) { :skip_dir }
link_dir("include", verbose:, dry_run:, overwrite:) { :link }
link_dir("share", verbose: verbose, dry_run: dry_run, overwrite: overwrite) do |relative_path|
link_dir("share", verbose:, dry_run:, overwrite:) do |relative_path|
case relative_path.to_s
when INFOFILE_RX then :info
when "locale/locale.alias",
@ -436,7 +436,7 @@ class Keg
end
end
link_dir("lib", verbose: verbose, dry_run: dry_run, overwrite: overwrite) do |relative_path|
link_dir("lib", verbose:, dry_run:, overwrite:) do |relative_path|
case relative_path.to_s
when "charset.alias"
:skip_file
@ -462,7 +462,7 @@ class Keg
end
end
link_dir("Frameworks", verbose: verbose, dry_run: dry_run, overwrite: overwrite) do |relative_path|
link_dir("Frameworks", verbose:, dry_run:, overwrite:) do |relative_path|
# Frameworks contain symlinks pointing into a subdir, so we have to use
# the :link strategy. However, for Foo.framework and
# Foo.framework/Versions we have to use :mkpath so that multiple formulae
@ -473,11 +473,9 @@ class Keg
:link
end
end
unless dry_run
make_relative_symlink(linked_keg_record, path, verbose: verbose, dry_run: dry_run, overwrite: overwrite)
end
make_relative_symlink(linked_keg_record, path, verbose:, dry_run:, overwrite:) unless dry_run
rescue LinkError
unlink(verbose: verbose)
unlink(verbose:)
raise
else
ObserverPathnameExtension.n
@ -512,16 +510,16 @@ class Keg
def optlink(verbose: false, dry_run: false, overwrite: false)
opt_record.delete if opt_record.symlink? || opt_record.exist?
make_relative_symlink(opt_record, path, verbose: verbose, dry_run: dry_run, overwrite: overwrite)
make_relative_symlink(opt_record, path, verbose:, dry_run:, overwrite:)
aliases.each do |a|
alias_opt_record = opt_record.parent/a
alias_opt_record.delete if alias_opt_record.symlink? || alias_opt_record.exist?
make_relative_symlink(alias_opt_record, path, verbose: verbose, dry_run: dry_run, overwrite: overwrite)
make_relative_symlink(alias_opt_record, path, verbose:, dry_run:, overwrite:)
end
oldname_opt_records.each do |record|
record.delete
make_relative_symlink(record, path, verbose: verbose, dry_run: dry_run, overwrite: overwrite)
make_relative_symlink(record, path, verbose:, dry_run:, overwrite:)
end
end
@ -641,10 +639,10 @@ class Keg
when :info
next if File.basename(src) == "dir" # skip historical local 'dir' files
make_relative_symlink dst, src, verbose: verbose, dry_run: dry_run, overwrite: overwrite
make_relative_symlink(dst, src, verbose:, dry_run:, overwrite:)
dst.install_info
else
make_relative_symlink dst, src, verbose: verbose, dry_run: dry_run, overwrite: overwrite
make_relative_symlink dst, src, verbose:, dry_run:, overwrite:
end
elsif src.directory?
# if the dst dir already exists, then great! walk the rest of the tree tho
@ -658,10 +656,10 @@ class Keg
when :skip_dir
Find.prune
when :mkpath
dst.mkpath unless resolve_any_conflicts(dst, verbose: verbose, dry_run: dry_run, overwrite: overwrite)
dst.mkpath unless resolve_any_conflicts(dst, verbose:, dry_run:, overwrite:)
else
unless resolve_any_conflicts(dst, verbose: verbose, dry_run: dry_run, overwrite: overwrite)
make_relative_symlink dst, src, verbose: verbose, dry_run: dry_run, overwrite: overwrite
unless resolve_any_conflicts(dst, verbose:, dry_run:, overwrite:)
make_relative_symlink(dst, src, verbose:, dry_run:, overwrite:)
Find.prune
end
end

View File

@ -128,7 +128,7 @@ class Keg
def replace_placeholders_with_locations(files, skip_linkage: false)
relocation = prepare_relocation_to_locations.freeze
relocate_dynamic_linkage(relocation) unless skip_linkage
replace_text_in_files(relocation, files: files)
replace_text_in_files(relocation, files:)
end
def openjdk_dep_name_if_applicable

View File

@ -167,7 +167,7 @@ module Language
ENV.refurbish_args
venv = Virtualenv.new formula, venv_root, python
venv.create(system_site_packages: system_site_packages, without_pip: without_pip)
venv.create(system_site_packages:, without_pip:)
# Find any Python bindings provided by recursive dependencies
formula_deps = formula.recursive_dependencies
@ -228,10 +228,10 @@ module Language
python = T.must(wanted.first)
python = "python3" if python == "python"
end
venv = virtualenv_create(libexec, python.delete("@"), system_site_packages: system_site_packages,
without_pip: without_pip)
venv = virtualenv_create(libexec, python.delete("@"), system_site_packages:,
without_pip:)
venv.pip_install resources
venv.pip_install_and_link(T.must(buildpath), link_manpages: link_manpages)
venv.pip_install_and_link(T.must(buildpath), link_manpages:)
venv
end
@ -327,10 +327,10 @@ module Language
targets = Array(targets)
targets.each do |t|
if t.is_a?(Resource)
t.stage { do_install(Pathname.pwd, build_isolation: build_isolation) }
t.stage { do_install(Pathname.pwd, build_isolation:) }
else
t = t.lines.map(&:strip) if t.is_a?(String) && t.include?("\n")
do_install(t, build_isolation: build_isolation)
do_install(t, build_isolation:)
end
end
end
@ -351,7 +351,7 @@ module Language
bin_before = Dir[@venv_root/"bin/*"].to_set
man_before = Dir[@venv_root/"share/man/man*/*"].to_set if link_manpages
pip_install(targets, build_isolation: build_isolation)
pip_install(targets, build_isolation:)
bin_after = Dir[@venv_root/"bin/*"].to_set
bin_to_link = (bin_after - bin_before).to_a
@ -375,7 +375,7 @@ module Language
}
def do_install(targets, build_isolation: true)
targets = Array(targets)
args = @formula.std_pip_args(prefix: false, build_isolation: build_isolation)
args = @formula.std_pip_args(prefix: false, build_isolation:)
@formula.system @python, "-m", "pip", "--python=#{@venv_root}/bin/python", "install", *args, *targets
end
end

View File

@ -31,7 +31,7 @@ class LinkageChecker
@files_missing_rpaths = []
@executable_path_dylibs = []
check_dylibs(rebuild_cache: rebuild_cache)
check_dylibs(rebuild_cache:)
end
def display_normal_output
@ -63,15 +63,15 @@ class LinkageChecker
end
def display_test_output(puts_output: true, strict: false)
display_items "Missing libraries", @broken_dylibs, puts_output: puts_output
display_items "Broken dependencies", @broken_deps, puts_output: puts_output
display_items "Unwanted system libraries", @unwanted_system_dylibs, puts_output: puts_output
display_items "Conflicting libraries", @version_conflict_deps, puts_output: puts_output
display_items("Missing libraries", @broken_dylibs, puts_output:)
display_items("Broken dependencies", @broken_deps, puts_output:)
display_items("Unwanted system libraries", @unwanted_system_dylibs, puts_output:)
display_items("Conflicting libraries", @version_conflict_deps, puts_output:)
return unless strict
display_items "Undeclared dependencies with linkage", @undeclared_deps, puts_output: puts_output
display_items "Files with missing rpath", @files_missing_rpaths, puts_output: puts_output
display_items "@executable_path references in libraries", @executable_path_dylibs, puts_output: puts_output
display_items("Undeclared dependencies with linkage", @undeclared_deps, puts_output:)
display_items("Files with missing rpath", @files_missing_rpaths, puts_output:)
display_items "@executable_path references in libraries", @executable_path_dylibs, puts_output:
end
sig { params(test: T::Boolean, strict: T::Boolean).returns(T::Boolean) }
@ -179,7 +179,7 @@ class LinkageChecker
return unless keg_files_dylibs_was_empty
store&.update!(keg_files_dylibs: keg_files_dylibs)
store&.update!(keg_files_dylibs:)
end
alias generic_check_dylibs check_dylibs

View File

@ -21,12 +21,12 @@ class LinuxRunnerSpec < T::Struct
}
def to_h
{
name: name,
runner: runner,
container: container,
workdir: workdir,
timeout: timeout,
cleanup: cleanup,
name:,
runner:,
container:,
workdir:,
timeout:,
cleanup:,
}
end
end

View File

@ -128,11 +128,11 @@ module Homebrew
if debug
# Print the chain of references for debugging
puts "Reference Chain:"
puts package_or_resource_name(first_formula_or_cask, full_name: full_name)
puts package_or_resource_name(first_formula_or_cask, full_name:)
references << referenced_formula_or_cask
references.each do |ref_formula_or_cask|
puts package_or_resource_name(ref_formula_or_cask, full_name: full_name)
puts package_or_resource_name(ref_formula_or_cask, full_name:)
end
end
@ -145,8 +145,8 @@ module Homebrew
referenced_formula_or_cask,
first_formula_or_cask,
references,
full_name: full_name,
debug: debug,
full_name:,
debug:,
)
# Returning references along with the final referenced formula/cask
@ -225,7 +225,7 @@ module Homebrew
name = package_or_resource_name(formula_or_cask, full_name: use_full_name)
referenced_formula_or_cask, livecheck_references =
resolve_livecheck_reference(formula_or_cask, full_name: use_full_name, debug: debug)
resolve_livecheck_reference(formula_or_cask, full_name: use_full_name, debug:)
if debug && i.positive?
puts <<~EOS
@ -243,11 +243,11 @@ module Homebrew
referenced_formula_or_cask,
name,
full_name: use_full_name,
verbose: verbose,
verbose:,
)
end
skip_info ||= SkipConditions.skip_information(formula_or_cask, full_name: use_full_name, verbose: verbose)
skip_info ||= SkipConditions.skip_information(formula_or_cask, full_name: use_full_name, verbose:)
if skip_info.present?
next skip_info if json && !newer_only
@ -279,9 +279,9 @@ module Homebrew
else
version_info = latest_version(
formula_or_cask,
referenced_formula_or_cask: referenced_formula_or_cask,
livecheck_references: livecheck_references,
json: json, full_name: use_full_name, verbose: verbose, debug: debug
referenced_formula_or_cask:,
livecheck_references:,
json:, full_name: use_full_name, verbose:, debug:
)
version_info[:latest] if version_info.present?
end
@ -289,20 +289,20 @@ module Homebrew
check_for_resources = check_resources && formula_or_cask.is_a?(Formula) && formula_or_cask.resources.present?
if check_for_resources
resource_version_info = formula_or_cask.resources.map do |resource|
res_skip_info ||= SkipConditions.skip_information(resource, verbose: verbose)
res_skip_info ||= SkipConditions.skip_information(resource, verbose:)
if res_skip_info.present?
res_skip_info
else
res_version_info = resource_version(
resource,
latest.to_s,
json: json,
debug: debug,
quiet: quiet,
verbose: verbose,
json:,
debug:,
quiet:,
verbose:,
)
if res_version_info.empty?
status_hash(resource, "error", ["Unable to get versions"], verbose: verbose)
status_hash(resource, "error", ["Unable to get versions"], verbose:)
else
res_version_info
end
@ -319,7 +319,7 @@ module Homebrew
next version_info if version_info.is_a?(Hash) && version_info[:status] && version_info[:messages]
latest_info = status_hash(formula_or_cask, "error", [no_versions_msg], full_name: use_full_name,
verbose: verbose)
verbose:)
if check_for_resources
unless verbose
resource_version_info.map! do |info|
@ -383,8 +383,8 @@ module Homebrew
next info
end
puts if debug
print_latest_version(info, verbose: verbose, ambiguous_cask: ambiguous_casks.include?(formula_or_cask))
print_resources_info(resource_version_info, verbose: verbose) if check_for_resources
print_latest_version(info, verbose:, ambiguous_cask: ambiguous_casks.include?(formula_or_cask))
print_resources_info(resource_version_info, verbose:) if check_for_resources
nil
rescue => e
Homebrew.failed = true
@ -394,7 +394,7 @@ module Homebrew
progress&.increment
unless quiet
status_hash(formula_or_cask, "error", [e.to_s], full_name: use_full_name,
verbose: verbose)
verbose:)
end
elsif !quiet
name = package_or_resource_name(formula_or_cask, full_name: use_full_name)
@ -402,7 +402,7 @@ module Homebrew
onoe "#{Tty.blue}#{name}#{Tty.reset}: #{e}"
$stderr.puts Utils::Backtrace.clean(e) if debug && !e.is_a?(Livecheck::Error)
print_resources_info(resource_version_info, verbose: verbose) if check_for_resources
print_resources_info(resource_version_info, verbose:) if check_for_resources
nil
end
end
@ -425,9 +425,9 @@ module Homebrew
def package_or_resource_name(package_or_resource, full_name: false)
case package_or_resource
when Formula
formula_name(package_or_resource, full_name: full_name)
formula_name(package_or_resource, full_name:)
when Cask::Cask
cask_name(package_or_resource, full_name: full_name)
cask_name(package_or_resource, full_name:)
when Resource
package_or_resource.name
else
@ -465,9 +465,9 @@ module Homebrew
status_hash = {}
if formula
status_hash[:formula] = formula_name(formula, full_name: full_name)
status_hash[:formula] = formula_name(formula, full_name:)
elsif cask
status_hash[:cask] = cask_name(cask, full_name: full_name)
status_hash[:cask] = cask_name(cask, full_name:)
elsif resource
status_hash[:resource] = resource.name
end
@ -512,7 +512,7 @@ module Homebrew
if r_info[:status] && r_info[:messages]
SkipConditions.print_skip_information(r_info)
else
print_latest_version(r_info, verbose: verbose)
print_latest_version(r_info, verbose:)
end
end
end
@ -673,19 +673,19 @@ module Homebrew
if debug
if formula
puts "Formula: #{formula_name(formula, full_name: full_name)}"
puts "Formula: #{formula_name(formula, full_name:)}"
puts "Head only?: true" if formula.head_only?
elsif cask
puts "Cask: #{cask_name(formula_or_cask, full_name: full_name)}"
puts "Cask: #{cask_name(formula_or_cask, full_name:)}"
end
puts "Livecheckable?: #{has_livecheckable ? "Yes" : "No"}"
livecheck_references.each do |ref_formula_or_cask|
case ref_formula_or_cask
when Formula
puts "Formula Ref: #{formula_name(ref_formula_or_cask, full_name: full_name)}"
puts "Formula Ref: #{formula_name(ref_formula_or_cask, full_name:)}"
when Cask::Cask
puts "Cask Ref: #{cask_name(ref_formula_or_cask, full_name: full_name)}"
puts "Cask Ref: #{cask_name(ref_formula_or_cask, full_name:)}"
end
end
end
@ -702,7 +702,7 @@ module Homebrew
strategies = Strategy.from_url(
url,
livecheck_strategy: livecheck_strategy,
livecheck_strategy:,
url_provided: livecheck_url.present?,
regex_provided: livecheck_regex.present?,
block_provided: livecheck_strategy_block.present?,
@ -746,7 +746,7 @@ module Homebrew
strategy_args = {
regex: livecheck_regex,
homebrew_curl: homebrew_curl,
homebrew_curl:,
}
# TODO: Set `cask`/`url` args based on the presence of the keyword arg
# in the strategy's `#find_versions` method once we figure out why
@ -769,7 +769,7 @@ module Homebrew
puts messages unless json
next if i + 1 < urls.length
return status_hash(formula_or_cask, "error", messages, full_name: full_name, verbose: verbose)
return status_hash(formula_or_cask, "error", messages, full_name:, verbose:)
end
if debug
@ -817,9 +817,9 @@ module Homebrew
version_info[:meta][:references] = livecheck_references.map do |ref_formula_or_cask|
case ref_formula_or_cask
when Formula
{ formula: formula_name(ref_formula_or_cask, full_name: full_name) }
{ formula: formula_name(ref_formula_or_cask, full_name:) }
when Cask::Cask
{ cask: cask_name(ref_formula_or_cask, full_name: full_name) }
{ cask: cask_name(ref_formula_or_cask, full_name:) }
end
end
end
@ -897,7 +897,7 @@ module Homebrew
strategies = Strategy.from_url(
url,
livecheck_strategy: livecheck_strategy,
livecheck_strategy:,
url_provided: livecheck_url.present?,
regex_provided: livecheck_regex.present?,
block_provided: livecheck_strategy_block.present?,
@ -934,7 +934,7 @@ module Homebrew
next if strategy.blank?
strategy_args = {
url: url,
url:,
regex: livecheck_regex,
homebrew_curl: false,
}.compact
@ -949,7 +949,7 @@ module Homebrew
puts messages unless json
next if i + 1 < urls.length
return status_hash(resource, "error", messages, verbose: verbose)
return status_hash(resource, "error", messages, verbose:)
end
if debug
@ -989,7 +989,7 @@ module Homebrew
res_current = T.must(resource.version)
res_latest = Version.new(match_version_map.values.max_by { |v| LivecheckVersion.create(resource, v) })
return status_hash(resource, "error", ["Unable to get versions"], verbose: verbose) if res_latest.blank?
return status_hash(resource, "error", ["Unable to get versions"], verbose:) if res_latest.blank?
is_outdated = res_current < res_latest
is_newer_than_upstream = res_current > res_latest
@ -1023,7 +1023,7 @@ module Homebrew
rescue => e
Homebrew.failed = true
if json
status_hash(resource, "error", [e.to_s], verbose: verbose)
status_hash(resource, "error", [e.to_s], verbose:)
elsif !quiet
onoe "#{Tty.blue}#{resource.name}#{Tty.reset}: #{e}"
$stderr.puts Utils::Backtrace.clean(e) if debug && !e.is_a?(Livecheck::Error)

View File

@ -44,7 +44,7 @@ module Homebrew
return {} if !package_or_resource.livecheck.skip? && skip_message.blank?
skip_messages = skip_message ? [skip_message] : nil
Livecheck.status_hash(package_or_resource, "skipped", skip_messages, full_name: full_name, verbose: verbose)
Livecheck.status_hash(package_or_resource, "skipped", skip_messages, full_name:, verbose:)
end
sig {
@ -62,8 +62,8 @@ module Homebrew
formula,
"error",
["HEAD only formula must be installed to be livecheckable"],
full_name: full_name,
verbose: verbose,
full_name:,
verbose:,
)
end
@ -78,7 +78,7 @@ module Homebrew
def formula_deprecated(formula, livecheckable, full_name: false, verbose: false)
return {} if !formula.deprecated? || livecheckable
Livecheck.status_hash(formula, "deprecated", full_name: full_name, verbose: verbose)
Livecheck.status_hash(formula, "deprecated", full_name:, verbose:)
end
sig {
@ -92,7 +92,7 @@ module Homebrew
def formula_disabled(formula, livecheckable, full_name: false, verbose: false)
return {} if !formula.disabled? || livecheckable
Livecheck.status_hash(formula, "disabled", full_name: full_name, verbose: verbose)
Livecheck.status_hash(formula, "disabled", full_name:, verbose:)
end
sig {
@ -106,7 +106,7 @@ module Homebrew
def formula_versioned(formula, livecheckable, full_name: false, verbose: false)
return {} if !formula.versioned_formula? || livecheckable
Livecheck.status_hash(formula, "versioned", full_name: full_name, verbose: verbose)
Livecheck.status_hash(formula, "versioned", full_name:, verbose:)
end
sig {
@ -120,7 +120,7 @@ module Homebrew
def cask_discontinued(cask, livecheckable, full_name: false, verbose: false)
return {} if !cask.discontinued? || livecheckable
Livecheck.status_hash(cask, "discontinued", full_name: full_name, verbose: verbose)
Livecheck.status_hash(cask, "discontinued", full_name:, verbose:)
end
sig {
@ -134,7 +134,7 @@ module Homebrew
def cask_deprecated(cask, livecheckable, full_name: false, verbose: false)
return {} if !cask.deprecated? || livecheckable
Livecheck.status_hash(cask, "deprecated", full_name: full_name, verbose: verbose)
Livecheck.status_hash(cask, "deprecated", full_name:, verbose:)
end
sig {
@ -148,7 +148,7 @@ module Homebrew
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)
Livecheck.status_hash(cask, "disabled", full_name:, verbose:)
end
sig {
@ -162,7 +162,7 @@ module Homebrew
def cask_version_latest(cask, livecheckable, full_name: false, verbose: false)
return {} if !(cask.present? && cask.version&.latest?) || livecheckable
Livecheck.status_hash(cask, "latest", full_name: full_name, verbose: verbose)
Livecheck.status_hash(cask, "latest", full_name:, verbose:)
end
sig {
@ -176,7 +176,7 @@ module Homebrew
def cask_url_unversioned(cask, livecheckable, full_name: false, verbose: false)
return {} if !(cask.present? && cask.url&.unversioned?) || livecheckable
Livecheck.status_hash(cask, "unversioned", full_name: full_name, verbose: verbose)
Livecheck.status_hash(cask, "unversioned", full_name:, verbose:)
end
# Skip conditions for formulae.
@ -227,7 +227,7 @@ module Homebrew
return {} unless checks
checks.each do |method_name|
skip_hash = send(method_name, package_or_resource, livecheckable, full_name: full_name, verbose: verbose)
skip_hash = send(method_name, package_or_resource, livecheckable, full_name:, verbose:)
return skip_hash if skip_hash.present?
end
@ -254,12 +254,12 @@ module Homebrew
)
skip_info = SkipConditions.skip_information(
livecheck_package_or_resource,
full_name: full_name,
verbose: verbose,
full_name:,
verbose:,
)
return if skip_info.blank?
referenced_name = Livecheck.package_or_resource_name(livecheck_package_or_resource, full_name: full_name)
referenced_name = Livecheck.package_or_resource_name(livecheck_package_or_resource, full_name:)
referenced_type = case livecheck_package_or_resource
when Formula
:formula

View File

@ -192,7 +192,7 @@ module Homebrew
url,
wanted_headers: ["location", "content-disposition"],
use_homebrew_curl: homebrew_curl,
user_agent: user_agent,
user_agent:,
**DEFAULT_CURL_OPTIONS,
)
rescue ErrorDuringExecution
@ -222,7 +222,7 @@ module Homebrew
*PAGE_CONTENT_CURL_ARGS, url,
**DEFAULT_CURL_OPTIONS,
use_homebrew_curl: homebrew_curl,
user_agent: user_agent
user_agent:
)
next unless status.success?

Some files were not shown because too many files have changed in this diff Show More