brew style --fix

Signed-off-by: Patrick Linnane <patrick@linnane.io>
This commit is contained in:
Patrick Linnane 2024-11-26 11:50:45 -08:00
parent 99851ac15e
commit d04430d1a5
No known key found for this signature in database
9 changed files with 6 additions and 13 deletions

View File

@ -38,7 +38,6 @@ module Cask
quarantine: nil, quarantine: nil,
require_sha: nil require_sha: nil
) )
quarantine = true if quarantine.nil? quarantine = true if quarantine.nil?
greedy = true if Homebrew::EnvConfig.upgrade_greedy? greedy = true if Homebrew::EnvConfig.upgrade_greedy?

View File

@ -74,7 +74,6 @@ module Cask
data: nil, data: nil,
only_path: nil only_path: nil
) )
@uri = URI(uri) @uri = URI(uri)
header = Array(header) unless header.nil? header = Array(header) unless header.nil?

View File

@ -10,7 +10,6 @@ class Descriptions
# Given a regex, find all formulae whose specified fields contain a match. # Given a regex, find all formulae whose specified fields contain a match.
def self.search(string_or_regex, field, cache_store, def self.search(string_or_regex, field, cache_store,
eval_all = Homebrew::EnvConfig.eval_all?, cache_store_hash: false) eval_all = Homebrew::EnvConfig.eval_all?, cache_store_hash: false)
cache_store.populate_if_empty!(eval_all:) unless cache_store_hash cache_store.populate_if_empty!(eval_all:) unless cache_store_hash
results = case field results = case field

View File

@ -285,8 +285,8 @@ module Kernel
Homebrew._system(cmd, *args) do Homebrew._system(cmd, *args) do
# Redirect output streams to `/dev/null` instead of closing as some programs # Redirect output streams to `/dev/null` instead of closing as some programs
# will fail to execute if they can't write to an open stream. # will fail to execute if they can't write to an open stream.
$stdout.reopen("/dev/null") $stdout.reopen(File::NULL)
$stderr.reopen("/dev/null") $stderr.reopen(File::NULL)
end end
end end

View File

@ -178,10 +178,7 @@ class Livecheck
delegate version: :@package_or_resource delegate version: :@package_or_resource
delegate arch: :@package_or_resource delegate arch: :@package_or_resource
# FIXME: false positive: https://github.com/rubocop/rubocop/issues/13453 # FIXME: false positive: https://github.com/rubocop/rubocop/issues/13453
# rubocop:disable Style/AccessModifierDeclarations
private :version, :arch private :version, :arch
# rubocop:enable Style/AccessModifierDeclarations
# Returns a `Hash` of all instance variable values. # Returns a `Hash` of all instance variable values.
# @return [Hash] # @return [Hash]
sig { returns(T::Hash[String, T.untyped]) } sig { returns(T::Hash[String, T.untyped]) }

View File

@ -54,7 +54,7 @@ module Utils
require "utils/curl" require "utils/curl"
curl = Utils::Curl.curl_executable curl = Utils::Curl.curl_executable
args = Utils::Curl.curl_args(*args, "--silent", "--output", "/dev/null", show_error: false) args = Utils::Curl.curl_args(*args, "--silent", "--output", File::NULL, show_error: false)
if ENV["HOMEBREW_ANALYTICS_DEBUG"] if ENV["HOMEBREW_ANALYTICS_DEBUG"]
puts "#{curl} #{args.join(" ")} \"#{url}\"" puts "#{curl} #{args.join(" ")} \"#{url}\""
puts Utils.popen_read(curl, *args, url) puts Utils.popen_read(curl, *args, url)

View File

@ -101,7 +101,7 @@ module Utils
end end
# echo any cookies received on a redirect # echo any cookies received on a redirect
args << "--cookie" << "/dev/null" args << "--cookie" << File::NULL
args << "--globoff" args << "--globoff"
@ -256,7 +256,7 @@ module Utils
if request_args.empty? if request_args.empty?
# If we didn't get any wanted header yet, retry using `GET`. # If we didn't get any wanted header yet, retry using `GET`.
next if wanted_headers.any? && next if wanted_headers.any? &&
parsed_output.fetch(:responses).none? { |r| (r.fetch(:headers).keys & wanted_headers).any? } parsed_output.fetch(:responses).none? { |r| r.fetch(:headers).keys.intersect?(wanted_headers) }
# Some CDNs respond with 400 codes for `HEAD` but resolve with `GET`. # Some CDNs respond with 400 codes for `HEAD` but resolve with `GET`.
next if (400..499).cover?(parsed_output.fetch(:responses).last&.fetch(:status_code).to_i) next if (400..499).cover?(parsed_output.fetch(:responses).last&.fetch(:status_code).to_i)

View File

@ -50,7 +50,7 @@ module Utils
yield pipe yield pipe
else else
options[:err] ||= "/dev/null" unless ENV["HOMEBREW_STDERR"] options[:err] ||= File::NULL unless ENV["HOMEBREW_STDERR"]
begin begin
exec(*args, options) exec(*args, options)
rescue Errno::ENOENT rescue Errno::ENOENT

View File

@ -219,7 +219,6 @@ module PyPI
exclude_packages: nil, dependencies: nil, install_dependencies: false, exclude_packages: nil, dependencies: nil, install_dependencies: false,
print_only: false, silent: false, verbose: false, print_only: false, silent: false, verbose: false,
ignore_non_pypi_packages: false) ignore_non_pypi_packages: false)
auto_update_list = formula.tap&.pypi_formula_mappings auto_update_list = formula.tap&.pypi_formula_mappings
if auto_update_list.present? && auto_update_list.key?(formula.full_name) && if auto_update_list.present? && auto_update_list.key?(formula.full_name) &&
package_name.blank? && extra_packages.blank? && exclude_packages.blank? package_name.blank? && extra_packages.blank? && exclude_packages.blank?