language
stringclasses
1 value
owner
stringlengths
2
15
repo
stringlengths
2
21
sha
stringlengths
45
45
message
stringlengths
7
36.3k
path
stringlengths
1
199
patch
stringlengths
15
102k
is_multipart
bool
2 classes
Other
Homebrew
brew
ca4a5b73fdeb082bce2279d866ed5afdcb208861.json
Update RBI files for tapioca.
Library/Homebrew/sorbet/rbi/gems/tapioca@0.4.19.rbi
@@ -554,6 +554,8 @@ module Tapioca::GenericTypeRegistry private + sig { params(constant: Module, name: String).returns(Module) } + def create_generic_type(constant, name); end sig { params(constant: Module).returns(T::Hash[Integer, String]) } def lookup_or_initialize_type_variables(constant); end sig { params(constant: Module).returns(T.nilable(String)) }
false
Other
Homebrew
brew
1b674cdfec1674f88b61e7a74fff75071b9424c3.json
workflows: enable commit signing for BrewTestBot
.github/workflows/sorbet.yml
@@ -24,8 +24,15 @@ jobs: with: username: BrewTestBot + - name: Set up commit signing + uses: Homebrew/actions/setup-commit-signing@master + with: + signing_key: ${{ secrets.BREWTESTBOT_GPG_SIGNING_SUBKEY }} + - name: Update RBI files id: update + env: + GPG_PASSPHRASE: ${{ secrets.BREWTESTBOT_GPG_SIGNING_SUBKEY_PASSPHRASE }} run: | git fetch origin
true
Other
Homebrew
brew
1b674cdfec1674f88b61e7a74fff75071b9424c3.json
workflows: enable commit signing for BrewTestBot
.github/workflows/spdx.yml
@@ -21,11 +21,17 @@ jobs: with: username: BrewTestBot + - name: Set up commit signing + uses: Homebrew/actions/setup-commit-signing@master + with: + signing_key: ${{ secrets.BREWTESTBOT_GPG_SIGNING_SUBKEY }} + - name: Update SPDX license data id: update env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GPG_PASSPHRASE: ${{ secrets.BREWTESTBOT_GPG_SIGNING_SUBKEY_PASSPHRASE }} run: | git fetch origin
true
Other
Homebrew
brew
1b674cdfec1674f88b61e7a74fff75071b9424c3.json
workflows: enable commit signing for BrewTestBot
.github/workflows/update-manpage.yml
@@ -31,6 +31,11 @@ jobs: with: username: BrewTestBot + - name: Set up commit signing + uses: Homebrew/actions/setup-commit-signing@master + with: + signing_key: ${{ secrets.BREWTESTBOT_GPG_SIGNING_SUBKEY }} + - name: Update maintainers, manpage and completions id: update run: | @@ -65,6 +70,7 @@ jobs: fi env: HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }} + GPG_PASSPHRASE: ${{ secrets.BREWTESTBOT_GPG_SIGNING_SUBKEY_PASSPHRASE }} - name: Push commits if: steps.update.outputs.committed == 'true'
true
Other
Homebrew
brew
1b674cdfec1674f88b61e7a74fff75071b9424c3.json
workflows: enable commit signing for BrewTestBot
.github/workflows/vendor-gems.yml
@@ -28,6 +28,10 @@ jobs: uses: Homebrew/actions/git-user-config@master with: username: BrewTestBot + - name: Set up commit signing + uses: Homebrew/actions/setup-commit-signing@master + with: + signing_key: ${{ secrets.BREWTESTBOT_GPG_SIGNING_SUBKEY }} - name: Check out pull request id: checkout run: | @@ -43,6 +47,7 @@ jobs: - name: Vendor Gems env: GEM_NAME: ${{ steps.checkout.outputs.gem_name }} + GPG_PASSPHRASE: ${{ secrets.BREWTESTBOT_GPG_SIGNING_SUBKEY_PASSPHRASE }} run: | set -u @@ -54,6 +59,7 @@ jobs: - name: Update RBI files env: GEM_NAME: ${{ steps.checkout.outputs.gem_name }} + GPG_PASSPHRASE: ${{ secrets.BREWTESTBOT_GPG_SIGNING_SUBKEY_PASSPHRASE }} run: | set -u
true
Other
Homebrew
brew
86beda7f19eb2acb0b6fbcf4baa8a86e91a336be.json
formula: add ldflags parameter to std_go_args
Library/Homebrew/formula.rb
@@ -1457,9 +1457,11 @@ def std_cmake_args end # Standard parameters for Go builds. - sig { returns(T::Array[T.any(String, Pathname)]) } - def std_go_args - ["-trimpath", "-o", bin/name] + sig { params(ldflags: T.nilable(String)).returns(T::Array[String]) } + def std_go_args(ldflags: nil) + args = ["-trimpath", "-o=#{bin/name}"] + args += ["-ldflags=#{ldflags}"] if ldflags + args end # Standard parameters for cabal-v2 builds.
false
Other
Homebrew
brew
c7033b367296e61e382dac93f1bf093721d202c7.json
Update RBI files for rubocop-performance.
Library/Homebrew/sorbet/rbi/gems/rubocop-performance@1.10.2.rbi
@@ -470,6 +470,7 @@ class RuboCop::Cop::Performance::RedundantBlockCall < ::RuboCop::Cop::Base def args_include_block_pass?(blockcall); end def autocorrect(corrector, node); end def calls_to_report(argname, body); end + def shadowed_block_argument?(body, block_argument_of_method_signature); end end RuboCop::Cop::Performance::RedundantBlockCall::CLOSE_PAREN = T.let(T.unsafe(nil), String) @@ -492,6 +493,7 @@ class RuboCop::Cop::Performance::RedundantEqualityComparisonBlock < ::RuboCop::C def new_argument(block_argument, block_body); end def offense_range(node); end + def one_block_argument?(block_arguments); end def same_block_argument_and_is_a_argument?(block_body, block_argument); end def use_equality_comparison_block?(block_body); end end @@ -673,6 +675,7 @@ class RuboCop::Cop::Performance::ReverseEach < ::RuboCop::Cop::Base private def offense_range(node); end + def use_return_value?(node); end end RuboCop::Cop::Performance::ReverseEach::MSG = T.let(T.unsafe(nil), String)
false
Other
Homebrew
brew
86ff8b34aba809e835b7757339e589471b68c4b3.json
Update RBI files for tapioca.
Library/Homebrew/sorbet/rbi/gems/tapioca@0.4.18.rbi
@@ -1,28 +1,51 @@ # DO NOT EDIT MANUALLY # This is an autogenerated file for types exported from the `tapioca` gem. -# Please instead update this file by running `tapioca sync`. +# Please instead update this file by running `bin/tapioca sync`. # typed: true +module T::Generic::TypeStoragePatch + def [](*types); end + def type_member(variance = T.unsafe(nil), fixed: T.unsafe(nil), lower: T.unsafe(nil), upper: T.unsafe(nil)); end + def type_template(variance = T.unsafe(nil), fixed: T.unsafe(nil), lower: T.unsafe(nil), upper: T.unsafe(nil)); end +end + +module T::Types::Simple::GenericNamePatch + def name; end +end + +module T::Types::Simple::NamePatch + def name; end +end + module Tapioca class << self def silence_warnings(&blk); end end end -class Tapioca::Cli < ::Thor +module Tapioca::Cli +end + +class Tapioca::Cli::Main < ::Thor include(::Thor::Actions) extend(::Thor::Actions::ClassMethods) def __print_version; end def dsl(*constants); end def generate(*gems); end - def generator; end def init; end def require; end def sync; end def todo; end + private + + def create_config; end + def create_post_require; end + def generate_binstub; end + def generator; end + class << self def exit_on_failure?; end end @@ -53,7 +76,7 @@ class Tapioca::Compilers::Dsl::Base sig { params(method_def: T.any(Method, UnboundMethod)).returns(T::Array[Parlour::RbiGenerator::Parameter]) } def compile_method_parameters_to_parlour(method_def); end - sig { params(method_def: T.any(Method, UnboundMethod)).returns(String) } + sig { params(method_def: T.any(Method, UnboundMethod)).returns(T.nilable(String)) } def compile_method_return_type_to_parlour(method_def); end sig { params(namespace: Parlour::RbiGenerator::Namespace, name: String, options: T::Hash[T.untyped, T.untyped]).void } def create_method(namespace, name, options = T.unsafe(nil)); end @@ -162,9 +185,9 @@ class Tapioca::Compilers::SymbolTable::SymbolGenerator def compile_body(name, constant); end sig { params(name: String, constant: BasicObject).returns(T.nilable(String)) } def compile_constant(name, constant); end - sig { params(module_name: String, mod: Module, for_visibility: T::Array[Symbol]).returns(String) } + sig { params(module_name: String, mod: Module, for_visibility: T::Array[Symbol]).returns(T.nilable(String)) } def compile_directly_owned_methods(module_name, mod, for_visibility = T.unsafe(nil)); end - sig { params(constant: Module).returns(String) } + sig { params(constant: Module).returns(T.nilable(String)) } def compile_enums(constant); end sig { params(symbol_name: String, constant: Module, method: T.nilable(UnboundMethod)).returns(T.nilable(String)) } def compile_method(symbol_name, constant, method); end @@ -176,18 +199,22 @@ class Tapioca::Compilers::SymbolTable::SymbolGenerator def compile_mixins(constant); end sig { params(name: String, constant: Module).returns(T.nilable(String)) } def compile_module(name, constant); end - sig { params(constant: Module).returns(String) } + sig { params(constant: Module).returns(T.nilable(String)) } def compile_module_helpers(constant); end sig { params(name: String, value: BasicObject).returns(T.nilable(String)) } def compile_object(name, value); end - sig { params(constant: Module).returns(String) } + sig { params(constant: Module).returns(T.nilable(String)) } def compile_props(constant); end sig { params(signature: T.untyped, parameters: T::Array[[Symbol, String]]).returns(String) } def compile_signature(signature, parameters); end sig { params(name: String, constant: Module).returns(T.nilable(String)) } def compile_subconstants(name, constant); end sig { params(constant: Class).returns(String) } def compile_superclass(constant); end + sig { params(constant: Module).returns(T.nilable(String)) } + def compile_type_variable_declarations(constant); end + sig { params(constant: Module).returns(T.nilable(String)) } + def compile_type_variables(constant); end sig { params(constant: Module).returns(T::Array[Symbol]) } def constants_of(constant); end sig { params(constant: Module, strict: T::Boolean).returns(T::Boolean) } @@ -215,7 +242,7 @@ class Tapioca::Compilers::SymbolTable::SymbolGenerator def name_of(constant); end sig { params(constant: Module).returns(T.nilable(String)) } def name_of_proxy_target(constant); end - sig { params(object: Object).returns(T::Boolean) } + sig { params(object: BasicObject).returns(Integer) } def object_id_of(object); end def parent_declares_constant?(name); end sig { params(constant: Module).returns(T::Boolean) } @@ -224,8 +251,8 @@ class Tapioca::Compilers::SymbolTable::SymbolGenerator def qualified_name_of(constant); end sig { params(constant: Module).returns(T.nilable(String)) } def raw_name_of(constant); end - sig { params(symbol: String, inherit: T::Boolean).returns(BasicObject) } - def resolve_constant(symbol, inherit: T.unsafe(nil)); end + sig { params(symbol: String, inherit: T::Boolean, namespace: Module).returns(BasicObject) } + def resolve_constant(symbol, inherit: T.unsafe(nil), namespace: T.unsafe(nil)); end sig { params(name: String).returns(T::Boolean) } def seen?(name); end sig { params(method: T.any(Method, UnboundMethod)).returns(T.untyped) } @@ -240,12 +267,14 @@ class Tapioca::Compilers::SymbolTable::SymbolGenerator def symbol_ignored?(symbol_name); end sig { returns(T::Set[String]) } def symbols; end - sig { params(constant: Module).returns(String) } + sig { params(constant: T::Types::Base).returns(String) } def type_of(constant); end sig { params(name: String).returns(T::Boolean) } def valid_method_name?(name); end sig { type_parameters(:U).params(step: Integer, _blk: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) } def with_indentation(step = T.unsafe(nil), &_blk); end + sig { params(constant: Module, blk: T.proc.returns(T.nilable(String))).returns(T.nilable(String)) } + def with_indentation_for_constant(constant, &blk); end end Tapioca::Compilers::SymbolTable::SymbolGenerator::IGNORED_SYMBOLS = T.let(T.unsafe(nil), Array) @@ -294,7 +323,6 @@ class Tapioca::Config < ::T::Struct const :outdir, String const :prerequire, T.nilable(String) const :postrequire, String - const :generate_command, String const :exclude, T::Array[String] const :typed_overrides, T::Hash[String, String] const :todos_path, String @@ -308,6 +336,8 @@ class Tapioca::Config < ::T::Struct end end +Tapioca::Config::DEFAULT_COMMAND = T.let(T.unsafe(nil), String) + Tapioca::Config::DEFAULT_DSLDIR = T.let(T.unsafe(nil), String) Tapioca::Config::DEFAULT_GEMDIR = T.let(T.unsafe(nil), String) @@ -337,8 +367,6 @@ class Tapioca::ConfigBuilder sig { returns(T::Hash[String, T.untyped]) } def config_options; end - sig { returns(String) } - def default_command; end sig { params(command: Symbol).returns(T::Hash[String, T.untyped]) } def default_options(command); end sig { params(options: T::Hash[String, T.untyped]).returns(T::Hash[String, T.untyped]) } @@ -432,8 +460,8 @@ class Tapioca::Generator < ::Thor::Shell::Color sig { params(config: Tapioca::Config).void } def initialize(config); end - sig { params(requested_constants: T::Array[String]).void } - def build_dsl(requested_constants); end + sig { params(requested_constants: T::Array[String], should_verify: T::Boolean).void } + def build_dsl(requested_constants, should_verify: T.unsafe(nil)); end sig { params(gem_names: T::Array[String]).void } def build_gem_rbis(gem_names); end sig { void } @@ -453,8 +481,8 @@ class Tapioca::Generator < ::Thor::Shell::Color def added_rbis; end sig { returns(Tapioca::Gemfile) } def bundle; end - sig { params(constant: Module, contents: String).returns(T.nilable(Pathname)) } - def compile_dsl_rbi(constant, contents); end + sig { params(constant: Module, contents: String, outpath: Pathname).returns(T.nilable(Pathname)) } + def compile_dsl_rbi(constant, contents, outpath: T.unsafe(nil)); end sig { params(gem: Tapioca::Gemfile::Gem).void } def compile_gem_rbi(gem); end sig { returns(Tapioca::Compilers::SymbolTableCompiler) } @@ -465,8 +493,8 @@ class Tapioca::Generator < ::Thor::Shell::Color def dsl_rbi_filename(constant_name); end sig { params(gem_name: String).returns(Pathname) } def existing_rbi(gem_name); end - sig { params(requested_constants: T::Array[String]).returns(T::Set[Pathname]) } - def existing_rbi_filenames(requested_constants); end + sig { params(requested_constants: T::Array[String], path: Pathname).returns(T::Set[Pathname]) } + def existing_rbi_filenames(requested_constants, path: T.unsafe(nil)); end sig { returns(T::Hash[String, String]) } def existing_rbis; end sig { params(gem_name: String).returns(Pathname) } @@ -491,8 +519,12 @@ class Tapioca::Generator < ::Thor::Shell::Color def move(old_filename, new_filename); end sig { void } def perform_additions; end + sig { params(dir: String).void } + def perform_dsl_verification(dir); end sig { void } def perform_removals; end + sig { params(files: T::Set[Pathname]).void } + def purge_stale_dsl_rbi_files(files); end sig { params(command: String, reason: T.nilable(String), strictness: T.nilable(String)).returns(String) } def rbi_header(command, reason: T.unsafe(nil), strictness: T.unsafe(nil)); end sig { params(filename: Pathname).void } @@ -503,10 +535,38 @@ class Tapioca::Generator < ::Thor::Shell::Color def require_gem_file; end sig { params(message: String, color: T.any(Symbol, T::Array[Symbol])).void } def say_error(message = T.unsafe(nil), *color); end + sig { params(tmp_dir: Pathname).returns(T.nilable(String)) } + def verify_dsl_rbi(tmp_dir:); end end Tapioca::Generator::EMPTY_RBI_COMMENT = T.let(T.unsafe(nil), String) +module Tapioca::GenericTypeRegistry + class << self + sig { params(constant: Module).returns(T.nilable(T::Hash[Integer, String])) } + def lookup_type_variables(constant); end + sig { params(constant: T.untyped, types: T.untyped).returns(Module) } + def register_type(constant, types); end + sig { params(constant: T.untyped, type_member: T::Types::TypeVariable, fixed: T.untyped, lower: T.untyped, upper: T.untyped).void } + def register_type_member(constant, type_member, fixed, lower, upper); end + sig { params(constant: T.untyped, type_template: T::Types::TypeVariable, fixed: T.untyped, lower: T.untyped, upper: T.untyped).void } + def register_type_template(constant, type_template, fixed, lower, upper); end + + private + + sig { params(constant: Module).returns(T::Hash[Integer, String]) } + def lookup_or_initialize_type_variables(constant); end + sig { params(constant: Module).returns(T.nilable(String)) } + def name_of(constant); end + sig { params(object: BasicObject).returns(Integer) } + def object_id_of(object); end + sig { params(constant: T.untyped, type_variable_type: T.enum([:type_member, :type_template]), type_variable: T::Types::TypeVariable, fixed: T.untyped, lower: T.untyped, upper: T.untyped).void } + def register_type_variable(constant, type_variable_type, type_variable, fixed, lower, upper); end + sig { params(type_variable_type: Symbol, variance: Symbol, fixed: T.untyped, lower: T.untyped, upper: T.untyped).returns(String) } + def serialize_type_variable(type_variable_type, variance, fixed, lower, upper); end + end +end + class Tapioca::Loader sig { params(gemfile: Tapioca::Gemfile).void } def initialize(gemfile); end
true
Other
Homebrew
brew
86ff8b34aba809e835b7757339e589471b68c4b3.json
Update RBI files for tapioca.
Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi
@@ -29376,82 +29376,6 @@ class Tapioca::Compilers::Dsl::Base extend ::T::Private::Methods::SingletonMethodHooks end -class Tapioca::Compilers::DslCompiler - extend ::T::Sig - extend ::T::Private::Methods::MethodHooks - extend ::T::Private::Methods::SingletonMethodHooks -end - -class Tapioca::Compilers::RequiresCompiler - extend ::T::Sig - extend ::T::Private::Methods::MethodHooks - extend ::T::Private::Methods::SingletonMethodHooks -end - -module Tapioca::Compilers::Sorbet - extend ::T::Private::Methods::SingletonMethodHooks -end - -class Tapioca::Compilers::SymbolTable::SymbolGenerator - extend ::T::Sig - extend ::T::Private::Methods::MethodHooks - extend ::T::Private::Methods::SingletonMethodHooks -end - -module Tapioca::Compilers::SymbolTable::SymbolLoader - extend ::T::Private::Methods::SingletonMethodHooks -end - -class Tapioca::Compilers::SymbolTableCompiler - extend ::T::Sig - extend ::T::Private::Methods::MethodHooks - extend ::T::Private::Methods::SingletonMethodHooks -end - -class Tapioca::Compilers::TodosCompiler - extend ::T::Sig - extend ::T::Private::Methods::MethodHooks - extend ::T::Private::Methods::SingletonMethodHooks -end - -class Tapioca::Config - extend ::T::Sig - extend ::T::Private::Methods::MethodHooks - extend ::T::Private::Methods::SingletonMethodHooks -end - -class Tapioca::ConfigBuilder - extend ::T::Private::Methods::SingletonMethodHooks -end - -class Tapioca::Gemfile - Spec = ::T.let(nil, ::T.untyped) -end - -class Tapioca::Gemfile::Gem - extend ::T::Sig - extend ::T::Private::Methods::MethodHooks - extend ::T::Private::Methods::SingletonMethodHooks -end - -class Tapioca::Gemfile - extend ::T::Sig - extend ::T::Private::Methods::MethodHooks - extend ::T::Private::Methods::SingletonMethodHooks -end - -class Tapioca::Generator - extend ::T::Sig - extend ::T::Private::Methods::MethodHooks - extend ::T::Private::Methods::SingletonMethodHooks -end - -class Tapioca::Loader - extend ::T::Sig - extend ::T::Private::Methods::MethodHooks - extend ::T::Private::Methods::SingletonMethodHooks -end - class Tempfile def _close(); end
true
Other
Homebrew
brew
d6d7c57806437d9f37154eb4fc786bed8d760288.json
sorbet: Update RBI files. Autogenerated by the [sorbet](https://github.com/Homebrew/brew/blob/master/.github/workflows/sorbet.yml) workflow.
Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi
@@ -8289,6 +8289,11 @@ module Homebrew::Livecheck::SkipConditions extend ::T::Private::Methods::SingletonMethodHooks end +class Homebrew::Livecheck::Strategy::ElectronBuilder + extend ::T::Private::Methods::MethodHooks + extend ::T::Private::Methods::SingletonMethodHooks +end + class Homebrew::Livecheck::Strategy::HeaderMatch extend ::T::Private::Methods::MethodHooks extend ::T::Private::Methods::SingletonMethodHooks
false
Other
Homebrew
brew
ae2d0fb0f8e0d81ee02a1e0535a7e6401a9e4825.json
Fix Cask handling in `brew deps` and `brew uses`. Fixes #10906.
Library/Homebrew/cmd/deps.rb
@@ -93,9 +93,9 @@ def deps when :formula sorted_dependents(Formula.installed) when :cask - sorted_dependents(Cask::Caskroom.casks(config: Cask::Config.from_args(args))) + sorted_dependents(Cask::Caskroom.casks) else - sorted_dependents(Formula.installed + Cask::Caskroom.casks(config: Cask::Config.from_args(args))) + sorted_dependents(Formula.installed + Cask::Caskroom.casks) end else raise FormulaUnspecifiedError @@ -118,9 +118,9 @@ def deps when :formula sorted_dependents(Formula.installed) when :cask - sorted_dependents(Cask::Caskroom.casks(config: Cask::Config.from_args(args))) + sorted_dependents(Cask::Caskroom.casks) else - sorted_dependents(Formula.installed + Cask::Caskroom.casks(config: Cask::Config.from_args(args))) + sorted_dependents(Formula.installed + Cask::Caskroom.casks) end puts_deps sorted_dependents_formulae_and_casks, recursive: recursive, args: args return
true
Other
Homebrew
brew
ae2d0fb0f8e0d81ee02a1e0535a7e6401a9e4825.json
Fix Cask handling in `brew deps` and `brew uses`. Fixes #10906.
Library/Homebrew/cmd/uses.rb
@@ -93,7 +93,7 @@ def intersection_of_dependents(use_runtime_dependents, used_formulae, args:) end if show_formulae_and_casks || args.cask? deps += select_used_dependents( - dependents(Cask::Caskroom.casks(config: Cask::Config.from_args(args))), + dependents(Cask::Caskroom.casks), used_formulae, recursive, includes, ignores ) end @@ -104,7 +104,7 @@ def intersection_of_dependents(use_runtime_dependents, used_formulae, args:) deps += args.installed? ? Formula.installed : Formula.to_a end if show_formulae_and_casks || args.cask? - deps += args.installed? ? Cask::Caskroom.casks(config: Cask::Config.from_args(args)) : Cask::Cask.to_a + deps += args.installed? ? Cask::Caskroom.casks : Cask::Cask.to_a end select_used_dependents(dependents(deps), used_formulae, recursive, includes, ignores)
true
Other
Homebrew
brew
15102a3234bae24a1aeeb458ccb0182f4685788d.json
livecheck/strategy/electron_builder: address changes from review Co-authored-by: Sam Ford <1584702+samford@users.noreply.github.com>
Library/Homebrew/livecheck/strategy/electron_builder.rb
@@ -1,4 +1,4 @@ -# typed: false +# typed: true # frozen_string_literal: true module Homebrew @@ -19,7 +19,7 @@ class ElectronBuilder PRIORITY = 0 # The `Regexp` used to determine if the strategy applies to the URL. - URL_MATCH_REGEX = %r{^https?://.+?/.+?\.yml}i.freeze + URL_MATCH_REGEX = %r{^https?://.+/.+\.ya?ml$}i.freeze # Whether the strategy can be applied to the provided URL. # @@ -34,21 +34,39 @@ def self.match?(url) # # @param content [String] the content to check # @return [String] - sig { params(content: String).returns(T.nilable(String)) } - def self.version_from_content(content) + sig { + params( + content: String, + block: T.nilable(T.proc.params(arg0: Hash).returns(String)), + ).returns(T.nilable(String)) + } + def self.version_from_content(content, &block) require "yaml" - return unless (item = YAML.safe_load(content)) + return unless (yaml = YAML.safe_load(content)) - item["version"] + if block + value = block.call(yaml) + return value if value.is_a?(String) + + raise TypeError, "Return value of `strategy :electron_builder` block must be a string." + end + + yaml["version"] end # Checks the content at the URL for new versions. # # @param url [String] the URL of the content to check # @param regex [Regexp] a regex used for matching versions in content # @return [Hash] - sig { params(url: String, regex: T.nilable(Regexp)).returns(T::Hash[Symbol, T.untyped]) } + sig { + params( + url: String, + regex: T.nilable(Regexp), + block: T.nilable(T.proc.params(arg0: Hash).returns(String)), + ).returns(T::Hash[Symbol, T.untyped]) + } def self.find_versions(url, regex = nil, &block) raise ArgumentError, "The #{T.must(name).demodulize} strategy does not support a regex." if regex @@ -57,15 +75,8 @@ def self.find_versions(url, regex = nil, &block) match_data.merge!(Strategy.page_content(url)) content = match_data.delete(:content) - if (item = version_from_content(content)) - match = if block - block.call(item)&.to_s - else - item - end - - match_data[:matches][match] = Version.new(match) if match - end + version = version_from_content(content, &block) + match_data[:matches][version] = Version.new(version) if version match_data end
true
Other
Homebrew
brew
15102a3234bae24a1aeeb458ccb0182f4685788d.json
livecheck/strategy/electron_builder: address changes from review Co-authored-by: Sam Ford <1584702+samford@users.noreply.github.com>
Library/Homebrew/test/livecheck/strategy/electron_builder_spec.rb
@@ -7,7 +7,7 @@ subject(:electron_builder) { described_class } let(:valid_url) { "https://www.example.com/example/latest-mac.yml" } - let(:invalid_url) { "https://www.example.com/example/example" } + let(:invalid_url) { "https://brew.sh/test" } let(:electron_builder_yaml) { <<~EOS @@ -46,5 +46,13 @@ it "returns a version string when given YAML data" do expect(version_from_electron_builder_yaml).to be_a(String) end + + it "returns a version string when given YAML data and a block" do + version = electron_builder.version_from_content(electron_builder_yaml) do |yaml| + yaml["version"].sub("3", "4") + end + + expect(version).to eq "1.2.4" + end end end
true
Other
Homebrew
brew
4e61f61a208c0074bdf60fc68b7bb0e88e67c3d7.json
utils/github: handle non-standard tap remotes
Library/Homebrew/dev-cmd/bump-cask-pr.rb
@@ -199,7 +199,8 @@ def fetch_cask(contents, version, config: nil) end def check_open_pull_requests(cask, args:) - GitHub.check_for_duplicate_pull_requests(cask.token, cask.tap.full_name, + tap_remote_repo = cask.tap.remote_repo || cask.tap.full_name + GitHub.check_for_duplicate_pull_requests(cask.token, tap_remote_repo, state: "open", file: cask.sourcefile_path.relative_path_from(cask.tap.path).to_s, args: args)
true
Other
Homebrew
brew
4e61f61a208c0074bdf60fc68b7bb0e88e67c3d7.json
utils/github: handle non-standard tap remotes
Library/Homebrew/dev-cmd/bump-formula-pr.rb
@@ -85,10 +85,10 @@ def bump_formula_pr_args def use_correct_linux_tap(formula, args:) default_origin_branch = formula.tap.path.git_origin_branch - return formula.tap.full_name, "origin", default_origin_branch, "-" if !OS.linux? || !formula.tap.core_tap? + return formula.tap.remote_repo, "origin", default_origin_branch, "-" if !OS.linux? || !formula.tap.core_tap? - tap_full_name = formula.tap.full_name.gsub("linuxbrew", "homebrew") - homebrew_core_url = "https://github.com/#{tap_full_name}" + tap_remote_repo = formula.tap.full_name.gsub("linuxbrew", "homebrew") + homebrew_core_url = "https://github.com/#{tap_remote_repo}" homebrew_core_remote = "homebrew" previous_branch = formula.tap.path.git_branch || "master" formula_path = formula.path.relative_path_from(formula.tap.path) @@ -99,7 +99,7 @@ def use_correct_linux_tap(formula, args:) ohai "git fetch #{homebrew_core_remote} HEAD #{default_origin_branch}" ohai "git cat-file -e #{full_origin_branch}:#{formula_path}" ohai "git checkout #{full_origin_branch}" - return tap_full_name, homebrew_core_remote, default_origin_branch, previous_branch + return tap_remote_repo, homebrew_core_remote, default_origin_branch, previous_branch end formula.tap.path.cd do @@ -112,7 +112,7 @@ def use_correct_linux_tap(formula, args:) if quiet_system "git", "cat-file", "-e", "#{full_origin_branch}:#{formula_path}" ohai "#{formula.full_name} exists in #{full_origin_branch}." safe_system "git", "checkout", full_origin_branch - return tap_full_name, homebrew_core_remote, default_origin_branch, previous_branch + return tap_remote_repo, homebrew_core_remote, default_origin_branch, previous_branch end end end @@ -145,11 +145,11 @@ def bump_formula_pr formula_spec = formula.stable odie "#{formula}: no stable specification found!" if formula_spec.blank? - tap_full_name, remote, remote_branch, previous_branch = use_correct_linux_tap(formula, args: args) - check_open_pull_requests(formula, tap_full_name, args: args) + tap_remote_repo, remote, remote_branch, previous_branch = use_correct_linux_tap(formula, args: args) + check_open_pull_requests(formula, tap_remote_repo, args: args) new_version = args.version - check_new_version(formula, tap_full_name, version: new_version, args: args) if new_version.present? + check_new_version(formula, tap_remote_repo, version: new_version, args: 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-") } @@ -173,10 +173,10 @@ def bump_formula_pr 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_full_name, url: new_url, args: args) if new_version.blank? + check_new_version(formula, tap_remote_repo, url: new_url, args: args) if new_version.blank? true elsif new_tag.present? && new_revision.present? - check_new_version(formula, tap_full_name, 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: args) if new_version.blank? false elsif old_hash.blank? if new_tag.blank? && new_version.blank? && new_revision.blank? @@ -191,7 +191,7 @@ def bump_formula_pr and old tag are both #{new_tag}. EOS end - check_new_version(formula, tap_full_name, 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: args) if new_version.blank? resource_path, forced_version = fetch_resource(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 @@ -218,7 +218,7 @@ def bump_formula_pr #{new_url} EOS end - check_new_version(formula, tap_full_name, url: new_url, args: args) if new_version.blank? + check_new_version(formula, tap_remote_repo, url: new_url, args: args) if new_version.blank? resource_path, forced_version = fetch_resource(formula, new_version, new_url) Utils::Tar.validate_file(resource_path) new_hash = resource_path.sha256 @@ -381,7 +381,7 @@ def bump_formula_pr commit_message: "#{formula.name} #{new_formula_version}", previous_branch: previous_branch, tap: formula.tap, - tap_full_name: tap_full_name, + tap_remote_repo: tap_remote_repo, pr_message: pr_message, } GitHub.create_bump_pr(pr_info, args: args) @@ -454,21 +454,21 @@ def formula_version(formula, contents = nil) end end - def check_open_pull_requests(formula, tap_full_name, args:) - GitHub.check_for_duplicate_pull_requests(formula.name, tap_full_name, + def check_open_pull_requests(formula, tap_remote_repo, args:) + GitHub.check_for_duplicate_pull_requests(formula.name, tap_remote_repo, state: "open", file: formula.path.relative_path_from(formula.tap.path).to_s, args: args) end - def check_new_version(formula, tap_full_name, args:, version: nil, url: nil, tag: nil) + def check_new_version(formula, tap_remote_repo, args:, version: nil, url: nil, tag: nil) if version.nil? specs = {} specs[:tag] = tag if tag.present? version = Version.detect(url, **specs) end check_throttle(formula, version) - check_closed_pull_requests(formula, tap_full_name, args: args, version: version) + check_closed_pull_requests(formula, tap_remote_repo, args: args, version: version) end def check_throttle(formula, new_version) @@ -481,9 +481,9 @@ def check_throttle(formula, new_version) odie "#{formula} should only be updated every #{throttled_rate} releases on multiples of #{throttled_rate}" end - def check_closed_pull_requests(formula, tap_full_name, args:, version:) + 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_full_name, + GitHub.check_for_duplicate_pull_requests(formula.name, tap_remote_repo, version: version, state: "closed", file: formula.path.relative_path_from(formula.tap.path).to_s,
true
Other
Homebrew
brew
4e61f61a208c0074bdf60fc68b7bb0e88e67c3d7.json
utils/github: handle non-standard tap remotes
Library/Homebrew/dev-cmd/bump.rb
@@ -170,7 +170,8 @@ def livecheck_result(formula_or_cask) end def retrieve_pull_requests(formula_or_cask, name) - pull_requests = GitHub.fetch_pull_requests(name, formula_or_cask.tap&.full_name, state: "open") + tap_remote_repo = formula_or_cask.tap&.remote_repo || formula_or_cask.tap&.full_name + pull_requests = GitHub.fetch_pull_requests(name, tap_remote_repo, state: "open") if pull_requests.try(:any?) pull_requests = pull_requests.map { |pr| "#{pr["title"]} (#{Formatter.url(pr["html_url"])})" }.join(", ") end
true
Other
Homebrew
brew
4e61f61a208c0074bdf60fc68b7bb0e88e67c3d7.json
utils/github: handle non-standard tap remotes
Library/Homebrew/tap.rb
@@ -138,6 +138,14 @@ def remote @remote ||= path.git_origin end + # The remote repository name of this {Tap}. + # e.g. `user/homebrew-repo` + def remote_repo + raise TapUnavailableError, name unless installed? + + @remote_repo ||= remote&.sub(%r{^https://github\.com/}, "")&.sub(/\.git$/, "") + end + # The default remote path to this {Tap}. sig { returns(String) } def default_remote
true
Other
Homebrew
brew
4e61f61a208c0074bdf60fc68b7bb0e88e67c3d7.json
utils/github: handle non-standard tap remotes
Library/Homebrew/test/tap_spec.rb
@@ -205,6 +205,33 @@ def setup_completion(link:) end end + describe "#remote_repo" do + it "returns the remote repository" do + setup_git_repo + + expect(homebrew_foo_tap.remote_repo).to eq("Homebrew/homebrew-foo") + expect { described_class.new("Homebrew", "bar").remote_repo }.to raise_error(TapUnavailableError) + + services_tap = described_class.new("Homebrew", "services") + services_tap.path.mkpath + services_tap.path.cd do + system "git", "init" + system "git", "remote", "add", "origin", "https://github.com/Homebrew/homebrew-bar" + end + expect(services_tap.remote_repo).to eq("Homebrew/homebrew-bar") + end + + it "returns nil if the Tap is not a Git repository" do + expect(homebrew_foo_tap.remote_repo).to be nil + end + + it "returns nil if Git is not available" do + setup_git_repo + allow(Utils::Git).to receive(:available?).and_return(false) + expect(homebrew_foo_tap.remote_repo).to be nil + end + end + specify "Git variant" do touch path/"README" setup_git_repo
true
Other
Homebrew
brew
4e61f61a208c0074bdf60fc68b7bb0e88e67c3d7.json
utils/github: handle non-standard tap remotes
Library/Homebrew/utils/github.rb
@@ -63,8 +63,8 @@ def search_code(repo: nil, user: "Homebrew", path: ["Formula", "Casks", "."], fi end end - def issues_for_formula(name, tap: CoreTap.instance, tap_full_name: tap.full_name, state: nil) - search_issues(name, repo: tap_full_name, state: state, in: "title") + def issues_for_formula(name, tap: CoreTap.instance, tap_remote_repo: tap.full_name, state: nil) + search_issues(name, repo: tap_remote_repo, state: state, in: "title") end def user @@ -410,25 +410,25 @@ def get_repo_license(user, repo) nil end - def fetch_pull_requests(name, tap_full_name, state: nil, version: nil) + def fetch_pull_requests(name, tap_remote_repo, state: nil, version: nil) if version.present? query = "#{name} #{version}" regex = /(^|\s)#{Regexp.quote(name)}(:|,|\s)(.*\s)?#{Regexp.quote(version)}(:|,|\s|$)/i else query = name regex = /(^|\s)#{Regexp.quote(name)}(:|,|\s|$)/i end - issues_for_formula(query, tap_full_name: tap_full_name, state: state).select do |pr| + issues_for_formula(query, tap_remote_repo: tap_remote_repo, state: state).select do |pr| pr["html_url"].include?("/pull/") && regex.match?(pr["title"]) end rescue API::RateLimitExceededError => e opoo e.message [] end - def check_for_duplicate_pull_requests(name, tap_full_name, state:, file:, args:, version: nil) - pull_requests = fetch_pull_requests(name, tap_full_name, state: state, version: version).select do |pr| - pr_files = API.open_rest(url_to("repos", tap_full_name, "pulls", pr["number"], "files")) + def check_for_duplicate_pull_requests(name, tap_remote_repo, state:, file:, args:, version: nil) + pull_requests = fetch_pull_requests(name, tap_remote_repo, state: state, version: version).select do |pr| + pr_files = API.open_rest(url_to("repos", tap_remote_repo, "pulls", pr["number"], "files")) pr_files.any? { |f| f["filename"] == file } end return if pull_requests.blank? @@ -450,10 +450,10 @@ def check_for_duplicate_pull_requests(name, tap_full_name, state:, file:, args:, end end - def forked_repo_info!(tap_full_name) - response = create_fork(tap_full_name) + def forked_repo_info!(tap_remote_repo) + response = create_fork(tap_remote_repo) # GitHub API responds immediately but fork takes a few seconds to be ready. - sleep 1 until check_fork_exists(tap_full_name) + sleep 1 until check_fork_exists(tap_remote_repo) remote_url = if system("git", "config", "--local", "--get-regexp", "remote\..*\.url", "git@github.com:.*") response.fetch("ssh_url") else @@ -477,7 +477,7 @@ def create_bump_pr(info, args:) branch = info[:branch_name] commit_message = info[:commit_message] previous_branch = info[:previous_branch] || "-" - tap_full_name = info[:tap_full_name] || tap.full_name + tap_remote_repo = info[:tap_remote_repo] || tap.full_name pr_message = info[:pr_message] sourcefile_path.parent.cd do @@ -504,7 +504,7 @@ def create_bump_pr(info, args:) username = tap.user else begin - remote_url, username = forked_repo_info!(tap_full_name) + remote_url, username = forked_repo_info!(tap_remote_repo) rescue *API::ERRORS => e sourcefile_path.atomic_write(old_contents) odie "Unable to fork: #{e.message}!" @@ -538,7 +538,7 @@ def create_bump_pr(info, args:) end begin - url = create_pull_request(tap_full_name, commit_message, + url = create_pull_request(tap_remote_repo, commit_message, "#{username}:#{branch}", remote_branch, pr_message)["html_url"] if args.no_browse? puts url
true
Other
Homebrew
brew
f422b6cdc4a4ee3a6fb3f353f2bc3512ef4e25e3.json
livecheck/strategy: add ElectronBuilder strategy
Library/Homebrew/livecheck/strategy.rb
@@ -147,6 +147,7 @@ def self.page_content(url) require_relative "strategy/apache" require_relative "strategy/bitbucket" require_relative "strategy/cpan" +require_relative "strategy/electron_builder" require_relative "strategy/git" require_relative "strategy/github_latest" require_relative "strategy/gnome"
true
Other
Homebrew
brew
f422b6cdc4a4ee3a6fb3f353f2bc3512ef4e25e3.json
livecheck/strategy: add ElectronBuilder strategy
Library/Homebrew/livecheck/strategy/electron_builder.rb
@@ -0,0 +1,75 @@ +# typed: false +# frozen_string_literal: true + +module Homebrew + module Livecheck + module Strategy + # The {ElectronBuilder} strategy fetches content at a URL and parses + # it as an electron-builder appcast in YAML format. + # + # @api private + class ElectronBuilder + extend T::Sig + + NICE_NAME = "electron-builder" + + # A priority of zero causes livecheck to skip the strategy. We do this + # for {ElectronBuilder} so we can selectively apply the strategy using + # `strategy :electron_builder` in a `livecheck` block. + PRIORITY = 0 + + # The `Regexp` used to determine if the strategy applies to the URL. + URL_MATCH_REGEX = %r{^https?://.+?/.+?\.yml}i.freeze + + # Whether the strategy can be applied to the provided URL. + # + # @param url [String] the URL to match against + # @return [Boolean] + sig { params(url: String).returns(T::Boolean) } + def self.match?(url) + URL_MATCH_REGEX.match?(url) + end + + # Extract version information from page content. + # + # @param content [String] the content to check + # @return [String] + sig { params(content: String).returns(T.nilable(String)) } + def self.version_from_content(content) + require "yaml" + + return unless (item = YAML.safe_load(content)) + + item["version"] + end + + # Checks the content at the URL for new versions. + # + # @param url [String] the URL of the content to check + # @param regex [Regexp] a regex used for matching versions in content + # @return [Hash] + sig { params(url: String, regex: T.nilable(Regexp)).returns(T::Hash[Symbol, T.untyped]) } + def self.find_versions(url, regex = nil, &block) + raise ArgumentError, "The #{T.must(name).demodulize} strategy does not support a regex." if regex + + match_data = { matches: {}, regex: regex, url: url } + + match_data.merge!(Strategy.page_content(url)) + content = match_data.delete(:content) + + if (item = version_from_content(content)) + match = if block + block.call(item)&.to_s + else + item + end + + match_data[:matches][match] = Version.new(match) if match + end + + match_data + end + end + end + end +end
true
Other
Homebrew
brew
f422b6cdc4a4ee3a6fb3f353f2bc3512ef4e25e3.json
livecheck/strategy: add ElectronBuilder strategy
Library/Homebrew/test/livecheck/strategy/electron_builder_spec.rb
@@ -0,0 +1,50 @@ +# typed: false +# frozen_string_literal: true + +require "livecheck/strategy/electron_builder" + +describe Homebrew::Livecheck::Strategy::ElectronBuilder do + subject(:electron_builder) { described_class } + + let(:valid_url) { "https://www.example.com/example/latest-mac.yml" } + let(:invalid_url) { "https://www.example.com/example/example" } + + let(:electron_builder_yaml) { + <<~EOS + version: 1.2.3 + files: + - url: Example-1.2.3-mac.zip + sha512: MDXR0pxozBJjxxbtUQJOnhiaiiQkryLAwtcVjlnNiz30asm/PtSxlxWKFYN3kV/kl+jriInJrGypuzajTF6XIA== + size: 92031237 + blockMapSize: 96080 + - url: Example-1.2.3.dmg + sha512: k6WRDlZEfZGZHoOfUShpHxXZb5p44DRp+FAO2FXNx2kStZvyW9VuaoB7phPMfZpcMKrzfRfncpP8VEM8OB2y9g== + size: 94972630 + path: Example-1.2.3-mac.zip + sha512: MDXR0pxozBJjxxbtUQJOnhiaiiQkryLAwtcVjlnNiz30asm/PtSxlxWKFYN3kV/kl+jriInJrGypuzajTF6XIA== + releaseDate: '2000-01-01T00:00:00.000Z' + EOS + } + + describe "::match?" do + it "returns true for any URL pointing to a YAML file" do + expect(electron_builder.match?(valid_url)).to be true + end + + it "returns false for a URL not pointing to a YAML file" do + expect(electron_builder.match?(invalid_url)).to be false + end + end + + describe "::version_from_content" do + let(:version_from_electron_builder_yaml) { electron_builder.version_from_content(electron_builder_yaml) } + + it "returns nil if content is blank" do + expect(electron_builder.version_from_content("")).to be nil + end + + it "returns a version string when given YAML data" do + expect(version_from_electron_builder_yaml).to be_a(String) + end + end +end
true
Other
Homebrew
brew
dab04e33217403ab44553308999de8e6e1c4a8c0.json
utils/popen: redirect stderr to /dev/null rather than close
Library/Homebrew/utils/popen.rb
@@ -50,7 +50,7 @@ def self.popen(args, mode, options = {}) yield pipe else - options[:err] ||= :close unless ENV["HOMEBREW_STDERR"] + options[:err] ||= "/dev/null" unless ENV["HOMEBREW_STDERR"] begin exec(*args, options) rescue Errno::ENOENT
false
Other
Homebrew
brew
14f5eb43cf9f4147a494791abd61a1c7cb0cff32.json
Render shell in issue templates. This will render nicer and use monospace in the form field.
.github/ISSUE_TEMPLATE/bug.yml
@@ -1,5 +1,5 @@ name: New issue for Reproducible Bug -about: "If you're sure it's reproducible and not just your machine: submit an issue so we can investigate." +description: "If you're sure it's reproducible and not just your machine: submit an issue so we can investigate." labels: bug issue_body: false body: @@ -8,11 +8,13 @@ body: value: Please note we will close your issue without comment if you do not fill out the issue checklist below and provide ALL the requested information. If you repeatedly fail to use the issue template, we will block you from ever submitting issues to Homebrew again. - type: textarea attributes: + render: shell label: "`brew config` output" validations: required: true - type: textarea attributes: + render: shell label: "`brew doctor` output" validations: required: true @@ -39,6 +41,7 @@ body: required: true - type: textarea attributes: + render: shell label: Step-by-step reproduction instructions (by running `brew` commands) validations: required: true
true
Other
Homebrew
brew
14f5eb43cf9f4147a494791abd61a1c7cb0cff32.json
Render shell in issue templates. This will render nicer and use monospace in the form field.
.github/ISSUE_TEMPLATE/feature.yml
@@ -1,5 +1,5 @@ name: New issue for Feature Suggestion -about: Request our thoughts on your suggestion for a new feature for Homebrew. +description: Request our thoughts on your suggestion for a new feature for Homebrew. labels: features issue_body: false body:
true
Other
Homebrew
brew
40d09f59b600606c557437b3f9bbb58fea827f26.json
Replace tab with spaces and align indent
Library/Homebrew/cmd/update.sh
@@ -664,7 +664,7 @@ EOS brew update-report "$@" return $? elif [[ -z "$HOMEBREW_UPDATE_PREINSTALL" && - -z "$HOMEBREW_QUIET" ]] + -z "$HOMEBREW_QUIET" ]] then echo "Already up-to-date." fi
false
Other
Homebrew
brew
5f92d002443a4fce6aa3d6cae6863e43282d6bd9.json
bump-cask-pr: support separate downloads for Intel and ARM
Library/Homebrew/dev-cmd/bump-cask-pr.rb
@@ -125,10 +125,28 @@ def bump_cask_pr tmp_config = cask.config tmp_url = tmp_cask.url.to_s - if new_hash.nil? && old_hash != :no_check - resource_path = fetch_resource(cask, new_version, tmp_url) - Utils::Tar.validate_file(resource_path) - new_hash = resource_path.sha256 + if old_hash != :no_check + if new_hash.nil? + resource_path = fetch_resource(cask, new_version, tmp_url) + Utils::Tar.validate_file(resource_path) + new_hash = resource_path.sha256 + end + + if tmp_contents.include?("Hardware::CPU.intel?") + other_contents = tmp_contents.gsub("Hardware::CPU.intel?", (!Hardware::CPU.intel?).to_s) + other_cask = Cask::CaskLoader.load(other_contents) + other_url = other_cask.url.to_s + other_old_hash = other_cask.sha256.to_s + + resource_path = fetch_resource(cask, new_version, other_url) + Utils::Tar.validate_file(resource_path) + other_new_hash = resource_path.sha256 + + replacement_pairs << [ + other_old_hash, + other_new_hash, + ] + end end cask.languages.each do |language|
false
Other
Homebrew
brew
a8522c6db6cb5b78f132fa782d9830cbdc32d4d0.json
test/cask/audit_spec: add test for slashes in versions
Library/Homebrew/test/cask/audit_spec.rb
@@ -1011,5 +1011,24 @@ def tmp_cask(name, text) expect(audit.cask.url.cookies).to eq "foo" => "bar" end end + + context "when the version contains a slash" do + let(:cask_token) { "foo" } + let(:cask) do + tmp_cask cask_token.to_s, <<~RUBY + cask '#{cask_token}' do + version '0.1,../../directory/traversal' + sha256 '8dd95daa037ac02455435446ec7bc737b34567afe9156af7d20b2a83805c1d8a' + url 'https://brew.sh/foo.zip' + name 'Audit' + desc 'Audit Description' + homepage 'https://brew.sh' + app 'Audit.app' + end + RUBY + end + + it { is_expected.to fail_with(%r{version should not contain '/'}) } + end end end
false
Other
Homebrew
brew
aceb02125461be3f2224fa31fa5b9c3090d5d2d7.json
Move existence check into helper script This way, it'll run as `root`, too.
Library/Homebrew/cask/pkg.rb
@@ -111,6 +111,10 @@ def special?(path) set -euo pipefail for path in "${@}"; do + if [[ ! -e "${path}" ]]; then + continue + fi + if [[ -e "${path}/.DS_Store" ]]; then /bin/rm -f "${path}/.DS_Store" fi @@ -135,8 +139,6 @@ def special?(path) sig { params(path: T.any(Pathname, T::Array[Pathname])).void } def rmdir(path) - return unless path.exist? - @command.run!( "/usr/bin/xargs", args: ["-0", "--", "/bin/bash", "-c", RMDIR_SH, "--"],
false
Other
Homebrew
brew
7a22cda8ddc5dcd8304beab7767132bd4dcdafb9.json
Fix broken rmdir script Unfortunately, the removal shell script introduced in #10860 does not handle paths very well that dont exist, e.g. * `find` runs before its `-exec` test, thus throws `find: "${path}": No such file or directory` * it seem that `/bin/rmdir` is intended to break is certain cases, thus `-f` is not desired. so, if `${path}` does not exist, it'll still break, which is most likely not one of those cases. This change reintroduces a check for existence. This way, it is ensured that there is actually a directory to be removed when invoking the script.
Library/Homebrew/cask/pkg.rb
@@ -135,6 +135,8 @@ def special?(path) sig { params(path: T.any(Pathname, T::Array[Pathname])).void } def rmdir(path) + return unless path.exist? + @command.run!( "/usr/bin/xargs", args: ["-0", "--", "/bin/bash", "-c", RMDIR_SH, "--"],
false
Other
Homebrew
brew
7fc52d20655522f7d984174b37c675796ee1abad.json
github_packages: fix HOMEBREW_BOTTLE_DOMAIN usage. This still worked but ended up always having a `/bottles-*/` part of the URL that was unnecessary when using `HOMEBREW_BOTTLE_DOMAIN`.
Library/Homebrew/github_packages.rb
@@ -13,7 +13,8 @@ class GitHubPackages include Context include Utils::Curl - URL_REGEX = %r{https://ghcr.io/v2/([\w-]+)/([\w-]+)}.freeze + URL_PREFIX = "https://ghcr.io/v2/" + URL_REGEX = %r{#{Regexp.escape(URL_PREFIX)}([\w-]+)/([\w-]+)}.freeze sig { returns(String) } def inspect
true
Other
Homebrew
brew
7fc52d20655522f7d984174b37c675796ee1abad.json
github_packages: fix HOMEBREW_BOTTLE_DOMAIN usage. This still worked but ended up always having a `/bottles-*/` part of the URL that was unnecessary when using `HOMEBREW_BOTTLE_DOMAIN`.
Library/Homebrew/software_spec.rb
@@ -379,7 +379,11 @@ def prefix=(prefix) def root_url(var = nil, specs = {}) if var.nil? - @root_url ||= "#{Homebrew::EnvConfig.bottle_domain}/#{Utils::Bottles::Bintray.repository(tap)}" + @root_url ||= if Homebrew::EnvConfig.bottle_domain.start_with?(GitHubPackages::URL_PREFIX) + "#{GitHubPackages::URL_PREFIX}#{tap.full_name}" + else + "#{Homebrew::EnvConfig.bottle_domain}/#{Utils::Bottles::Bintray.repository(tap)}" + end else @root_url = var @root_url_specs.merge!(specs)
true
Other
Homebrew
brew
1a4874dc6253f2eb2d077fbfc40ae88457a4ba40.json
Simplify package uninstallation.
Library/Homebrew/cask/pkg.rb
@@ -32,9 +32,7 @@ def uninstall odebug "Deleting pkg files" @command.run!( "/usr/bin/xargs", - args: [ - "-0", "--", "/bin/rm", "--" - ], + args: ["-0", "--", "/bin/rm", "--"], input: pkgutil_bom_files.join("\0"), sudo: true, ) @@ -44,29 +42,18 @@ def uninstall odebug "Deleting pkg symlinks and special files" @command.run!( "/usr/bin/xargs", - args: [ - "-0", "--", "/bin/rm", "--" - ], + args: ["-0", "--", "/bin/rm", "--"], input: pkgutil_bom_specials.join("\0"), sudo: true, ) end unless pkgutil_bom_dirs.empty? odebug "Deleting pkg directories" - deepest_path_first(pkgutil_bom_dirs).each do |dir| - with_full_permissions(dir) do - clean_broken_symlinks(dir) - clean_ds_store(dir) - rmdir(dir) - end - end + rmdir(deepest_path_first(pkgutil_bom_dirs)) end - if root.directory? && !MacOS.undeletable?(root) - clean_ds_store(root) - rmdir(root) - end + rmdir(root) unless MacOS.undeletable?(root) forget end @@ -118,55 +105,47 @@ def special?(path) path.symlink? || path.chardev? || path.blockdev? end - sig { params(path: Pathname).void } + # Helper script to delete empty directories after deleting `.DS_Store` files and broken symlinks. + # Needed in order to execute all file operations with `sudo`. + RMDIR_SH = <<~'BASH' + set -euo pipefail + + for path in "${@}"; do + if [[ -e "${path}/.DS_Store" ]]; then + /bin/rm -f "${path}/.DS_Store" + fi + + # Some packages leave broken symlinks around; we clean them out before + # attempting to `rmdir` to prevent extra cruft from accumulating. + /usr/bin/find "${path}" -mindepth 1 -maxdepth 1 -type l ! -exec /bin/test -e {} \; -delete + + if [[ -L "${path}" ]]; then + # Delete directory symlink. + /bin/rm "${path}" + elif [[ -d "${path}" ]]; then + # Delete directory if empty. + /usr/bin/find "${path}" -maxdepth 0 -type d -empty -exec /bin/rmdir {} \; + else + # Try `rmdir` anyways to show a proper error. + /bin/rmdir "${path}" + fi + done + BASH + private_constant :RMDIR_SH + + sig { params(path: T.any(Pathname, T::Array[Pathname])).void } def rmdir(path) - return unless path.children.empty? - - if path.symlink? - @command.run!("/bin/rm", args: ["-f", "--", path], sudo: true) - else - @command.run!("/bin/rmdir", args: ["--", path], sudo: true) - end - end - - sig { params(path: Pathname, _block: T.proc.void).void } - def with_full_permissions(path, &_block) - original_mode = (path.stat.mode % 01000).to_s(8) - original_flags = @command.run!("/usr/bin/stat", args: ["-f", "%Of", "--", path]).stdout.chomp - - @command.run!("/bin/chmod", args: ["--", "777", path], sudo: true) - yield - ensure - if path.exist? # block may have removed dir - @command.run!("/bin/chmod", args: ["--", original_mode, path], sudo: true) - @command.run!("/usr/bin/chflags", args: ["--", original_flags, path], sudo: true) - end + @command.run!( + "/usr/bin/xargs", + args: ["-0", "--", "/bin/bash", "-c", RMDIR_SH, "--"], + input: Array(path).join("\0"), + sudo: true, + ) end sig { params(paths: T::Array[Pathname]).returns(T::Array[Pathname]) } def deepest_path_first(paths) paths.sort_by { |path| -path.to_s.split(File::SEPARATOR).count } end - - sig { params(dir: Pathname).void } - def clean_ds_store(dir) - return unless (ds_store = dir.join(".DS_Store")).exist? - - @command.run!("/bin/rm", args: ["--", ds_store], sudo: true) - end - - # Some packages leave broken symlinks around; we clean them out before - # attempting to `rmdir` to prevent extra cruft from accumulating. - sig { params(dir: Pathname).void } - def clean_broken_symlinks(dir) - dir.children.select(&method(:broken_symlink?)).each do |path| - @command.run!("/bin/rm", args: ["--", path], sudo: true) - end - end - - sig { params(path: Pathname).returns(T::Boolean) } - def broken_symlink?(path) - path.symlink? && !path.exist? - end end end
true
Other
Homebrew
brew
1a4874dc6253f2eb2d077fbfc40ae88457a4ba40.json
Simplify package uninstallation.
Library/Homebrew/test/cask/pkg_spec.rb
@@ -93,6 +93,15 @@ allow(pkg).to receive(:root).and_return(fake_root) allow(pkg).to receive(:forget) + # This is expected to fail in tests since we don't use `sudo`. + allow(fake_system_command).to receive(:run!).and_call_original + expect(fake_system_command).to receive(:run!).with( + "/usr/bin/xargs", + args: ["-0", "--", "/bin/bash", "-c", a_string_including("/bin/rmdir"), "--"], + input: [fake_dir].join("\0"), + sudo: true, + ).and_return(instance_double(SystemCommand::Result, stdout: "")) + pkg.uninstall expect(fake_dir).to be_a_directory
true
Other
Homebrew
brew
fa8b80747ac6e33904b1b6e2b95232aa22bf90d5.json
test/formula_installer_spec: add tests for cyclic deps
Library/Homebrew/test/formula_installer_spec.rb
@@ -96,40 +96,97 @@ def temporary_install(formula, **options) end end - specify "check installation sanity pinned dependency" do - dep_name = "dependency" - dep_path = CoreTap.new.formula_dir/"#{dep_name}.rb" - dep_path.write <<~RUBY - class #{Formulary.class_s(dep_name)} < Formula - url "foo" - version "0.2" - end - RUBY + describe "#check_install_sanity" do + it "raises on direct cyclic dependency" do + ENV["HOMEBREW_DEVELOPER"] = "1" - Formulary.cache.delete(dep_path) - dependency = Formulary.factory(dep_name) + dep_name = "homebrew-test-cyclic" + dep_path = CoreTap.new.formula_dir/"#{dep_name}.rb" + dep_path.write <<~RUBY + class #{Formulary.class_s(dep_name)} < Formula + url "foo" + version "0.1" + depends_on "#{dep_name}" + end + RUBY + Formulary.cache.delete(dep_path) + f = Formulary.factory(dep_name) + + fi = described_class.new(f) + + expect { + fi.check_install_sanity + }.to raise_error(CannotInstallFormulaError) + end - dependent = formula do - url "foo" - version "0.5" - depends_on dependency.name.to_s + it "raises on indirect cyclic dependency" do + ENV["HOMEBREW_DEVELOPER"] = "1" + + formula1_name = "homebrew-test-formula1" + formula2_name = "homebrew-test-formula2" + formula1_path = CoreTap.new.formula_dir/"#{formula1_name}.rb" + formula1_path.write <<~RUBY + class #{Formulary.class_s(formula1_name)} < Formula + url "foo" + version "0.1" + depends_on "#{formula2_name}" + end + RUBY + Formulary.cache.delete(formula1_path) + formula1 = Formulary.factory(formula1_name) + + formula2_path = CoreTap.new.formula_dir/"#{formula2_name}.rb" + formula2_path.write <<~RUBY + class #{Formulary.class_s(formula2_name)} < Formula + url "foo" + version "0.1" + depends_on "#{formula1_name}" + end + RUBY + Formulary.cache.delete(formula2_path) + + fi = described_class.new(formula1) + + expect { + fi.check_install_sanity + }.to raise_error(CannotInstallFormulaError) end - (dependency.prefix("0.1")/"bin"/"a").mkpath - HOMEBREW_PINNED_KEGS.mkpath - FileUtils.ln_s dependency.prefix("0.1"), HOMEBREW_PINNED_KEGS/dep_name + it "raises on pinned dependency" do + dep_name = "homebrew-test-dependency" + dep_path = CoreTap.new.formula_dir/"#{dep_name}.rb" + dep_path.write <<~RUBY + class #{Formulary.class_s(dep_name)} < Formula + url "foo" + version "0.2" + end + RUBY - dependency_keg = Keg.new(dependency.prefix("0.1")) - dependency_keg.link + Formulary.cache.delete(dep_path) + dependency = Formulary.factory(dep_name) - expect(dependency_keg).to be_linked - expect(dependency).to be_pinned + dependent = formula do + url "foo" + version "0.5" + depends_on dependency.name.to_s + end - fi = described_class.new(dependent) + (dependency.prefix("0.1")/"bin"/"a").mkpath + HOMEBREW_PINNED_KEGS.mkpath + FileUtils.ln_s dependency.prefix("0.1"), HOMEBREW_PINNED_KEGS/dep_name - expect { - fi.check_install_sanity - }.to raise_error(CannotInstallFormulaError) + dependency_keg = Keg.new(dependency.prefix("0.1")) + dependency_keg.link + + expect(dependency_keg).to be_linked + expect(dependency).to be_pinned + + fi = described_class.new(dependent) + + expect { + fi.check_install_sanity + }.to raise_error(CannotInstallFormulaError) + end end specify "install fails with BuildError when a system() call fails" do
false
Other
Homebrew
brew
0ad4d8162961f19ae71eb6380fb65207f1ae6b9f.json
Update RBI files for rubocop-sorbet.
Library/Homebrew/sorbet/rbi/gems/rubocop-sorbet@0.6.0.rbi
@@ -72,27 +72,30 @@ RuboCop::Cop::Sorbet::EnforceSigilOrder::MAGIC_REGEX = T.let(T.unsafe(nil), Rege RuboCop::Cop::Sorbet::EnforceSigilOrder::PREFERRED_ORDER = T.let(T.unsafe(nil), Hash) class RuboCop::Cop::Sorbet::EnforceSignatures < ::RuboCop::Cop::Sorbet::SignatureCop + def initialize(config = T.unsafe(nil), options = T.unsafe(nil)); end + def accessor?(param0 = T.unsafe(nil)); end def autocorrect(node); end + def on_block(node); end def on_def(node); end def on_defs(node); end def on_send(node); end + def scope(node); end private def check_node(node); end def param_type_placeholder; end - def previous_node(node); end def return_type_placeholder; end end class RuboCop::Cop::Sorbet::EnforceSignatures::SigSuggestion def initialize(indent, param_placeholder, return_placeholder); end def params; end - def params=(_); end + def params=(_arg0); end def returns; end - def returns=(_); end + def returns=(_arg0); end def to_autocorrect; end private @@ -105,13 +108,26 @@ class RuboCop::Cop::Sorbet::FalseSigil < ::RuboCop::Cop::Sorbet::HasSigil def minimum_strictness; end end +class RuboCop::Cop::Sorbet::ForbidExtendTSigHelpersInShims < ::RuboCop::Cop::Cop + include(::RuboCop::Cop::RangeHelp) + + def autocorrect(node); end + def extend_t_helpers?(param0 = T.unsafe(nil)); end + def extend_t_sig?(param0 = T.unsafe(nil)); end + def on_send(node); end +end + +RuboCop::Cop::Sorbet::ForbidExtendTSigHelpersInShims::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Sorbet::ForbidExtendTSigHelpersInShims::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + class RuboCop::Cop::Sorbet::ForbidIncludeConstLiteral < ::RuboCop::Cop::Cop - def initialize(*_); end + def initialize(*_arg0); end def not_lit_const_include?(param0 = T.unsafe(nil)); end def on_send(node); end def used_names; end - def used_names=(_); end + def used_names=(_arg0); end end RuboCop::Cop::Sorbet::ForbidIncludeConstLiteral::MSG = T.let(T.unsafe(nil), String) @@ -150,6 +166,22 @@ class RuboCop::Cop::Sorbet::KeywordArgumentOrdering < ::RuboCop::Cop::Sorbet::Si def check_order_for_kwoptargs(parameters); end end +class RuboCop::Cop::Sorbet::OneAncestorPerLine < ::RuboCop::Cop::Cop + def abstract?(param0); end + def autocorrect(node); end + def more_than_one_ancestor(param0 = T.unsafe(nil)); end + def on_class(node); end + def on_module(node); end + def requires_ancestors(param0); end + + private + + def new_ra_line(indent_count); end + def process_node(node); end +end + +RuboCop::Cop::Sorbet::OneAncestorPerLine::MSG = T.let(T.unsafe(nil), String) + class RuboCop::Cop::Sorbet::ParametersOrderingInSignature < ::RuboCop::Cop::Sorbet::SignatureCop def on_signature(node); end def signature_params(param0); end @@ -169,7 +201,7 @@ class RuboCop::Cop::Sorbet::SignatureBuildOrder < ::RuboCop::Cop::Sorbet::Signat def call_chain(sig_child_node); end def can_autocorrect?; end - def node_with_index_sends(node); end + def node_reparsed_with_modern_features(node); end end RuboCop::Cop::Sorbet::SignatureBuildOrder::ORDER = T.let(T.unsafe(nil), Hash) @@ -180,6 +212,19 @@ class RuboCop::Cop::Sorbet::SignatureCop < ::RuboCop::Cop::Cop def signature?(param0 = T.unsafe(nil)); end end +class RuboCop::Cop::Sorbet::SingleLineRbiClassModuleDefinitions < ::RuboCop::Cop::Cop + def autocorrect(node); end + def on_class(node); end + def on_module(node); end + + protected + + def convert_newlines(source); end + def process_node(node); end +end + +RuboCop::Cop::Sorbet::SingleLineRbiClassModuleDefinitions::MSG = T.let(T.unsafe(nil), String) + class RuboCop::Cop::Sorbet::StrictSigil < ::RuboCop::Cop::Sorbet::HasSigil def minimum_strictness; end end
false
Other
Homebrew
brew
7a19eed48d715a9d4456b435b20283123f8f37c0.json
update-python-resources: include wheel in resources
Library/Homebrew/utils/pypi.rb
@@ -182,7 +182,7 @@ def update_python_resources!(formula, version: nil, package_name: nil, extra_pac extra_packages = (extra_packages || []).map { |p| Package.new p } exclude_packages = (exclude_packages || []).map { |p| Package.new p } - exclude_packages += %W[#{main_package.name} argparse pip setuptools wheel wsgiref].map { |p| Package.new p } + exclude_packages += %W[#{main_package.name} argparse pip setuptools wsgiref].map { |p| Package.new p } # remove packages from the exclude list if we've explicitly requested them as an extra package exclude_packages.delete_if { |package| extra_packages.include?(package) }
false
Other
Homebrew
brew
0e97793f9196279ef44d327571cf31617da2195e.json
test/completions: modify tests for zsh completions
Library/Homebrew/test/completions_spec.rb
@@ -321,7 +321,8 @@ def delete_completions_setting(setting: "linkcompletions") '--hide[Act as if none of the specified hidden are installed. hidden should be a comma-separated list of formulae]' \\ '--quiet[Make some output more quiet]' \\ '--verbose[Make some output more verbose]' \\ - '::formula:__brew_formulae' + - formula \\ + '*::formula:__brew_formulae' } COMPLETION end @@ -343,9 +344,12 @@ def delete_completions_setting(setting: "linkcompletions") end it "returns appropriate completion for a command with multiple named arg types" do - completion = described_class.generate_zsh_subcommand_completion("upgrade") + completion = described_class.generate_zsh_subcommand_completion("livecheck") expect(completion).to match( - /'::outdated_formula:__brew_outdated_formulae' \\\n '::outdated_cask:__brew_outdated_casks'\n}$/, + /'*::formula:__brew_formulae'/, + ) + expect(completion).to match( + /'*::cask:__brew_casks'\n}$/, ) end end
false
Other
Homebrew
brew
b66b461811d50519af23ca59ee5da7154655328d.json
Expand quiet checks in update and update-report
Library/Homebrew/cmd/update-report.rb
@@ -129,15 +129,15 @@ def update_report if hub.empty? puts_stdout_or_stderr "No changes to formulae." unless args.quiet? else - hub.dump(updated_formula_report: !args.preinstall?) + hub.dump(updated_formula_report: !args.preinstall?) unless args.quiet? hub.reporters.each(&:migrate_tap_migration) hub.reporters.each { |r| r.migrate_formula_rename(force: args.force?, verbose: args.verbose?) } CacheStoreDatabase.use(:descriptions) do |db| DescriptionCacheStore.new(db) .update_from_report!(hub) end - unless args.preinstall? + if !args.preinstall? && !args.quiet? outdated_formulae = Formula.installed.count(&:outdated?) outdated_casks = Cask::Caskroom.casks.count(&:outdated?) update_pronoun = if (outdated_formulae + outdated_casks) == 1
true
Other
Homebrew
brew
b66b461811d50519af23ca59ee5da7154655328d.json
Expand quiet checks in update and update-report
Library/Homebrew/cmd/update.sh
@@ -308,13 +308,15 @@ homebrew-update() { -\?|-h|--help|--usage) brew help update; exit $? ;; --verbose) HOMEBREW_VERBOSE=1 ;; --debug) HOMEBREW_DEBUG=1 ;; + --quiet) HOMEBREW_QUIET=1 ;; --merge) HOMEBREW_MERGE=1 ;; --force) HOMEBREW_UPDATE_FORCE=1 ;; --simulate-from-current-branch) HOMEBREW_SIMULATE_FROM_CURRENT_BRANCH=1 ;; --preinstall) export HOMEBREW_UPDATE_PREINSTALL=1 ;; --*) ;; -*) [[ "$option" = *v* ]] && HOMEBREW_VERBOSE=1 + [[ "$option" = *q* ]] && HOMEBREW_QUIET=1 [[ "$option" = *d* ]] && HOMEBREW_DEBUG=1 [[ "$option" = *f* ]] && HOMEBREW_UPDATE_FORCE=1 ;; @@ -661,7 +663,8 @@ EOS then brew update-report "$@" return $? - elif [[ -z "$HOMEBREW_UPDATE_PREINSTALL" ]] + elif [[ -z "$HOMEBREW_UPDATE_PREINSTALL" && + -z "$HOMEBREW_QUIET" ]] then echo "Already up-to-date." fi
true
Other
Homebrew
brew
721949bf94b4020ac2c791f1320a6357b21e6a37.json
sorbet: Update RBI files. Autogenerated by the [sorbet](https://github.com/Homebrew/brew/blob/master/.github/workflows/sorbet.yml) workflow.
Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi
@@ -7990,6 +7990,11 @@ module GitHub::Actions extend ::T::Private::Methods::SingletonMethodHooks end +class GitHubPackages + extend ::T::Private::Methods::MethodHooks + extend ::T::Private::Methods::SingletonMethodHooks +end + class GitHubReleases extend ::T::Private::Methods::MethodHooks extend ::T::Private::Methods::SingletonMethodHooks @@ -8203,6 +8208,10 @@ module Homebrew::EnvConfig def self.github_api_token(); end + def self.github_packages_token(); end + + def self.github_packages_user(); end + def self.http_proxy(); end def self.https_proxy(); end
false
Other
Homebrew
brew
267040e5df2ea6981d07e4f1d39a26a4c46eee5c.json
bugfix: Add args and options to lazy url block
Library/Homebrew/cask/dsl.rb
@@ -181,7 +181,11 @@ def url(*args, **options) set_unique_stanza(:url, args.empty? && options.empty? && !block_given?) do if block_given? - LazyObject.new { URL.new(*yield, from_block: true, caller_location: caller_location) } + LazyObject.new do + *args = yield + options = args.last.is_a?(Hash) ? args.pop : {} + URL.new(*args, **options, from_block: true, caller_location: caller_location) + end else URL.new(*args, **options, caller_location: caller_location) end
true
Other
Homebrew
brew
267040e5df2ea6981d07e4f1d39a26a4c46eee5c.json
bugfix: Add args and options to lazy url block
Library/Homebrew/test/cask/audit_spec.rb
@@ -981,5 +981,35 @@ def tmp_cask(name, text) it { is_expected.to fail_with(/a homepage stanza is required/) } end + + context "when url is lazy" do + let(:strict) { true } + let(:cask_token) { "with-lazy" } + let(:cask) do + tmp_cask cask_token.to_s, <<~RUBY + cask '#{cask_token}' do + version '1.8.0_72,8.13.0.5' + sha256 '8dd95daa037ac02455435446ec7bc737b34567afe9156af7d20b2a83805c1d8a' + url do + ['https://brew.sh/foo.zip', {referer: 'https://example.com', cookies: {'foo' => 'bar'}}] + end + name 'Audit' + desc 'Audit Description' + homepage 'https://brew.sh' + app 'Audit.app' + end + RUBY + end + + it { is_expected.to pass } + + it "receives a referer" do + expect(audit.cask.url.referer).to eq "https://example.com" + end + + it "receives cookies" do + expect(audit.cask.url.cookies).to eq "foo" => "bar" + end + end end end
true
Other
Homebrew
brew
7d8970213c8d82effb46bc57a1a7c49da188eeee.json
Update RBI files for nokogiri.
Library/Homebrew/sorbet/rbi/gems/nokogiri@1.11.2.rbi
@@ -621,9 +621,11 @@ class Nokogiri::VersionInfo def libxml2_using_system?; end def loaded_libxml_version; end def loaded_libxslt_version; end + def ruby_minor; end def to_hash; end def to_markdown; end def warnings; end + def windows?; end class << self def instance; end @@ -1405,10 +1407,6 @@ class Nokogiri::XML::Reader def value?; end def xml_version; end - private - - def attr_nodes; end - class << self def from_io(*_arg0); end def from_memory(*_arg0); end @@ -1620,9 +1618,7 @@ Nokogiri::XML::XML_C14N_1_1 = T.let(T.unsafe(nil), Integer) Nokogiri::XML::XML_C14N_EXCLUSIVE_1_0 = T.let(T.unsafe(nil), Integer) -class Nokogiri::XML::XPath - def document; end - def document=(_arg0); end +module Nokogiri::XML::XPath end class Nokogiri::XML::XPath::SyntaxError < ::Nokogiri::XML::SyntaxError
false
Other
Homebrew
brew
75aa24fac990cef78cb63bc012d7fb1759a6d074.json
sorbet: Update RBI files. Autogenerated by the [sorbet](https://github.com/Homebrew/brew/blob/master/.github/workflows/sorbet.yml) workflow.
Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi
@@ -7990,6 +7990,11 @@ module GitHub::Actions extend ::T::Private::Methods::SingletonMethodHooks end +class GitHubReleases + extend ::T::Private::Methods::MethodHooks + extend ::T::Private::Methods::SingletonMethodHooks +end + module GitRepositoryExtension extend ::T::Private::Methods::MethodHooks extend ::T::Private::Methods::SingletonMethodHooks
false
Other
Homebrew
brew
e64f2d1fd49a2a689443f5654cf47bc431f0c155.json
test/exceptions_spec: add test for TapFormulaOrCaskUnavailableError
Library/Homebrew/test/exceptions_spec.rb
@@ -34,6 +34,14 @@ } end + describe TapFormulaOrCaskUnavailableError do + subject(:error) { described_class.new(tap, "foo") } + + let(:tap) { double(Tap, user: "u", repo: "r", to_s: "u/r", installed?: false) } + + its(:to_s) { is_expected.to match(%r{Please tap it and then try again: brew tap u/r}) } + end + describe FormulaUnavailableError do subject(:error) { described_class.new("foo") }
false
Other
Homebrew
brew
8c309d288664d36d79a8b6d2cf8808943d8f8544.json
Update RBI files for tapioca.
Library/Homebrew/sorbet/rbi/gems/parlour@6.0.0.rbi
@@ -420,8 +420,8 @@ class Parlour::RbiGenerator::Namespace < ::Parlour::RbiGenerator::RbiObject def merge_into_self(others); end sig { overridable.override.params(others: T::Array[Parlour::RbiGenerator::RbiObject]).returns(T::Boolean) } def mergeable?(others); end - sig { params(object: T.untyped, block: T.proc.params(x: Parlour::RbiGenerator::Namespace).void).void } - def path(object, &block); end + sig { params(constant: Module, block: T.proc.params(x: Parlour::RbiGenerator::Namespace).void).void } + def path(constant, &block); end sig { returns(T::Boolean) } def sealed; end def type_aliases(*args, &blk); end
true
Other
Homebrew
brew
8c309d288664d36d79a8b6d2cf8808943d8f8544.json
Update RBI files for tapioca.
Library/Homebrew/sorbet/rbi/gems/tapioca@0.4.16.rbi
@@ -126,6 +126,8 @@ module Tapioca::Compilers::Sorbet end end +Tapioca::Compilers::Sorbet::EXE_PATH_ENV_VAR = T.let(T.unsafe(nil), String) + Tapioca::Compilers::Sorbet::SORBET = T.let(T.unsafe(nil), Pathname) module Tapioca::Compilers::SymbolTable @@ -162,6 +164,8 @@ class Tapioca::Compilers::SymbolTable::SymbolGenerator def compile_constant(name, constant); end sig { params(module_name: String, mod: Module, for_visibility: T::Array[Symbol]).returns(String) } def compile_directly_owned_methods(module_name, mod, for_visibility = T.unsafe(nil)); end + sig { params(constant: Module).returns(String) } + def compile_enums(constant); end sig { params(symbol_name: String, constant: Module, method: T.nilable(UnboundMethod)).returns(T.nilable(String)) } def compile_method(symbol_name, constant, method); end sig { params(name: String, constant: Module).returns(T.nilable(String)) } @@ -449,16 +453,20 @@ class Tapioca::Generator < ::Thor::Shell::Color def added_rbis; end sig { returns(Tapioca::Gemfile) } def bundle; end - sig { params(constant: Module, contents: String).void } + sig { params(constant: Module, contents: String).returns(T.nilable(Pathname)) } def compile_dsl_rbi(constant, contents); end sig { params(gem: Tapioca::Gemfile::Gem).void } def compile_gem_rbi(gem); end sig { returns(Tapioca::Compilers::SymbolTableCompiler) } def compiler; end sig { params(constant_names: T::Array[String]).returns(T::Array[Module]) } def constantize(constant_names); end + sig { params(constant_name: String).returns(Pathname) } + def dsl_rbi_filename(constant_name); end sig { params(gem_name: String).returns(Pathname) } def existing_rbi(gem_name); end + sig { params(requested_constants: T::Array[String]).returns(T::Set[Pathname]) } + def existing_rbi_filenames(requested_constants); end sig { returns(T::Hash[String, String]) } def existing_rbis; end sig { params(gem_name: String).returns(Pathname) }
true
Other
Homebrew
brew
24af65302dafb7d554ff0adbc2593f070096f7b0.json
add pcsc-lite to uses_from_macos
Library/Homebrew/rubocops/uses_from_macos.rb
@@ -42,6 +42,7 @@ class ProvidedByMacos < FormulaCop netcat openldap openlibm + pcsc-lite pod2man rpcgen ruby
false
Other
Homebrew
brew
9cc93154a0a29ae517f9829df2fd261b419782c9.json
dev-cmd/create: add link to std_configure_args
Library/Homebrew/formula_creator.rb
@@ -156,6 +156,7 @@ def install system "cmake", ".", *std_cmake_args <% elsif mode == :autotools %> # Remove unrecognized options if warned by configure + # https://rubydoc.brew.sh/Formula.html#std_configure_args-instance_method system "./configure", *std_configure_args, "--disable-silent-rules" <% elsif mode == :crystal %> system "shards", "build", "--release" @@ -203,6 +204,7 @@ def install system "cargo", "install", *std_cargo_args <% else %> # Remove unrecognized options if warned by configure + # https://rubydoc.brew.sh/Formula.html#std_configure_args-instance_method system "./configure", *std_configure_args, "--disable-silent-rules" # system "cmake", ".", *std_cmake_args <% end %>
false
Other
Homebrew
brew
96670cedb2e84f4f741c514d0b1c3e15ef3106eb.json
formula_installer: reduce dependency expansion computations
Library/Homebrew/formula_installer.rb
@@ -517,9 +517,11 @@ def check_conflicts # Compute and collect the dependencies needed by the formula currently # being installed. def compute_dependencies - req_map, req_deps = expand_requirements - check_requirements(req_map) - expand_dependencies(req_deps + formula.deps) + @compute_dependencies ||= begin + req_map, req_deps = expand_requirements + check_requirements(req_map) + expand_dependencies(req_deps + formula.deps) + end end def unbottled_dependencies(deps) @@ -1232,10 +1234,9 @@ def forbidden_license_check end return if forbidden_licenses.blank? + return if ignore_deps? compute_dependencies.each do |dep, _| - next if @ignore_deps - dep_f = dep.to_formula next unless SPDX.licenses_forbid_installation? dep_f.license, forbidden_licenses @@ -1244,7 +1245,8 @@ def forbidden_license_check #{SPDX.license_expression_to_string dep_f.license}. EOS end - return if @only_deps + + return if only_deps? return unless SPDX.licenses_forbid_installation? formula.license, forbidden_licenses
false
Other
Homebrew
brew
e7dba1b0712846c4c5f7c5d6ab1c8fa830168135.json
sorbet: Update RBI files. Autogenerated by the [sorbet](https://github.com/Homebrew/brew/blob/master/.github/workflows/sorbet.yml) workflow.
Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi
@@ -26904,11 +26904,6 @@ class RuboCop::Cop::FormulaCop def required_dependency_name?(param0, param1); end end -class RuboCop::Cop::Style::UnlessMultipleConditions - extend ::T::Private::Methods::MethodHooks - extend ::T::Private::Methods::SingletonMethodHooks -end - module RuboCop::RSpec::ExpectOffense def expect_correction(correction, loop: T.unsafe(nil), source: T.unsafe(nil)); end
false
Other
Homebrew
brew
3f64bcb2fbffc663be53b1739c1e6009be9db055.json
docs/Installation: add section for Git remote mirroring
docs/Installation.md
@@ -18,6 +18,18 @@ it does it too. You have to confirm everything it will do before it starts. [Xcode](https://itunes.apple.com/us/app/xcode/id497799835) <sup>[3](#3)</sup> * A Bourne-compatible shell for installation (e.g. `bash` or `zsh`) <sup>[4](#4)</sup> +## Git Remote Mirroring + +You can set `HOMEBREW_BREW_GIT_REMOTE` and/or `HOMEBREW_CORE_GIT_REMOTE` in your shell environment to use geolocalized Git mirrors to speed up Homebrew's installation with this script and, after installation, `brew update`. + +```bash +export HOMEBREW_BREW_GIT_REMOTE="..." # put your Git mirror of Homebrew/brew here +export HOMEBREW_CORE_GIT_REMOTE="..." # put your Git mirror of Homebrew/homebrew-core here +/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" +``` + +The default Git remote will be used if the corresponding environment variable is unset. + ## Alternative Installs ### Linux or Windows 10 Subsystem for Linux
false
Other
Homebrew
brew
8ddf9b37bdbf36c8c13941b343c53f86aac9b861.json
Apply suggestions from code review Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
Library/Homebrew/dev-cmd/bump.rb
@@ -40,16 +40,16 @@ def bump raise UsageError, "`--limit` must be used with either `--formula` or `--cask`." end - formulae_and_casks = - if args.formula? - args.named.to_formulae - elsif args.cask? - args.named.to_casks - else - args.named.to_formulae_and_casks - end&.sort_by do |formula_or_cask| - formula_or_cask.respond_to?(:token) ? formula_or_cask.token : formula_or_cask.name - end + formulae_and_casks = if args.formula? + args.named.to_formulae + elsif args.cask? + args.named.to_casks + else + args.named.to_formulae_and_casks + end + formulae_and_casks = formulae_and_casks&.sort_by do |formula_or_cask| + formula_or_cask.respond_to?(:token) ? formula_or_cask.token : formula_or_cask.name + end limit = args.limit.to_i if args.limit.present? @@ -58,19 +58,20 @@ def bump ambiguous_casks = [] if !args.formula? && !args.cask? - ambiguous_casks = formulae_and_casks - .group_by { |item| Livecheck.formula_or_cask_name(item, full_name: true) } - .select { |_name, items| items.length > 1 } - .values.flatten - .select { |item| item.is_a?(Cask::Cask) } + ambiguous_casks = formulae_and_casks.group_by { |item| Livecheck.formula_or_cask_name(item, full_name: true) } + .values + .select { |items| items.length > 1 } + .flatten + .select { |item| item.is_a?(Cask::Cask) } end ambiguous_names = [] unless args.full_name? - ambiguous_names = (formulae_and_casks - ambiguous_casks) - .group_by { |item| Livecheck.formula_or_cask_name(item) } - .select { |_name, items| items.length > 1 } - .values.flatten + ambiguous_names = + (formulae_and_casks - ambiguous_casks).group_by { |item| Livecheck.formula_or_cask_name(item) } + .values + .select { |items| items.length > 1 } + .flatten end formulae_and_casks.each_with_index do |formula_or_cask, i| @@ -135,7 +136,7 @@ def bump end name = Livecheck.formula_or_cask_name(formula_or_cask) ambiguous_cask = begin - formula_or_cask.is_a?(Cask::Cask) && !args.cask? && Formula[name] ? true : false + formula_or_cask.is_a?(Cask::Cask) && !args.cask? && Formula[name] rescue FormulaUnavailableError false end
true
Other
Homebrew
brew
8ddf9b37bdbf36c8c13941b343c53f86aac9b861.json
Apply suggestions from code review Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
Library/Homebrew/dev-cmd/livecheck.rb
@@ -61,44 +61,44 @@ def livecheck puts ENV["HOMEBREW_LIVECHECK_WATCHLIST"] if ENV["HOMEBREW_LIVECHECK_WATCHLIST"].present? end - formulae_and_casks_to_check = - if args.tap - tap = Tap.fetch(args.tap) - formulae = args.cask? ? [] : tap.formula_files.map { |path| Formulary.factory(path) } - casks = args.formula? ? [] : tap.cask_files.map { |path| Cask::CaskLoader.load(path) } - formulae + casks - elsif args.installed? - formulae = args.cask? ? [] : Formula.installed - casks = args.formula? ? [] : Cask::Caskroom.casks - formulae + casks - elsif args.all? - formulae = args.cask? ? [] : Formula.to_a - casks = args.formula? ? [] : Cask::Cask.to_a - formulae + casks - elsif args.named.present? - if args.formula? - args.named.to_formulae - elsif args.cask? - args.named.to_casks - else - args.named.to_formulae_and_casks - end - elsif File.exist?(WATCHLIST_PATH) - begin - names = Pathname.new(WATCHLIST_PATH).read.lines - .reject { |line| line.start_with?("#") || line.blank? } - .map(&:strip) - - named_args = T.unsafe(CLI::NamedArgs).new(*names, parent: args) - named_args.to_formulae_and_casks(ignore_unavailable: true) - rescue Errno::ENOENT => e - onoe e - end + formulae_and_casks_to_check = if args.tap + tap = Tap.fetch(args.tap) + formulae = args.cask? ? [] : tap.formula_files.map { |path| Formulary.factory(path) } + casks = args.formula? ? [] : tap.cask_files.map { |path| Cask::CaskLoader.load(path) } + formulae + casks + elsif args.installed? + formulae = args.cask? ? [] : Formula.installed + casks = args.formula? ? [] : Cask::Caskroom.casks + formulae + casks + elsif args.all? + formulae = args.cask? ? [] : Formula.to_a + casks = args.formula? ? [] : Cask::Cask.to_a + formulae + casks + elsif args.named.present? + if args.formula? + args.named.to_formulae + elsif args.cask? + args.named.to_casks else - raise UsageError, "A watchlist file is required when no arguments are given." - end&.sort_by do |formula_or_cask| - formula_or_cask.respond_to?(:token) ? formula_or_cask.token : formula_or_cask.name + args.named.to_formulae_and_casks + end + elsif File.exist?(WATCHLIST_PATH) + begin + names = Pathname.new(WATCHLIST_PATH).read.lines + .reject { |line| line.start_with?("#") || line.blank? } + .map(&:strip) + + named_args = T.unsafe(CLI::NamedArgs).new(*names, parent: args) + named_args.to_formulae_and_casks(ignore_unavailable: true) + rescue Errno::ENOENT => e + onoe e end + else + raise UsageError, "A watchlist file is required when no arguments are given." + end + formulae_and_casks_to_check = formulae_and_casks_to_check.sort_by do |formula_or_cask| + formula_or_cask.respond_to?(:token) ? formula_or_cask.token : formula_or_cask.name + end raise UsageError, "No formulae or casks to check." if formulae_and_casks_to_check.blank?
true
Other
Homebrew
brew
8ddf9b37bdbf36c8c13941b343c53f86aac9b861.json
Apply suggestions from code review Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
Library/Homebrew/livecheck/livecheck.rb
@@ -105,19 +105,20 @@ def run_checks( ambiguous_casks = [] if handle_name_conflict - ambiguous_casks = formulae_and_casks_to_check - .group_by { |item| formula_or_cask_name(item, full_name: true) } - .select { |_name, items| items.length > 1 } - .values.flatten - .select { |item| item.is_a?(Cask::Cask) } + ambiguous_casks = formulae_and_casks_to_check.group_by { |item| formula_or_cask_name(item, full_name: true) } + .values + .select { |items| items.length > 1 } + .flatten + .select { |item| item.is_a?(Cask::Cask) } end ambiguous_names = [] unless full_name - ambiguous_names = (formulae_and_casks_to_check - ambiguous_casks) - .group_by { |item| formula_or_cask_name(item) } - .select { |_name, items| items.length > 1 } - .values.flatten + ambiguous_names = + (formulae_and_casks_to_check - ambiguous_casks).group_by { |item| formula_or_cask_name(item) } + .values + .select { |items| items.length > 1 } + .flatten end has_a_newer_upstream_version = T.let(false, T::Boolean)
true
Other
Homebrew
brew
7448a6be587a84ee6a6df9c5cf81c81e5f56ac82.json
Revert "Revert "uses_from_macos: fix force_homebrew_on_linux behaviour."" This reverts commit 9ad37ddc36c8438db97fdb3e4484d724e06eaffe.
Library/Homebrew/extend/os/mac/software_spec.rb
@@ -1,6 +1,8 @@ # typed: false # frozen_string_literal: true +# The Library/Homebrew/extend/os/software_spec.rb conditional logic will need to be more nuanced +# if this file ever includes more than `uses_from_macos`. class SoftwareSpec undef uses_from_macos
true
Other
Homebrew
brew
7448a6be587a84ee6a6df9c5cf81c81e5f56ac82.json
Revert "Revert "uses_from_macos: fix force_homebrew_on_linux behaviour."" This reverts commit 9ad37ddc36c8438db97fdb3e4484d724e06eaffe.
Library/Homebrew/extend/os/software_spec.rb
@@ -1,8 +1,9 @@ # typed: strict # frozen_string_literal: true -if OS.linux? - require "extend/os/linux/software_spec" -elsif OS.mac? +# This logic will need to be more nuanced if this file includes more than `uses_from_macos`. +if OS.mac? || Homebrew::EnvConfig.force_homebrew_on_linux? require "extend/os/mac/software_spec" +elsif OS.linux? + require "extend/os/linux/software_spec" end
true
Other
Homebrew
brew
e1da637f9aab7e23a5b3eb22bdf7a9f514b2fe92.json
test/hardware/cpu_spec: add missing families
Library/Homebrew/test/hardware/cpu_spec.rb
@@ -22,6 +22,12 @@ describe "::family" do let(:cpu_families) { [ + :amd_k7, + :amd_k8, + :amd_k8_k10_hybrid, + :amd_k10, + :amd_k12, + :arm, :arm_firestorm_icestorm, :arm_hurricane_zephyr, :arm_lightning_thunder, @@ -30,22 +36,29 @@ :arm_typhoon, :arm_vortex_tempest, :atom, + :bobcat, :broadwell, + :bulldozer, + :cannonlake, :core, :core2, :dothan, :haswell, :icelake, :ivybridge, + :jaguar, :kabylake, :merom, :nehalem, :penryn, + :ppc, :prescott, :presler, :sandybridge, :skylake, :westmere, + :zen, + :zen3, :dunno, ] }
false
Other
Homebrew
brew
ab0e427d3eb6ff71b6034541138348d1a5025ddd.json
Disambiguate formulae/casks from different taps
Library/Homebrew/dev-cmd/bump.rb
@@ -16,6 +16,8 @@ def bump_args Display out-of-date brew formulae and the latest version available. Also displays whether a pull request has been opened with the URL. EOS + switch "--full-name", + description: "Print formulae/casks with fully-qualified names." switch "--no-pull-requests", description: "Do not retrieve pull requests from GitHub." switch "--formula", "--formulae", @@ -63,10 +65,19 @@ def bump .select { |item| item.is_a?(Cask::Cask) } end + ambiguous_names = [] + unless args.full_name? + ambiguous_names = (formulae_and_casks - ambiguous_casks) + .group_by { |item| Livecheck.formula_or_cask_name(item) } + .select { |_name, items| items.length > 1 } + .values.flatten + end + formulae_and_casks.each_with_index do |formula_or_cask, i| puts if i.positive? - name = Livecheck.formula_or_cask_name(formula_or_cask) + use_full_name = args.full_name? || ambiguous_names.include?(formula_or_cask) + name = Livecheck.formula_or_cask_name(formula_or_cask, full_name: use_full_name) repository = if formula_or_cask.is_a?(Formula) if formula_or_cask.head_only? ohai name
true
Other
Homebrew
brew
ab0e427d3eb6ff71b6034541138348d1a5025ddd.json
Disambiguate formulae/casks from different taps
Library/Homebrew/livecheck/livecheck.rb
@@ -112,6 +112,14 @@ def run_checks( .select { |item| item.is_a?(Cask::Cask) } end + ambiguous_names = [] + unless full_name + ambiguous_names = (formulae_and_casks_to_check - ambiguous_casks) + .group_by { |item| formula_or_cask_name(item) } + .select { |_name, items| items.length > 1 } + .values.flatten + end + has_a_newer_upstream_version = T.let(false, T::Boolean) if json && !quiet && $stderr.tty? @@ -133,7 +141,9 @@ def run_checks( formulae_checked = formulae_and_casks_to_check.map.with_index do |formula_or_cask, i| formula = formula_or_cask if formula_or_cask.is_a?(Formula) cask = formula_or_cask if formula_or_cask.is_a?(Cask::Cask) - name = formula_or_cask_name(formula_or_cask, full_name: full_name) + + use_full_name = full_name || ambiguous_names.include?(formula_or_cask) + name = formula_or_cask_name(formula_or_cask, full_name: use_full_name) if debug && i.positive? puts <<~EOS @@ -145,7 +155,7 @@ def run_checks( puts end - skip_info = SkipConditions.skip_information(formula_or_cask, full_name: full_name, verbose: verbose) + skip_info = SkipConditions.skip_information(formula_or_cask, full_name: use_full_name, verbose: verbose) if skip_info.present? next skip_info if json @@ -177,7 +187,7 @@ def run_checks( else version_info = latest_version( formula_or_cask, - json: json, full_name: full_name, verbose: verbose, debug: debug, + json: json, full_name: use_full_name, verbose: verbose, debug: debug, ) version_info[:latest] if version_info.present? end @@ -188,7 +198,7 @@ def run_checks( next version_info if version_info.is_a?(Hash) && version_info[:status] && version_info[:messages] - next status_hash(formula_or_cask, "error", [no_versions_msg], full_name: full_name, verbose: verbose) + next status_hash(formula_or_cask, "error", [no_versions_msg], full_name: use_full_name, verbose: verbose) end if (m = latest.to_s.match(/(.*)-release$/)) && !current.to_s.match(/.*-release$/) @@ -237,12 +247,13 @@ def run_checks( nil rescue => e Homebrew.failed = true + use_full_name = full_name || ambiguous_names.include?(formula_or_cask) if json progress&.increment - status_hash(formula_or_cask, "error", [e.to_s], full_name: full_name, verbose: verbose) + status_hash(formula_or_cask, "error", [e.to_s], full_name: use_full_name, verbose: verbose) elsif !quiet - name = formula_or_cask_name(formula_or_cask, full_name: full_name) + name = formula_or_cask_name(formula_or_cask, full_name: use_full_name) name += " (cask)" if ambiguous_casks.include?(formula_or_cask) onoe "#{Tty.blue}#{name}#{Tty.reset}: #{e}"
true
Other
Homebrew
brew
7d5216c500a5754da766937de3d61ebf8d70d643.json
Improve formula/cask disambiguation
Library/Homebrew/dev-cmd/bump.rb
@@ -51,6 +51,15 @@ def bump if formulae_and_casks Livecheck.load_other_tap_strategies(formulae_and_casks) + ambiguous_casks = [] + if !args.formula? && !args.cask? + ambiguous_casks = formulae_and_casks + .group_by { |item| Livecheck.formula_or_cask_name(item, full_name: true) } + .select { |_name, items| items.length > 1 } + .values.flatten + .select { |item| item.is_a?(Cask::Cask) } + end + formulae_and_casks.each_with_index do |formula_or_cask, i| puts if i.positive? @@ -68,7 +77,13 @@ def bump end package_data = Repology.single_package_query(name, repository: repository) - retrieve_and_display_info(formula_or_cask, name, package_data&.values&.first, args: args) + retrieve_and_display_info( + formula_or_cask, + name, + package_data&.values&.first, + args: args, + ambiguous_cask: ambiguous_casks.include?(formula_or_cask), + ) end else api_response = {} @@ -105,9 +120,14 @@ def bump next end name = Livecheck.formula_or_cask_name(formula_or_cask) + ambiguous_cask = begin + formula_or_cask.is_a?(Cask::Cask) && !args.cask? && Formula[name] ? true : false + rescue FormulaUnavailableError + false + end puts if i.positive? - retrieve_and_display_info(formula_or_cask, name, repositories, args: args) + retrieve_and_display_info(formula_or_cask, name, repositories, args: args, ambiguous_cask: ambiguous_cask) break if limit && i >= limit end @@ -145,7 +165,7 @@ def retrieve_pull_requests(formula_or_cask, name) pull_requests end - def retrieve_and_display_info(formula_or_cask, name, repositories, args:) + def retrieve_and_display_info(formula_or_cask, name, repositories, args:, ambiguous_cask: false) current_version = if formula_or_cask.is_a?(Formula) formula_or_cask.stable.version else @@ -161,12 +181,7 @@ def retrieve_and_display_info(formula_or_cask, name, repositories, args:) livecheck_latest = livecheck_result(formula_or_cask) pull_requests = retrieve_pull_requests(formula_or_cask, name) unless args.no_pull_requests? - name += begin - (" (cask)" if formula_or_cask.is_a?(Cask::Cask) && !args.cask? && Formula[name]).to_s - rescue FormulaUnavailableError - "" - end - + name += " (cask)" if ambiguous_cask title = if current_version == repology_latest && current_version == livecheck_latest "#{name} is up to date!"
true
Other
Homebrew
brew
7d5216c500a5754da766937de3d61ebf8d70d643.json
Improve formula/cask disambiguation
Library/Homebrew/dev-cmd/livecheck.rb
@@ -105,7 +105,7 @@ def livecheck options = { json: args.json?, full_name: args.full_name?, - handle_name_conflict: !args.cask?, + handle_name_conflict: !args.formula? && !args.cask?, newer_only: args.newer_only?, quiet: args.quiet?, debug: args.debug?,
true
Other
Homebrew
brew
7d5216c500a5754da766937de3d61ebf8d70d643.json
Improve formula/cask disambiguation
Library/Homebrew/livecheck/livecheck.rb
@@ -63,7 +63,7 @@ def livecheck_strategy_names # Uses `formulae_and_casks_to_check` to identify taps in use other than # homebrew/core and homebrew/cask and loads strategies from them. - sig { params(formulae_and_casks_to_check: T::Enumerable[T.any(Formula, Cask::Cask)]).void } + sig { params(formulae_and_casks_to_check: T::Array[T.any(Formula, Cask::Cask)]).void } def load_other_tap_strategies(formulae_and_casks_to_check) other_taps = {} formulae_and_casks_to_check.each do |formula_or_cask| @@ -86,7 +86,7 @@ def load_other_tap_strategies(formulae_and_casks_to_check) # `formulae_and_casks_to_check` array and prints the results. sig { params( - formulae_and_casks_to_check: T::Enumerable[T.any(Formula, Cask::Cask)], + formulae_and_casks_to_check: T::Array[T.any(Formula, Cask::Cask)], full_name: T::Boolean, handle_name_conflict: T::Boolean, json: T::Boolean, @@ -103,6 +103,15 @@ def run_checks( ) load_other_tap_strategies(formulae_and_casks_to_check) + ambiguous_casks = [] + if handle_name_conflict + ambiguous_casks = formulae_and_casks_to_check + .group_by { |item| formula_or_cask_name(item, full_name: true) } + .select { |_name, items| items.length > 1 } + .values.flatten + .select { |item| item.is_a?(Cask::Cask) } + end + has_a_newer_upstream_version = T.let(false, T::Boolean) if json && !quiet && $stderr.tty? @@ -224,7 +233,7 @@ def run_checks( next info end - print_latest_version(info, verbose: verbose, handle_name_conflict: handle_name_conflict) + print_latest_version(info, verbose: verbose, ambiguous_cask: ambiguous_casks.include?(formula_or_cask)) nil rescue => e Homebrew.failed = true @@ -234,11 +243,7 @@ def run_checks( status_hash(formula_or_cask, "error", [e.to_s], full_name: full_name, verbose: verbose) elsif !quiet name = formula_or_cask_name(formula_or_cask, full_name: full_name) - name += begin - (" (cask)" if cask && handle_name_conflict && Formula[name]).to_s - rescue FormulaUnavailableError - "" - end + name += " (cask)" if ambiguous_casks.include?(formula_or_cask) onoe "#{Tty.blue}#{name}#{Tty.reset}: #{e}" $stderr.puts e.backtrace if debug && !e.is_a?(Livecheck::Error) @@ -317,14 +322,10 @@ def status_hash(formula_or_cask, status_str, messages = nil, full_name: false, v end # Formats and prints the livecheck result for a formula. - sig { params(info: Hash, verbose: T::Boolean, handle_name_conflict: T::Boolean).void } - def print_latest_version(info, verbose:, handle_name_conflict: false) + sig { params(info: Hash, verbose: T::Boolean, ambiguous_cask: T::Boolean).void } + def print_latest_version(info, verbose:, ambiguous_cask: false) formula_or_cask_s = "#{Tty.blue}#{info[:formula] || info[:cask]}#{Tty.reset}" - formula_or_cask_s += begin - (" (cask)" if info[:cask] && handle_name_conflict && Formula[info[:cask]]).to_s - rescue FormulaUnavailableError - "" - end + formula_or_cask_s += " (cask)" if ambiguous_cask formula_or_cask_s += " (guessed)" if !info[:meta][:livecheckable] && verbose current_s = if info[:version][:newer_than_upstream]
true
Other
Homebrew
brew
f11786d63d4287c85a5298353467b89bfe9398b0.json
Apply suggestions from code review Co-authored-by: Sam Ford <1584702+samford@users.noreply.github.com>
Library/Homebrew/dev-cmd/bump.rb
@@ -161,18 +161,17 @@ def retrieve_and_display_info(formula_or_cask, name, repositories, args:) livecheck_latest = livecheck_result(formula_or_cask) pull_requests = retrieve_pull_requests(formula_or_cask, name) unless args.no_pull_requests? - print_name = begin - "#{name} (cask)" if formula_or_cask.is_a?(Cask::Cask) && Formula[name] && !args.cask? + name += begin + (" (cask)" if formula_or_cask.is_a?(Cask::Cask) && !args.cask? && Formula[name]).to_s rescue FormulaUnavailableError - nil + "" end - print_name ||= name title = if current_version == repology_latest && current_version == livecheck_latest - "#{print_name} is up to date!" + "#{name} is up to date!" else - print_name + name end ohai title
true
Other
Homebrew
brew
f11786d63d4287c85a5298353467b89bfe9398b0.json
Apply suggestions from code review Co-authored-by: Sam Ford <1584702+samford@users.noreply.github.com>
Library/Homebrew/livecheck/livecheck.rb
@@ -125,12 +125,6 @@ def run_checks( formula = formula_or_cask if formula_or_cask.is_a?(Formula) cask = formula_or_cask if formula_or_cask.is_a?(Cask::Cask) name = formula_or_cask_name(formula_or_cask, full_name: full_name) - print_name = begin - "#{name} (cask)" if cask && Formula[name] && handle_name_conflict - rescue FormulaUnavailableError - nil - end - print_name ||= name if debug && i.positive? puts <<~EOS @@ -230,8 +224,7 @@ def run_checks( next info end - info[:cask] = print_name - print_latest_version(info, verbose: verbose) + print_latest_version(info, verbose: verbose, handle_name_conflict: handle_name_conflict) nil rescue => e Homebrew.failed = true @@ -240,7 +233,14 @@ def run_checks( progress&.increment status_hash(formula_or_cask, "error", [e.to_s], full_name: full_name, verbose: verbose) elsif !quiet - onoe "#{Tty.blue}#{print_name}#{Tty.reset}: #{e}" + name = formula_or_cask_name(formula_or_cask, full_name: full_name) + name += begin + (" (cask)" if cask && handle_name_conflict && Formula[name]).to_s + rescue FormulaUnavailableError + "" + end + + onoe "#{Tty.blue}#{name}#{Tty.reset}: #{e}" $stderr.puts e.backtrace if debug && !e.is_a?(Livecheck::Error) nil end @@ -317,9 +317,14 @@ def status_hash(formula_or_cask, status_str, messages = nil, full_name: false, v end # Formats and prints the livecheck result for a formula. - sig { params(info: Hash, verbose: T::Boolean).void } - def print_latest_version(info, verbose:) + sig { params(info: Hash, verbose: T::Boolean, handle_name_conflict: T::Boolean).void } + def print_latest_version(info, verbose:, handle_name_conflict: false) formula_or_cask_s = "#{Tty.blue}#{info[:formula] || info[:cask]}#{Tty.reset}" + formula_or_cask_s += begin + (" (cask)" if info[:cask] && handle_name_conflict && Formula[info[:cask]]).to_s + rescue FormulaUnavailableError + "" + end formula_or_cask_s += " (guessed)" if !info[:meta][:livecheckable] && verbose current_s = if info[:version][:newer_than_upstream]
true
Other
Homebrew
brew
d68452f2320c726c3bf602318dc85c3230d6f00e.json
rubocops/patches: autocorrect some offenses
Library/Homebrew/rubocops/patches.rb
@@ -11,6 +11,7 @@ module FormulaAudit # TODO: Many of these could be auto-corrected. class Patches < FormulaCop extend T::Sig + extend AutoCorrector def audit_formula(node, _class_node, _parent_class_node, body) @full_source_content = source_buffer(node).source @@ -40,77 +41,70 @@ def audit_formula(node, _class_node, _parent_class_node, body) private - def patch_problems(patch) - patch_url = string_content(patch) + def patch_problems(patch_url_node) + patch_url = string_content(patch_url_node) - if regex_match_group(patch, %r{https://github.com/[^/]*/[^/]*/pull}) + if regex_match_group(patch_url_node, %r{https://github.com/[^/]*/[^/]*/pull}) problem "Use a commit hash URL rather than an unstable pull request URL: #{patch_url}" end - if regex_match_group(patch, %r{.*gitlab.*/merge_request.*}) + if regex_match_group(patch_url_node, %r{.*gitlab.*/merge_request.*}) problem "Use a commit hash URL rather than an unstable merge request URL: #{patch_url}" end - if regex_match_group(patch, %r{https://github.com/[^/]*/[^/]*/commit/[a-fA-F0-9]*\.diff}) - problem <<~EOS.chomp - GitHub patches should end with .patch, not .diff: - #{patch_url} - EOS + if regex_match_group(patch_url_node, %r{https://github.com/[^/]*/[^/]*/commit/[a-fA-F0-9]*\.diff}) + problem "GitHub patches should end with .patch, not .diff: #{patch_url}" do |corrector| + correct = patch_url_node.source.gsub(/\.diff/, ".patch") + corrector.replace(patch_url_node.source_range, correct) + end end - if regex_match_group(patch, %r{.*gitlab.*/commit/[a-fA-F0-9]*\.diff}) - problem <<~EOS.chomp - GitLab patches should end with .patch, not .diff: - #{patch_url} - EOS + if regex_match_group(patch_url_node, %r{.*gitlab.*/commit/[a-fA-F0-9]*\.diff}) + problem "GitLab patches should end with .patch, not .diff: #{patch_url}" do |corrector| + correct = patch_url_node.source.gsub(/\.diff/, ".patch") + corrector.replace(patch_url_node.source_range, correct) + end end gh_patch_param_pattern = %r{https?://github\.com/.+/.+/(?:commit|pull)/[a-fA-F0-9]*.(?:patch|diff)} - if regex_match_group(patch, gh_patch_param_pattern) && !patch_url.match?(/\?full_index=\w+$/) - problem <<~EOS - GitHub patches should use the full_index parameter: - #{patch_url}?full_index=1 - EOS + if regex_match_group(patch_url_node, gh_patch_param_pattern) && !patch_url.match?(/\?full_index=\w+$/) + problem "GitHub patches should use the full_index parameter: #{patch_url}?full_index=1" do |corrector| + corrector.replace(patch_url_node.source_range, "#{patch_url}?full_index=1") + end end gh_patch_patterns = Regexp.union([%r{/raw\.github\.com/}, %r{/raw\.githubusercontent\.com/}, %r{gist\.github\.com/raw}, %r{gist\.github\.com/.+/raw}, %r{gist\.githubusercontent\.com/.+/raw}]) - if regex_match_group(patch, gh_patch_patterns) && !patch_url.match?(%r{/[a-fA-F0-9]{6,40}/}) - problem <<~EOS.chomp - GitHub/Gist patches should specify a revision: - #{patch_url} - EOS + if regex_match_group(patch_url_node, gh_patch_patterns) && !patch_url.match?(%r{/[a-fA-F0-9]{6,40}/}) + problem "GitHub/Gist patches should specify a revision: #{patch_url}" end gh_patch_diff_pattern = %r{https?://patch-diff\.githubusercontent\.com/raw/(.+)/(.+)/pull/(.+)\.(?:diff|patch)} - if regex_match_group(patch, gh_patch_diff_pattern) + if regex_match_group(patch_url_node, gh_patch_diff_pattern) problem "Use a commit hash URL rather than patch-diff: #{patch_url}" end - if regex_match_group(patch, %r{macports/trunk}) - problem <<~EOS.chomp - MacPorts patches should specify a revision instead of trunk: - #{patch_url} - EOS + if regex_match_group(patch_url_node, %r{macports/trunk}) + problem "MacPorts patches should specify a revision instead of trunk: #{patch_url}" end - if regex_match_group(patch, %r{^http://trac\.macports\.org}) - problem <<~EOS.chomp - Patches from MacPorts Trac should be https://, not http: - #{patch_url} - EOS + if regex_match_group(patch_url_node, %r{^http://trac\.macports\.org}) + problem "Patches from MacPorts Trac should be https://, not http: #{patch_url}" do |corrector| + correct = patch_url_node.source.gsub(%r{^http://}, "https://") + corrector.replace(patch_url_node.source_range, correct) + end end - return unless regex_match_group(patch, %r{^http://bugs\.debian\.org}) + return unless regex_match_group(patch_url_node, %r{^http://bugs\.debian\.org}) - problem <<~EOS.chomp - Patches from Debian should be https://, not http: - #{patch_url} - EOS + problem "Patches from Debian should be https://, not http: #{patch_url}" do |corrector| + correct = patch_url_node.source.gsub(%r{^http://}, "https://") + corrector.replace(patch_url_node.source_range, correct) + end end def inline_patch_problems(patch)
true
Other
Homebrew
brew
d68452f2320c726c3bf602318dc85c3230d6f00e.json
rubocops/patches: autocorrect some offenses
Library/Homebrew/test/rubocops/patches_spec.rb
@@ -54,33 +54,28 @@ def patches expected_offense = if patch_url.include?("/raw.github.com/") expect_offense_hash message: <<~EOS.chomp, severity: :convention, line: 5, column: 4, source: source - GitHub/Gist patches should specify a revision: - #{patch_url} + GitHub/Gist patches should specify a revision: #{patch_url} EOS elsif patch_url.include?("macports/trunk") expect_offense_hash message: <<~EOS.chomp, severity: :convention, line: 5, column: 4, source: source - MacPorts patches should specify a revision instead of trunk: - #{patch_url} + MacPorts patches should specify a revision instead of trunk: #{patch_url} EOS elsif patch_url.start_with?("http://trac.macports.org") expect_offense_hash message: <<~EOS.chomp, severity: :convention, line: 5, column: 4, source: source - Patches from MacPorts Trac should be https://, not http: - #{patch_url} + Patches from MacPorts Trac should be https://, not http: #{patch_url} EOS elsif patch_url.start_with?("http://bugs.debian.org") expect_offense_hash message: <<~EOS.chomp, severity: :convention, line: 5, column: 4, source: source - Patches from Debian should be https://, not http: - #{patch_url} + Patches from Debian should be https://, not http: #{patch_url} EOS # rubocop:disable Layout/LineLength elsif patch_url.match?(%r{https?://patch-diff\.githubusercontent\.com/raw/(.+)/(.+)/pull/(.+)\.(?:diff|patch)}) # rubocop:enable Layout/LineLength expect_offense_hash message: "Use a commit hash URL rather than patch-diff: #{patch_url}", severity: :convention, line: 5, column: 4, source: source elsif patch_url.match?(%r{https?://github\.com/.+/.+/(?:commit|pull)/[a-fA-F0-9]*.(?:patch|diff)}) - expect_offense_hash message: <<~EOS, severity: :convention, line: 5, column: 4, source: source - GitHub patches should use the full_index parameter: - #{patch_url}?full_index=1 + expect_offense_hash message: <<~EOS.chomp, severity: :convention, line: 5, column: 4, source: source + GitHub patches should use the full_index parameter: #{patch_url}?full_index=1 EOS end expected_offense.zip([inspect_source(source).last]).each do |expected, actual| @@ -112,11 +107,8 @@ def patches line: 4, column: 2, source: source }, - { message: - <<~EOS.chomp, - Patches from MacPorts Trac should be https://, not http: - http://trac.macports.org/export/68507/trunk/dports/net/trafshow/files/ - EOS + { message: "Patches from MacPorts Trac should be https://, not http: " \ + "http://trac.macports.org/export/68507/trunk/dports/net/trafshow/files/", severity: :convention, line: 8, column: 25, @@ -205,23 +197,19 @@ class Foo < Formula expected_offense = if patch_url.include?("/raw.github.com/") expect_offense_hash message: <<~EOS.chomp, severity: :convention, line: 5, column: 8, source: source - GitHub/Gist patches should specify a revision: - #{patch_url} + GitHub/Gist patches should specify a revision: #{patch_url} EOS elsif patch_url.include?("macports/trunk") expect_offense_hash message: <<~EOS.chomp, severity: :convention, line: 5, column: 8, source: source - MacPorts patches should specify a revision instead of trunk: - #{patch_url} + MacPorts patches should specify a revision instead of trunk: #{patch_url} EOS elsif patch_url.start_with?("http://trac.macports.org") expect_offense_hash message: <<~EOS.chomp, severity: :convention, line: 5, column: 8, source: source - Patches from MacPorts Trac should be https://, not http: - #{patch_url} + Patches from MacPorts Trac should be https://, not http: #{patch_url} EOS elsif patch_url.start_with?("http://bugs.debian.org") expect_offense_hash message: <<~EOS.chomp, severity: :convention, line: 5, column: 8, source: source - Patches from Debian should be https://, not http: - #{patch_url} + Patches from Debian should be https://, not http: #{patch_url} EOS elsif patch_url.match?(%r{https://github.com/[^/]*/[^/]*/pull}) expect_offense_hash message: <<~EOS.chomp, severity: :convention, line: 5, column: 8, source: source @@ -233,13 +221,11 @@ class Foo < Formula EOS elsif patch_url.match?(%r{https://github.com/[^/]*/[^/]*/commit/}) expect_offense_hash message: <<~EOS.chomp, severity: :convention, line: 5, column: 8, source: source - GitHub patches should end with .patch, not .diff: - #{patch_url} + GitHub patches should end with .patch, not .diff: #{patch_url} EOS elsif patch_url.match?(%r{.*gitlab.*/commit/}) expect_offense_hash message: <<~EOS.chomp, severity: :convention, line: 5, column: 8, source: source - GitLab patches should end with .patch, not .diff: - #{patch_url} + GitLab patches should end with .patch, not .diff: #{patch_url} EOS # rubocop:disable Layout/LineLength elsif patch_url.match?(%r{https?://patch-diff\.githubusercontent\.com/raw/(.+)/(.+)/pull/(.+)\.(?:diff|patch)})
true
Other
Homebrew
brew
1377db534d78fe89e88a1737754370739b24365f.json
Update RBI files for rubocop.
Library/Homebrew/sorbet/rbi/gems/rubocop@1.11.0.rbi
@@ -2572,6 +2572,7 @@ class RuboCop::Cop::Layout::FirstArgumentIndentation < ::RuboCop::Cop::Cop private def argument_alignment_config; end + def bare_operator?(node); end def base_indentation(node); end def base_range(send_node, arg_node); end def column_of(range); end @@ -8482,8 +8483,10 @@ class RuboCop::Cop::Style::HashConversion < ::RuboCop::Cop::Base private + def allowed_splat_argument?; end def args_to_hash(args); end def multi_argument(node); end + def requires_parens?(node); end def single_argument(node); end end @@ -9295,7 +9298,9 @@ class RuboCop::Cop::Style::MultipleComparison < ::RuboCop::Cop::Base def comparison?(node); end def nested_comparison?(node); end def nested_variable_comparison?(node); end + def reset_comparison; end def root_of_or_node(or_node); end + def switch_comparison?(node); end def variable_name(node); end def variables_in_node(node); end def variables_in_simple_node(node); end @@ -10019,6 +10024,7 @@ class RuboCop::Cop::Style::RedundantBegin < ::RuboCop::Cop::Base private def contain_rescue_or_ensure?(node); end + def empty_begin?(node); end def register_offense(node); end def valid_context_using_only_begin?(node); end end @@ -11020,6 +11026,7 @@ class RuboCop::Cop::Style::SymbolProc < ::RuboCop::Cop::Base private + def allow_if_method_has_argument?(node); end def autocorrect(corrector, node); end def autocorrect_with_args(corrector, node, args, method_name); end def autocorrect_without_args(corrector, node); end @@ -11259,6 +11266,25 @@ end RuboCop::Cop::Style::UnlessElse::MSG = T.let(T.unsafe(nil), String) +class RuboCop::Cop::Style::UnlessLogicalOperators < ::RuboCop::Cop::Base + include(::RuboCop::Cop::ConfigurableEnforcedStyle) + + def and_with_or?(param0 = T.unsafe(nil)); end + def logical_operator?(param0 = T.unsafe(nil)); end + def on_if(node); end + def or_with_and?(param0 = T.unsafe(nil)); end + + private + + def mixed_logical_operator?(node); end + def mixed_precedence_and?(node); end + def mixed_precedence_or?(node); end +end + +RuboCop::Cop::Style::UnlessLogicalOperators::FORBID_LOGICAL_OPERATORS = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Style::UnlessLogicalOperators::FORBID_MIXED_LOGICAL_OPERATORS = T.let(T.unsafe(nil), String) + class RuboCop::Cop::Style::UnpackFirst < ::RuboCop::Cop::Base extend(::RuboCop::Cop::AutoCorrector) @@ -12861,12 +12887,13 @@ class RuboCop::TargetRuby::GemspecFile < ::RuboCop::TargetRuby::Source private + def find_minimal_known_ruby(right_hand_side); end def find_version; end def gemspec_filename; end def gemspec_filepath; end def version_from_array(array); end def version_from_gemspec_file(file); end - def version_from_str(str); end + def version_from_right_hand_side(right_hand_side); end end RuboCop::TargetRuby::GemspecFile::GEMSPEC_EXTENSION = T.let(T.unsafe(nil), String)
false
Other
Homebrew
brew
a3ed481b9e5cacf59ced21d25cd994fbe92ff191.json
Revert "Revert "shims/mac/super: add ruby shims to set SDKROOT"" This reverts commit fe992cab2b943269e39e8f9f5830f4983c440e8b.
.github/workflows/tests.yml
@@ -276,7 +276,7 @@ jobs: - name: Install brew tests dependencies run: | brew install subversion - Library/Homebrew/shims/scm/svn --homebrew=print-path + brew sh -c "svn --homebrew=print-path" which svn which svnadmin
true
Other
Homebrew
brew
a3ed481b9e5cacf59ced21d25cd994fbe92ff191.json
Revert "Revert "shims/mac/super: add ruby shims to set SDKROOT"" This reverts commit fe992cab2b943269e39e8f9f5830f4983c440e8b.
Library/Homebrew/shims/mac/super/gem
@@ -0,0 +1 @@ +ruby \ No newline at end of file
true
Other
Homebrew
brew
a3ed481b9e5cacf59ced21d25cd994fbe92ff191.json
Revert "Revert "shims/mac/super: add ruby shims to set SDKROOT"" This reverts commit fe992cab2b943269e39e8f9f5830f4983c440e8b.
Library/Homebrew/shims/mac/super/rake
@@ -0,0 +1 @@ +ruby \ No newline at end of file
true
Other
Homebrew
brew
a3ed481b9e5cacf59ced21d25cd994fbe92ff191.json
Revert "Revert "shims/mac/super: add ruby shims to set SDKROOT"" This reverts commit fe992cab2b943269e39e8f9f5830f4983c440e8b.
Library/Homebrew/shims/mac/super/ruby
@@ -0,0 +1,12 @@ +#!/bin/bash +# System Ruby's mkmf on Mojave (10.14) and later require SDKROOT set to work correctly. + +source "$HOMEBREW_LIBRARY/Homebrew/shims/utils.sh" + +try_exec_non_system "$SHIM_FILE" "$@" + +if [[ -z "$SDKROOT" && -n "$HOMEBREW_SDKROOT" ]]; then + export SDKROOT=$HOMEBREW_SDKROOT +fi + +safe_exec "/usr/bin/$SHIM_FILE" "$@"
true
Other
Homebrew
brew
a3ed481b9e5cacf59ced21d25cd994fbe92ff191.json
Revert "Revert "shims/mac/super: add ruby shims to set SDKROOT"" This reverts commit fe992cab2b943269e39e8f9f5830f4983c440e8b.
Library/Homebrew/shims/scm/git
@@ -3,87 +3,15 @@ # This script because we support $HOMEBREW_GIT, $HOMEBREW_SVN, etc., Xcode-only and # no Xcode/CLT configurations. Order is careful to be what the user would want. -set +o posix - -quiet_safe_cd() { - cd "$1" >/dev/null || { echo "Error: failed to cd to $1" >&2; exit 1; } -} - -absdir() { - quiet_safe_cd "${1%/*}/" && pwd -P -} - -dirbasepath() { - local dir="$1" - local base="${2##*/}" - echo "$dir/$base" -} - -realpath() { - local path="$1" - local dir - local dest - - dir="$(absdir "$path")" - path="$(dirbasepath "$dir" "$path")" - - while [[ -L "$path" ]] - do - dest="$(readlink "$path")" - if [[ "$dest" = "/"* ]] - then - path="$dest" - else - path="$dir/$dest" - fi - dir="$(absdir "$path")" - path="$(dirbasepath "$dir" "$path")" - done - - echo "$path" -} - -executable() { - local file="$1" - [[ -f "$file" && -x "$file" ]] -} - -lowercase() { - echo "$1" | tr "[:upper:]" "[:lower:]" -} - -safe_exec() { - local arg0="$1" - if ! executable "$arg0" - then - return - fi - # prevent fork-bombs - if [[ "$(lowercase "$arg0")" = "$SCM_FILE" || "$(realpath "$arg0")" = "$SCM_REAL" ]] - then - return - fi - if [[ "$HOMEBREW" = "print-path" ]] - then - local dir="$(quiet_safe_cd "${arg0%/*}/" && pwd)" - local path="$(dirbasepath "$dir" "$arg0")" - echo "$path" - exit - fi - exec "$@" -} - -SCM_FILE="${0##*/}" -SCM_REAL="$(realpath "$0")" -SCM_DIR="$(quiet_safe_cd "${SCM_REAL%/*}/" && pwd -P)" - -if [[ "$1" = --homebrew=* ]] +if [ -z "$HOMEBREW_LIBRARY" ] then - HOMEBREW="${1:11}" - shift + echo "${0##*/}: This shim is internal and must be run via `brew`." >&2 + exit 1 fi -case "$(lowercase "$SCM_FILE")" in +source "$HOMEBREW_LIBRARY/Homebrew/shims/utils.sh" + +case "$(lowercase "$SHIM_FILE")" in git) if [[ -n "$HOMEBREW_GIT" && "$HOMEBREW_GIT" != git ]] then @@ -98,21 +26,10 @@ case "$(lowercase "$SCM_FILE")" in ;; esac -brew_prefix_version="$(quiet_safe_cd "$SCM_DIR/../../../../../bin" 2>/dev/null && pwd -P)/$SCM_FILE" +brew_prefix_version="$HOMEBREW_PREFIX/bin/$SHIM_FILE" safe_exec "$brew_prefix_version" "$@" -brew_repo_version="$(quiet_safe_cd "$SCM_DIR/../../../../bin" && pwd -P)/$SCM_FILE" -safe_exec "$brew_repo_version" "$@" - -IFS=$'\n' -for path in $(type -aP "$SCM_FILE") -do - if [[ "$path" != "/usr/bin/$SCM_FILE" ]] - then - safe_exec "$path" "$@" - fi -done -unset IFS +try_exec_non_system "$SHIM_FILE" "$@" if executable "/usr/bin/xcode-select" then @@ -129,19 +46,19 @@ then fi if [[ -z "$popup_stub" && "$xcode_path" != "/" ]] then - path="$(/usr/bin/xcrun -find "$SCM_FILE" 2>/dev/null)" + path="$(/usr/bin/xcrun -find "$SHIM_FILE" 2>/dev/null)" safe_exec "$path" "$@" fi fi -path="/Applications/Xcode.app/Contents/Developer/usr/bin/$SCM_FILE" +path="/Applications/Xcode.app/Contents/Developer/usr/bin/$SHIM_FILE" safe_exec "$path" "$@" if [[ -z "$popup_stub" && "$HOMEBREW_MACOS_VERSION_NUMERIC" -lt "101500" ]] then - path="/usr/bin/$SCM_FILE" + path="/usr/bin/$SHIM_FILE" safe_exec "$path" "$@" fi -echo "You must: brew install $SCM_FILE" >&2 +echo "You must: brew install $SHIM_FILE" >&2 exit 1
true
Other
Homebrew
brew
a3ed481b9e5cacf59ced21d25cd994fbe92ff191.json
Revert "Revert "shims/mac/super: add ruby shims to set SDKROOT"" This reverts commit fe992cab2b943269e39e8f9f5830f4983c440e8b.
Library/Homebrew/shims/utils.sh
@@ -0,0 +1,94 @@ +set +o posix + +quiet_safe_cd() { + cd "$1" >/dev/null || { echo "Error: failed to cd to $1" >&2; exit 1; } +} + +absdir() { + quiet_safe_cd "${1%/*}/" && pwd -P +} + +dirbasepath() { + local dir="$1" + local base="${2##*/}" + echo "$dir/$base" +} + +realpath() { + local path="$1" + local dir + local dest + + dir="$(absdir "$path")" + path="$(dirbasepath "$dir" "$path")" + + while [[ -L "$path" ]] + do + dest="$(readlink "$path")" + if [[ "$dest" = "/"* ]] + then + path="$dest" + else + path="$dir/$dest" + fi + dir="$(absdir "$path")" + path="$(dirbasepath "$dir" "$path")" + done + + echo "$path" +} + +executable() { + local file="$1" + [[ -f "$file" && -x "$file" ]] +} + +lowercase() { + echo "$1" | tr "[:upper:]" "[:lower:]" +} + +safe_exec() { + local arg0="$1" + if ! executable "$arg0" + then + return + fi + # prevent fork-bombs + if [[ "$(lowercase "$arg0")" = "$SHIM_FILE" || "$(realpath "$arg0")" = "$SHIM_REAL" ]] + then + return + fi + if [[ "$HOMEBREW" = "print-path" ]] + then + local dir="$(quiet_safe_cd "${arg0%/*}/" && pwd)" + local path="$(dirbasepath "$dir" "$arg0")" + echo "$path" + exit + fi + exec "$@" +} + +try_exec_non_system() { + local file="$1" + shift + + IFS=$'\n' + for path in $(type -aP "$file") + do + if [[ "$path" != "/usr/bin/$file" ]] + then + safe_exec "$path" "$@" + fi + done + unset IFS +} + + +SHIM_FILE="${0##*/}" +SHIM_REAL="$(realpath "$0")" + +if [[ "$1" = --homebrew=* ]] +then + HOMEBREW="${1:11}" + shift +fi
true
Other
Homebrew
brew
e92d67d15c9d00bce05504dedc52491c8be71925.json
Add initial documentation for Java-based packages
docs/Homebrew-and-Java.md
@@ -0,0 +1,9 @@ +# Homebrew and Java + +This page describes how Java is handled in Homebrew for users. Prospective formula authors may refer to existing Java-based formulae for examples of how to install packages written in Java via Homebrew, or visit the [Homebrew discussion forum](https://github.com/Homebrew/discussions/discussions) to seek guidance for their specific situation. + +Most Java-based packages in Homebrew use the default Homebrew-provided `openjdk` package for their JDK dependency, although some packages with specific version requirements may use a versioned package such as `openjdk@8`. + +## Executing commands using a different JDK + +In situations where the user wants to override the use of the Homebrew-provided JDK, setting the `JAVA_HOME` environment variable will cause the specified location to be used as the Java home directory instead of the version of `openjdk` specified as a dependency.
false
Other
Homebrew
brew
fe992cab2b943269e39e8f9f5830f4983c440e8b.json
Revert "shims/mac/super: add ruby shims to set SDKROOT"
.github/workflows/tests.yml
@@ -276,7 +276,7 @@ jobs: - name: Install brew tests dependencies run: | brew install subversion - brew sh -c "svn --homebrew=print-path" + Library/Homebrew/shims/scm/svn --homebrew=print-path which svn which svnadmin
true
Other
Homebrew
brew
fe992cab2b943269e39e8f9f5830f4983c440e8b.json
Revert "shims/mac/super: add ruby shims to set SDKROOT"
Library/Homebrew/shims/mac/super/gem
@@ -1 +0,0 @@ -ruby \ No newline at end of file
true
Other
Homebrew
brew
fe992cab2b943269e39e8f9f5830f4983c440e8b.json
Revert "shims/mac/super: add ruby shims to set SDKROOT"
Library/Homebrew/shims/mac/super/rake
@@ -1 +0,0 @@ -ruby \ No newline at end of file
true
Other
Homebrew
brew
fe992cab2b943269e39e8f9f5830f4983c440e8b.json
Revert "shims/mac/super: add ruby shims to set SDKROOT"
Library/Homebrew/shims/mac/super/ruby
@@ -1,12 +0,0 @@ -#!/bin/bash -# System Ruby's mkmf on Mojave (10.14) and later require SDKROOT set to work correctly. - -source "$HOMEBREW_LIBRARY/Homebrew/shims/utils.sh" - -try_exec_non_system "$SHIM_FILE" "$@" - -if [[ -z "$SDKROOT" && -n "$HOMEBREW_SDKROOT" ]]; then - export SDKROOT=$HOMEBREW_SDKROOT -fi - -safe_exec "/usr/bin/$SHIM_FILE" "$@"
true
Other
Homebrew
brew
fe992cab2b943269e39e8f9f5830f4983c440e8b.json
Revert "shims/mac/super: add ruby shims to set SDKROOT"
Library/Homebrew/shims/scm/git
@@ -3,15 +3,87 @@ # This script because we support $HOMEBREW_GIT, $HOMEBREW_SVN, etc., Xcode-only and # no Xcode/CLT configurations. Order is careful to be what the user would want. -if [ -z "$HOMEBREW_LIBRARY" ] +set +o posix + +quiet_safe_cd() { + cd "$1" >/dev/null || { echo "Error: failed to cd to $1" >&2; exit 1; } +} + +absdir() { + quiet_safe_cd "${1%/*}/" && pwd -P +} + +dirbasepath() { + local dir="$1" + local base="${2##*/}" + echo "$dir/$base" +} + +realpath() { + local path="$1" + local dir + local dest + + dir="$(absdir "$path")" + path="$(dirbasepath "$dir" "$path")" + + while [[ -L "$path" ]] + do + dest="$(readlink "$path")" + if [[ "$dest" = "/"* ]] + then + path="$dest" + else + path="$dir/$dest" + fi + dir="$(absdir "$path")" + path="$(dirbasepath "$dir" "$path")" + done + + echo "$path" +} + +executable() { + local file="$1" + [[ -f "$file" && -x "$file" ]] +} + +lowercase() { + echo "$1" | tr "[:upper:]" "[:lower:]" +} + +safe_exec() { + local arg0="$1" + if ! executable "$arg0" + then + return + fi + # prevent fork-bombs + if [[ "$(lowercase "$arg0")" = "$SCM_FILE" || "$(realpath "$arg0")" = "$SCM_REAL" ]] + then + return + fi + if [[ "$HOMEBREW" = "print-path" ]] + then + local dir="$(quiet_safe_cd "${arg0%/*}/" && pwd)" + local path="$(dirbasepath "$dir" "$arg0")" + echo "$path" + exit + fi + exec "$@" +} + +SCM_FILE="${0##*/}" +SCM_REAL="$(realpath "$0")" +SCM_DIR="$(quiet_safe_cd "${SCM_REAL%/*}/" && pwd -P)" + +if [[ "$1" = --homebrew=* ]] then - echo "${0##*/}: This shim is internal and must be run via `brew`." >&2 - exit 1 + HOMEBREW="${1:11}" + shift fi -source "$HOMEBREW_LIBRARY/Homebrew/shims/utils.sh" - -case "$(lowercase "$SHIM_FILE")" in +case "$(lowercase "$SCM_FILE")" in git) if [[ -n "$HOMEBREW_GIT" && "$HOMEBREW_GIT" != git ]] then @@ -26,10 +98,21 @@ case "$(lowercase "$SHIM_FILE")" in ;; esac -brew_prefix_version="$HOMEBREW_PREFIX/bin/$SHIM_FILE" +brew_prefix_version="$(quiet_safe_cd "$SCM_DIR/../../../../../bin" 2>/dev/null && pwd -P)/$SCM_FILE" safe_exec "$brew_prefix_version" "$@" -try_exec_non_system "$SHIM_FILE" "$@" +brew_repo_version="$(quiet_safe_cd "$SCM_DIR/../../../../bin" && pwd -P)/$SCM_FILE" +safe_exec "$brew_repo_version" "$@" + +IFS=$'\n' +for path in $(type -aP "$SCM_FILE") +do + if [[ "$path" != "/usr/bin/$SCM_FILE" ]] + then + safe_exec "$path" "$@" + fi +done +unset IFS if executable "/usr/bin/xcode-select" then @@ -46,19 +129,19 @@ then fi if [[ -z "$popup_stub" && "$xcode_path" != "/" ]] then - path="$(/usr/bin/xcrun -find "$SHIM_FILE" 2>/dev/null)" + path="$(/usr/bin/xcrun -find "$SCM_FILE" 2>/dev/null)" safe_exec "$path" "$@" fi fi -path="/Applications/Xcode.app/Contents/Developer/usr/bin/$SHIM_FILE" +path="/Applications/Xcode.app/Contents/Developer/usr/bin/$SCM_FILE" safe_exec "$path" "$@" if [[ -z "$popup_stub" && "$HOMEBREW_MACOS_VERSION_NUMERIC" -lt "101500" ]] then - path="/usr/bin/$SHIM_FILE" + path="/usr/bin/$SCM_FILE" safe_exec "$path" "$@" fi -echo "You must: brew install $SHIM_FILE" >&2 +echo "You must: brew install $SCM_FILE" >&2 exit 1
true
Other
Homebrew
brew
fe992cab2b943269e39e8f9f5830f4983c440e8b.json
Revert "shims/mac/super: add ruby shims to set SDKROOT"
Library/Homebrew/shims/utils.sh
@@ -1,94 +0,0 @@ -set +o posix - -quiet_safe_cd() { - cd "$1" >/dev/null || { echo "Error: failed to cd to $1" >&2; exit 1; } -} - -absdir() { - quiet_safe_cd "${1%/*}/" && pwd -P -} - -dirbasepath() { - local dir="$1" - local base="${2##*/}" - echo "$dir/$base" -} - -realpath() { - local path="$1" - local dir - local dest - - dir="$(absdir "$path")" - path="$(dirbasepath "$dir" "$path")" - - while [[ -L "$path" ]] - do - dest="$(readlink "$path")" - if [[ "$dest" = "/"* ]] - then - path="$dest" - else - path="$dir/$dest" - fi - dir="$(absdir "$path")" - path="$(dirbasepath "$dir" "$path")" - done - - echo "$path" -} - -executable() { - local file="$1" - [[ -f "$file" && -x "$file" ]] -} - -lowercase() { - echo "$1" | tr "[:upper:]" "[:lower:]" -} - -safe_exec() { - local arg0="$1" - if ! executable "$arg0" - then - return - fi - # prevent fork-bombs - if [[ "$(lowercase "$arg0")" = "$SHIM_FILE" || "$(realpath "$arg0")" = "$SHIM_REAL" ]] - then - return - fi - if [[ "$HOMEBREW" = "print-path" ]] - then - local dir="$(quiet_safe_cd "${arg0%/*}/" && pwd)" - local path="$(dirbasepath "$dir" "$arg0")" - echo "$path" - exit - fi - exec "$@" -} - -try_exec_non_system() { - local file="$1" - shift - - IFS=$'\n' - for path in $(type -aP "$file") - do - if [[ "$path" != "/usr/bin/$file" ]] - then - safe_exec "$path" "$@" - fi - done - unset IFS -} - - -SHIM_FILE="${0##*/}" -SHIM_REAL="$(realpath "$0")" - -if [[ "$1" = --homebrew=* ]] -then - HOMEBREW="${1:11}" - shift -fi
true
Other
Homebrew
brew
e3505247cb7cea608aa202d20beec6adc3df630a.json
formula_installer: fix typo in install_dependency The linked_keg variable is referenced outside the block where it is defined; I think it should be the installed_keg variable.
Library/Homebrew/formula_installer.rb
@@ -718,7 +718,7 @@ def install_dependency(dep, inherited_options) if df.latest_version_installed? installed_keg = Keg.new(df.prefix) - tab ||= Tab.for_keg(linked_keg) + tab ||= Tab.for_keg(installed_keg) tmp_keg = Pathname.new("#{installed_keg}.tmp") installed_keg.rename(tmp_keg) end
false
Other
Homebrew
brew
9a1d1b4847efe820a395b3948bebc7b164ef3ca6.json
Update RBI files for rubocop-performance.
Library/Homebrew/sorbet/rbi/gems/rubocop-performance@1.10.1.rbi
@@ -492,11 +492,14 @@ class RuboCop::Cop::Performance::RedundantEqualityComparisonBlock < ::RuboCop::C def new_argument(block_argument, block_body); end def offense_range(node); end + def same_block_argument_and_is_a_argument?(block_body, block_argument); end def use_equality_comparison_block?(block_body); end end RuboCop::Cop::Performance::RedundantEqualityComparisonBlock::COMPARISON_METHODS = T.let(T.unsafe(nil), Array) +RuboCop::Cop::Performance::RedundantEqualityComparisonBlock::IS_A_METHODS = T.let(T.unsafe(nil), Array) + RuboCop::Cop::Performance::RedundantEqualityComparisonBlock::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Performance::RedundantEqualityComparisonBlock::TARGET_METHODS = T.let(T.unsafe(nil), Array) @@ -588,9 +591,8 @@ class RuboCop::Cop::Performance::RedundantSplitRegexpArgument < ::RuboCop::Cop:: private - def autocorrect(corrector, node); end - def determinist_regexp?(first_argument); end - def replacement(node); end + def determinist_regexp?(regexp_node); end + def replacement(regexp_node); end end RuboCop::Cop::Performance::RedundantSplitRegexpArgument::DETERMINISTIC_REGEX = T.let(T.unsafe(nil), Regexp)
false
Other
Homebrew
brew
d330e915d13c11a4701c7e9e159a93140cfac7cd.json
download_strategy: add comment about Content-Disposition handling
Library/Homebrew/download_strategy.rb
@@ -458,6 +458,9 @@ def resolve_url_basename_time_file_size(url) filename = URI.decode_www_form_component(encoded_filename).encode(encoding) if encoding && encoded_filename end + # Servers may include '/' in their Content-Disposition filename header. Take only the basename of this, because: + # - Unpacking code assumes this is a single file - not something living in a subdirectory. + # - Directory traversal attacks are possible without limiting this to just the basename. (filename || content_disposition.filename).rpartition("/")[-1] end
false
Other
Homebrew
brew
03e761079c1a4d9cad6aa1b1426a49c998e643bf.json
Update RBI files for rubocop-performance.
Library/Homebrew/sorbet/rbi/gems/regexp_parser@2.1.1.rbi
@@ -84,6 +84,10 @@ class Regexp::Expression::Backreference::Base < ::Regexp::Expression::Base def match_length; end def referenced_expression; end def referenced_expression=(_arg0); end + + private + + def initialize_copy(orig); end end class Regexp::Expression::Backreference::Name < ::Regexp::Expression::Backreference::Base @@ -198,7 +202,7 @@ class Regexp::Expression::Base private - def initialize_clone(orig); end + def initialize_copy(orig); end end class Regexp::Expression::CharacterSet < ::Regexp::Expression::Subexpression @@ -292,6 +296,10 @@ class Regexp::Expression::Conditional::Condition < ::Regexp::Expression::Base def reference; end def referenced_expression; end def referenced_expression=(_arg0); end + + private + + def initialize_copy(orig); end end class Regexp::Expression::Conditional::Expression < ::Regexp::Expression::Subexpression @@ -306,9 +314,13 @@ class Regexp::Expression::Conditional::Expression < ::Regexp::Expression::Subexp def referenced_expression; end def referenced_expression=(_arg0); end def to_s(format = T.unsafe(nil)); end + + private + + def initialize_copy(orig); end end -class Regexp::Expression::Conditional::TooManyBranches < ::StandardError +class Regexp::Expression::Conditional::TooManyBranches < ::Regexp::Parser::Error def initialize; end end @@ -431,12 +443,16 @@ class Regexp::Expression::Group::Named < ::Regexp::Expression::Group::Capture private - def initialize_clone(orig); end + def initialize_copy(orig); end end class Regexp::Expression::Group::Options < ::Regexp::Expression::Group::Base def option_changes; end def option_changes=(_arg0); end + + private + + def initialize_copy(orig); end end class Regexp::Expression::Group::Passive < ::Regexp::Expression::Group::Base @@ -486,7 +502,7 @@ class Regexp::Expression::Quantifier private - def initialize_clone(orig); end + def initialize_copy(orig); end end Regexp::Expression::Quantifier::MODES = T.let(T.unsafe(nil), Array) @@ -553,7 +569,7 @@ class Regexp::Expression::Subexpression < ::Regexp::Expression::Base private - def initialize_clone(orig); end + def initialize_copy(orig); end end module Regexp::Expression::UnicodeProperty @@ -867,7 +883,6 @@ end class Regexp::Parser include(::Regexp::Expression) - include(::Regexp::Syntax) include(::Regexp::Expression::UnicodeProperty) def parse(input, syntax = T.unsafe(nil), options: T.unsafe(nil), &block); end @@ -898,6 +913,7 @@ class Regexp::Parser def intersection(token); end def interval(target_node, token); end def keep(token); end + def literal(token); end def meta(token); end def negate_set; end def nest(exp); end @@ -933,11 +949,16 @@ end Regexp::Parser::ENC_FLAGS = T.let(T.unsafe(nil), Array) +class Regexp::Parser::Error < ::StandardError +end + Regexp::Parser::MOD_FLAGS = T.let(T.unsafe(nil), Array) -class Regexp::Parser::ParserError < ::StandardError +class Regexp::Parser::ParserError < ::Regexp::Parser::Error end +Regexp::Parser::UPTokens = Regexp::Syntax::Token::UnicodeProperty + class Regexp::Parser::UnknownTokenError < ::Regexp::Parser::ParserError def initialize(type, token); end end @@ -1005,20 +1026,18 @@ class Regexp::Scanner::InvalidSequenceError < ::Regexp::Scanner::ValidationError def initialize(what = T.unsafe(nil), where = T.unsafe(nil)); end end -Regexp::Scanner::PROP_MAPS_DIR = T.let(T.unsafe(nil), String) - class Regexp::Scanner::PrematureEndError < ::Regexp::Scanner::ScannerError def initialize(where = T.unsafe(nil)); end end -class Regexp::Scanner::ScannerError < ::StandardError +class Regexp::Scanner::ScannerError < ::Regexp::Parser::Error end class Regexp::Scanner::UnknownUnicodePropertyError < ::Regexp::Scanner::ValidationError def initialize(name); end end -class Regexp::Scanner::ValidationError < ::StandardError +class Regexp::Scanner::ValidationError < ::Regexp::Parser::Error def initialize(reason); end end @@ -1088,7 +1107,7 @@ class Regexp::Syntax::NotImplementedError < ::Regexp::Syntax::SyntaxError def initialize(syntax, type, token); end end -class Regexp::Syntax::SyntaxError < ::StandardError +class Regexp::Syntax::SyntaxError < ::Regexp::Parser::Error end module Regexp::Syntax::Token
true
Other
Homebrew
brew
03e761079c1a4d9cad6aa1b1426a49c998e643bf.json
Update RBI files for rubocop-performance.
Library/Homebrew/sorbet/rbi/gems/rubocop-performance@1.10.0.rbi
@@ -238,7 +238,7 @@ class RuboCop::Cop::Performance::ConstantRegexp < ::RuboCop::Cop::Base private def include_interpolated_const?(node); end - def within_const_assignment?(node); end + def within_allowed_assignment?(node); end end RuboCop::Cop::Performance::ConstantRegexp::MSG = T.let(T.unsafe(nil), String) @@ -482,6 +482,25 @@ RuboCop::Cop::Performance::RedundantBlockCall::SPACE = T.let(T.unsafe(nil), Stri RuboCop::Cop::Performance::RedundantBlockCall::YIELD = T.let(T.unsafe(nil), String) +class RuboCop::Cop::Performance::RedundantEqualityComparisonBlock < ::RuboCop::Cop::Base + extend(::RuboCop::Cop::AutoCorrector) + extend(::RuboCop::Cop::TargetRubyVersion) + + def on_block(node); end + + private + + def new_argument(block_argument, block_body); end + def offense_range(node); end + def use_equality_comparison_block?(block_body); end +end + +RuboCop::Cop::Performance::RedundantEqualityComparisonBlock::COMPARISON_METHODS = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Performance::RedundantEqualityComparisonBlock::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Performance::RedundantEqualityComparisonBlock::TARGET_METHODS = T.let(T.unsafe(nil), Array) + class RuboCop::Cop::Performance::RedundantMatch < ::RuboCop::Cop::Base extend(::RuboCop::Cop::AutoCorrector) @@ -561,6 +580,27 @@ end RuboCop::Cop::Performance::RedundantSortBlock::MSG = T.let(T.unsafe(nil), String) +class RuboCop::Cop::Performance::RedundantSplitRegexpArgument < ::RuboCop::Cop::Base + extend(::RuboCop::Cop::AutoCorrector) + + def on_send(node); end + def split_call_with_regexp?(param0 = T.unsafe(nil)); end + + private + + def autocorrect(corrector, node); end + def determinist_regexp?(first_argument); end + def replacement(node); end +end + +RuboCop::Cop::Performance::RedundantSplitRegexpArgument::DETERMINISTIC_REGEX = T.let(T.unsafe(nil), Regexp) + +RuboCop::Cop::Performance::RedundantSplitRegexpArgument::MSG = T.let(T.unsafe(nil), String) + +RuboCop::Cop::Performance::RedundantSplitRegexpArgument::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + +RuboCop::Cop::Performance::RedundantSplitRegexpArgument::STR_SPECIAL_CHARS = T.let(T.unsafe(nil), Array) + class RuboCop::Cop::Performance::RedundantStringChars < ::RuboCop::Cop::Base include(::RuboCop::Cop::RangeHelp) extend(::RuboCop::Cop::AutoCorrector)
true
Other
Homebrew
brew
a6711b0d65bbe98041371cbfbabc2e665cca86ed.json
sorbet: Update RBI files. Autogenerated by the [sorbet](https://github.com/Homebrew/brew/blob/master/.github/workflows/sorbet.yml) workflow.
Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi
@@ -3596,7 +3596,6 @@ class Bundler::Retry end class Bundler::RubyGemsGemInstaller - def initialize(gem, options=T.unsafe(nil)); end end class Bundler::RubyGemsGemInstaller
false
Other
Homebrew
brew
30ce9b92e8664474b5c3527c482aad08eafbfdce.json
utils/gems: add installed gems to $LOAD_PATH
Library/Homebrew/utils/gems.rb
@@ -70,15 +70,31 @@ def setup_gem_environment!(gem_home: nil, gem_bindir: nil, setup_path: true) paths.unshift(gem_bindir) unless paths.include?(gem_bindir) paths.unshift(ruby_bindir) unless paths.include?(ruby_bindir) ENV["PATH"] = paths.compact.join(":") + + # Set envs so the above binaries can be invoked. + # We don't do this unless requested as some formulae may invoke system Ruby instead of ours. + ENV["GEM_HOME"] = gem_home + ENV["GEM_PATH"] = gem_home end def install_gem!(name, version: nil, setup_gem_environment: true) setup_gem_environment! if setup_gem_environment - return unless Gem::Specification.find_all_by_name(name, version).empty? - ohai_if_defined "Installing '#{name}' gem" - # document: [] , is equivalent to --no-document - Gem.install name, version, document: [] + specs = Gem::Specification.find_all_by_name(name, version) + + if specs.empty? + ohai_if_defined "Installing '#{name}' gem" + # document: [] , is equivalent to --no-document + specs = Gem.install name, version, document: [] + end + + # Add the new specs to the $LOAD_PATH. + specs.each do |spec| + spec.require_paths.each do |path| + full_path = File.join(spec.full_gem_path, path) + $LOAD_PATH.unshift full_path unless $LOAD_PATH.include?(full_path) + end + end rescue Gem::UnsatisfiableDependencyError odie_if_defined "failed to install the '#{name}' gem." end
false
Other
Homebrew
brew
0eb58dcc173a03213c628e1c0466193af5af2162.json
sorbet: Update RBI files. Autogenerated by the [sorbet](https://github.com/Homebrew/brew/blob/master/.github/workflows/sorbet.yml) workflow.
Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi
@@ -3596,6 +3596,7 @@ class Bundler::Retry end class Bundler::RubyGemsGemInstaller + def initialize(gem, options=T.unsafe(nil)); end end class Bundler::RubyGemsGemInstaller @@ -8047,6 +8048,8 @@ end module Homebrew::Assertions include ::Minitest::Assertions + def assert_include(*args); end + def assert_no_match(*args); end def assert_not_empty(*args); end @@ -8057,12 +8060,16 @@ module Homebrew::Assertions def assert_not_in_epsilon(*args); end + def assert_not_include(*args); end + def assert_not_includes(*args); end def assert_not_instance_of(*args); end def assert_not_kind_of(*args); end + def assert_not_match(*args); end + def assert_not_nil(*args); end def assert_not_operator(*args); end @@ -8073,7 +8080,13 @@ module Homebrew::Assertions def assert_not_same(*args); end + def assert_path_exist(*args); end + + def assert_path_not_exist(*args); end + def assert_raise(*args); end + + def assert_throw(*args); end end class Homebrew::BundleVersion
false
Other
Homebrew
brew
31a95d21bebda5f091ec3106fe347c9fb23aec9b.json
Dockerfile: add gawk dependency This is needed to build glibc on CI
Dockerfile
@@ -14,6 +14,7 @@ RUN apt-get update \ file \ fonts-dejavu-core \ g++ \ + gawk \ git \ less \ libz-dev \
false
Other
Homebrew
brew
a5b12a33c2160cc1ff9ca9f42171d774ec392d5a.json
utils/gems: use Gem API rather than ENV to set paths
Library/Homebrew/test/support/helper/spec/shared_context/integration_test.rb
@@ -90,11 +90,15 @@ def brew(*args) ruby_args = HOMEBREW_RUBY_EXEC_ARGS.dup if ENV["HOMEBREW_TESTS_COVERAGE"] simplecov_spec = Gem.loaded_specs["simplecov"] - specs = [simplecov_spec] - simplecov_spec.runtime_dependencies.each do |dep| - specs += dep.to_specs - rescue Gem::LoadError => e - onoe e + parallel_tests_spec = Gem.loaded_specs["parallel_tests"] + specs = [] + [simplecov_spec, parallel_tests_spec].each do |spec| + specs << spec + spec.runtime_dependencies.each do |dep| + specs += dep.to_specs + rescue Gem::LoadError => e + onoe e + end end libs = specs.flat_map do |spec| full_gem_path = spec.full_gem_path
true
Other
Homebrew
brew
a5b12a33c2160cc1ff9ca9f42171d774ec392d5a.json
utils/gems: use Gem API rather than ENV to set paths
Library/Homebrew/utils/gems.rb
@@ -53,17 +53,15 @@ def odie_if_defined(message) def setup_gem_environment!(gem_home: nil, gem_bindir: nil, setup_path: true) # Match where our bundler gems are. gem_home ||= "#{ENV["HOMEBREW_LIBRARY"]}/Homebrew/vendor/bundle/ruby/#{RbConfig::CONFIG["ruby_version"]}" - ENV["GEM_HOME"] = gem_home - ENV["GEM_PATH"] = gem_home + Gem.paths = { + "GEM_HOME" => gem_home, + "GEM_PATH" => gem_home, + } # Set TMPDIR so Xcode's `make` doesn't fall back to `/var/tmp/`, # which may be not user-writable. ENV["TMPDIR"] = ENV["HOMEBREW_TEMP"] - # Make RubyGems notice environment changes. - Gem.clear_paths - Gem::Specification.reset - return unless setup_path # Add necessary Ruby and Gem binary directories to `PATH`.
true
Other
Homebrew
brew
a5b12a33c2160cc1ff9ca9f42171d774ec392d5a.json
utils/gems: use Gem API rather than ENV to set paths
Library/Homebrew/utils/rubocop.rb
@@ -2,6 +2,9 @@ # typed: false # frozen_string_literal: true +require_relative "gems" +Homebrew.setup_gem_environment! + require_relative "../warnings" Warnings.ignore :parser_syntax do
true
Other
Homebrew
brew
26aa1669d76c5731ea7f1eb6dab3b055df00908c.json
docs/New-Maintainer-Checklist.md: remove automated steps
docs/New-Maintainer-Checklist.md
@@ -18,7 +18,7 @@ issues, or reviewing user pull requests. You should also be making contributions to Homebrew at least once per quarter. You should watch or regularly check Homebrew/brew and/or -Homebrew/homebrew-core and/or Homebrew/homebrew-cask. Let us know which so we +Homebrew/homebrew-core and/or Homebrew/homebrew-cask. Let us know which so we can grant you commit access appropriately. If you're no longer able to perform all of these tasks, please continue to @@ -63,7 +63,6 @@ If they accept, follow a few steps to get them set up: - Invite them to the [`machomebrew` private maintainers Slack](https://machomebrew.slack.com/admin/invites) (and ensure they've read the [communication guidelines](Maintainer-Guidelines.md#communication)) and ask them to use their real name there (rather than a pseudonym they may use on e.g. GitHub). - Ask them to disable SMS as a 2FA device or fallback on their GitHub account in favour of using one of the other authentication methods. - Ask them to (regularly) review remove any unneeded [GitHub personal access tokens](https://github.com/settings/tokens). -- Add them to Homebrew/brew's README, run `brew man` and commit the changes. - Start the process to [add them as Homebrew members](#members), for formal voting rights and the ability to hold office for Homebrew. If they are interested in doing system administration work: @@ -77,7 +76,7 @@ If they are elected to the Homebrew's [Project Leadership Committee](https://doc - Email their name, email and employer to the [Software Freedom Conservancy](https://sfconservancy.org) at homebrew@sfconservancy.org - Make them [owners on the Homebrew GitHub organisation](https://github.com/orgs/Homebrew/people) - Invite them to the [**@Homebrew/plc** team](https://github.com/orgs/Homebrew/teams/plc/members) -- Invite them to [Google Analytics](https://analytics.google.com/analytics/web/#management/Settings/a76679469w115400090p120682403/%3Fm.page%3DAccountUsers/) and add them to the relevant section of the [Homebrew/brew's README](https://github.com/Homebrew/brew/edit/master/README.md). +- Invite them to [Google Analytics](https://analytics.google.com/analytics/web/#management/Settings/a76679469w115400090p120682403/%3Fm.page%3DAccountUsers/). - Invite them to the [`homebrew` private 1Password](https://homebrew.1password.com/people). - Make them owners on the [`machomebrew` private maintainers Slack](https://machomebrew.slack.com/admin)).
false
Other
Homebrew
brew
1d003e5d8a292443d4489acd2ec80e1f4d2b3476.json
formula_assertions: add assert_not_match compat There are some formulae using this method: https://github.com/Homebrew/homebrew-core/search?q=assert_not_match&type=
Library/Homebrew/formula_assertions.rb
@@ -28,6 +28,7 @@ def assertions assert_not_includes: :refute_includes, assert_not_instance_of: :refute_instance_of, assert_not_kind_of: :refute_kind_of, + assert_not_match: :refute_match, assert_no_match: :refute_match, assert_not_nil: :refute_nil, assert_not_operator: :refute_operator,
false
Other
Homebrew
brew
95d18132d332e2377f29decac4e09625d8bebed3.json
sorbet: Update RBI files. Autogenerated by the [sorbet](https://github.com/Homebrew/brew/blob/master/.github/workflows/sorbet.yml) workflow.
Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi
@@ -532,14 +532,6 @@ class ActiveSupport::CurrentAttributes def _reset_callbacks(); end def _run_reset_callbacks(&block); end - - def attributes(); end - - def attributes=(attributes); end - - def reset(); end - - def set(set_attributes); end end class ActiveSupport::CurrentAttributes @@ -561,17 +553,9 @@ class ActiveSupport::CurrentAttributes def self.before_reset(&block); end - def self.clear_all(); end - def self.instance(); end - def self.reset(*args, &block); end - - def self.reset_all(); end - def self.resets(&block); end - - def self.set(*args, &block); end end module ActiveSupport::Dependencies @@ -2830,99 +2814,12 @@ end class Bootsnap::CompileCache::Error end -module Bootsnap::CompileCache::ISeq -end - -module Bootsnap::CompileCache::ISeq::InstructionSequenceMixin - def compile_option=(hash); end - - def load_iseq(path); end -end - -module Bootsnap::CompileCache::ISeq::InstructionSequenceMixin -end - -module Bootsnap::CompileCache::ISeq - def self.cache_dir(); end - - def self.cache_dir=(cache_dir); end - - def self.compile_option_updated(); end - - def self.fetch(path, cache_dir: T.unsafe(nil)); end - - def self.input_to_output(_data, _kwargs); end - - def self.input_to_storage(_, path); end - - def self.install!(cache_dir); end - - def self.precompile(path, cache_dir: T.unsafe(nil)); end - - def self.storage_to_output(binary, _args); end -end - -module Bootsnap::CompileCache::Native -end - -module Bootsnap::CompileCache::Native - def self.compile_option_crc32=(compile_option_crc32); end - - def self.coverage_running?(); end - - def self.fetch(_, _1, _2, _3); end - - def self.precompile(_, _1, _2); end -end - class Bootsnap::CompileCache::PermissionError end class Bootsnap::CompileCache::PermissionError end -class Bootsnap::CompileCache::Uncompilable -end - -class Bootsnap::CompileCache::Uncompilable -end - -module Bootsnap::CompileCache::YAML -end - -module Bootsnap::CompileCache::YAML::Patch - def load_file(path, *args); end -end - -module Bootsnap::CompileCache::YAML::Patch -end - -module Bootsnap::CompileCache::YAML - def self.cache_dir(); end - - def self.cache_dir=(cache_dir); end - - def self.init!(); end - - def self.input_to_output(data, kwargs); end - - def self.input_to_storage(contents, _); end - - def self.install!(cache_dir); end - - def self.msgpack_factory(); end - - def self.msgpack_factory=(msgpack_factory); end - - def self.precompile(path, cache_dir: T.unsafe(nil)); end - - def self.storage_to_output(data, kwargs); end - - def self.supported_options(); end - - def self.supported_options=(supported_options); end -end - module Bootsnap::CompileCache def self.permission_error(path); end @@ -3053,13 +2950,6 @@ module Bootsnap::LoadPathCache::ChangeObserver def self.register(observer, arr); end end -module Bootsnap::LoadPathCache::CoreExt -end - -module Bootsnap::LoadPathCache::CoreExt - def self.make_load_error(path); end -end - class Bootsnap::LoadPathCache::FallbackScan end @@ -5684,15 +5574,6 @@ module Cask::Caskroom extend ::T::Private::Methods::SingletonMethodHooks end -class Cask::Cmd::AbstractCommand - include ::Homebrew::Search::Extension -end - -class Cask::Cmd::AbstractCommand - extend ::T::Private::Methods::MethodHooks - extend ::T::Private::Methods::SingletonMethodHooks -end - class Cask::Config def appdir(); end @@ -7140,6 +7021,8 @@ end class Errno::EBADRPC end +Errno::ECAPMODE = Errno::NOERROR + Errno::EDEADLOCK = Errno::NOERROR class Errno::EDEVERR @@ -7160,6 +7043,13 @@ end Errno::EIPSEC = Errno::NOERROR +class Errno::ELAST + Errno = ::T.let(nil, ::T.untyped) +end + +class Errno::ELAST +end + class Errno::ENEEDAUTH Errno = ::T.let(nil, ::T.untyped) end @@ -7181,6 +7071,8 @@ end class Errno::ENOPOLICY end +Errno::ENOTCAPABLE = Errno::NOERROR + class Errno::ENOTSUP Errno = ::T.let(nil, ::T.untyped) end @@ -7223,12 +7115,7 @@ end class Errno::EPWROFF end -class Errno::EQFULL - Errno = ::T.let(nil, ::T.untyped) -end - -class Errno::EQFULL -end +Errno::EQFULL = Errno::ELAST class Errno::ERPCMISMATCH Errno = ::T.let(nil, ::T.untyped) @@ -8158,6 +8045,37 @@ module Homebrew MIN_PORT = ::T.let(nil, ::T.untyped) end +module Homebrew::Assertions + include ::Minitest::Assertions + def assert_no_match(*args); end + + def assert_not_empty(*args); end + + def assert_not_equal(*args); end + + def assert_not_in_delta(*args); end + + def assert_not_in_epsilon(*args); end + + def assert_not_includes(*args); end + + def assert_not_instance_of(*args); end + + def assert_not_kind_of(*args); end + + def assert_not_nil(*args); end + + def assert_not_operator(*args); end + + def assert_not_predicate(*args); end + + def assert_not_respond_to(*args); end + + def assert_not_same(*args); end + + def assert_raise(*args); end +end + class Homebrew::BundleVersion extend ::T::Private::Methods::MethodHooks extend ::T::Private::Methods::SingletonMethodHooks @@ -8364,14 +8282,6 @@ module Homebrew::Livecheck extend ::T::Private::Methods::SingletonMethodHooks end -module Homebrew::MissingFormula - extend ::T::Private::Methods::SingletonMethodHooks -end - -module Homebrew::Search - include ::Homebrew::Search::Extension -end - module Homebrew::Settings extend ::T::Private::Methods::MethodHooks extend ::T::Private::Methods::SingletonMethodHooks @@ -9728,13 +9638,11 @@ module Kernel extend ::T::Private::Methods::SingletonMethodHooks def self.at_exit(); end - def self.autoload(_, _1); end - def self.fork(); end def self.gem(dep, *reqs); end - def self.load(path, wrap=T.unsafe(nil)); end + def self.load(*_); end def self.require(path); end end @@ -12044,8 +11952,6 @@ class Module def anonymous?(); end - def autoload_without_bootsnap(_, _1); end - def context(*a, &b); end def deprecate(*method_names); end @@ -12400,9 +12306,13 @@ end Net::HTTPFatalErrorCode = Net::HTTPClientError -Net::HTTPInformation::EXCEPTION_TYPE = Net::HTTPError +class Net::HTTPInformation +end -Net::HTTPInformationCode = Net::HTTPInformation +Net::HTTPInformationCode::EXCEPTION_TYPE = Net::HTTPError + +class Net::HTTPInformation +end class Net::HTTPLoopDetected HAS_BODY = ::T.let(nil, ::T.untyped) @@ -12466,9 +12376,13 @@ Net::HTTPServerErrorCode = Net::HTTPServerError Net::HTTPSession = Net::HTTP -Net::HTTPSuccess::EXCEPTION_TYPE = Net::HTTPError +class Net::HTTPSuccess +end + +Net::HTTPSuccessCode::EXCEPTION_TYPE = Net::HTTPError -Net::HTTPSuccessCode = Net::HTTPSuccess +class Net::HTTPSuccess +end class Net::HTTPURITooLong HAS_BODY = ::T.let(nil, ::T.untyped) @@ -12638,7 +12552,6 @@ class Object def to_query(key); end def to_yaml(options=T.unsafe(nil)); end - APPLE_GEM_HOME = ::T.let(nil, ::T.untyped) ARGF = ::T.let(nil, ::T.untyped) ARGV = ::T.let(nil, ::T.untyped) BUG_REPORTS_URL = ::T.let(nil, ::T.untyped) @@ -12679,6 +12592,7 @@ class Object HOMEBREW_RELEASES_URL_REGEX = ::T.let(nil, ::T.untyped) HOMEBREW_REPOSITORY = ::T.let(nil, ::T.untyped) HOMEBREW_REQUIRED_RUBY_VERSION = ::T.let(nil, ::T.untyped) + HOMEBREW_RUBY_EXEC_ARGS = ::T.let(nil, ::T.untyped) HOMEBREW_SHIMS_PATH = ::T.let(nil, ::T.untyped) HOMEBREW_TAP_CASK_REGEX = ::T.let(nil, ::T.untyped) HOMEBREW_TAP_DIR_REGEX = ::T.let(nil, ::T.untyped) @@ -12703,8 +12617,6 @@ class Object RUBY_DESCRIPTION = ::T.let(nil, ::T.untyped) RUBY_ENGINE = ::T.let(nil, ::T.untyped) RUBY_ENGINE_VERSION = ::T.let(nil, ::T.untyped) - RUBY_FRAMEWORK = ::T.let(nil, ::T.untyped) - RUBY_FRAMEWORK_VERSION = ::T.let(nil, ::T.untyped) RUBY_PATCHLEVEL = ::T.let(nil, ::T.untyped) RUBY_PATH = ::T.let(nil, ::T.untyped) RUBY_PLATFORM = ::T.let(nil, ::T.untyped) @@ -12757,7 +12669,11 @@ class OpenSSL::KDF::KDFError end module OpenSSL::KDF + def self.hkdf(*_); end + def self.pbkdf2_hmac(*_); end + + def self.scrypt(*_); end end class OpenSSL::OCSP::Request @@ -12766,20 +12682,29 @@ end OpenSSL::PKCS7::Signer = OpenSSL::PKCS7::SignerInfo +class OpenSSL::PKey::EC + EXPLICIT_CURVE = ::T.let(nil, ::T.untyped) +end + class OpenSSL::PKey::EC::Point def to_octet_string(_); end end module OpenSSL::SSL + OP_ALLOW_NO_DHE_KEX = ::T.let(nil, ::T.untyped) OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION = ::T.let(nil, ::T.untyped) OP_CRYPTOPRO_TLSEXT_BUG = ::T.let(nil, ::T.untyped) OP_LEGACY_SERVER_CONNECT = ::T.let(nil, ::T.untyped) + OP_NO_ENCRYPT_THEN_MAC = ::T.let(nil, ::T.untyped) + OP_NO_RENEGOTIATION = ::T.let(nil, ::T.untyped) + OP_NO_TLSv1_3 = ::T.let(nil, ::T.untyped) OP_SAFARI_ECDHE_ECDSA_BUG = ::T.let(nil, ::T.untyped) OP_TLSEXT_PADDING = ::T.let(nil, ::T.untyped) SSL2_VERSION = ::T.let(nil, ::T.untyped) SSL3_VERSION = ::T.let(nil, ::T.untyped) TLS1_1_VERSION = ::T.let(nil, ::T.untyped) TLS1_2_VERSION = ::T.let(nil, ::T.untyped) + TLS1_3_VERSION = ::T.let(nil, ::T.untyped) TLS1_VERSION = ::T.let(nil, ::T.untyped) end @@ -17191,7 +17116,6 @@ module Psych end module Psych - extend ::Bootsnap::CompileCache::YAML::Patch def self.add_builtin_type(type_tag, &block); end def self.add_domain_type(domain, type_tag, &block); end @@ -27963,10 +27887,6 @@ class RubyVM::AbstractSyntaxTree::Node def pretty_print_children(q, names=T.unsafe(nil)); end end -class RubyVM::InstructionSequence - extend ::Bootsnap::CompileCache::ISeq::InstructionSequenceMixin -end - module RubyVM::MJIT end @@ -28856,7 +28776,6 @@ class Socket IPV6_PATHMTU = ::T.let(nil, ::T.untyped) IPV6_RECVPATHMTU = ::T.let(nil, ::T.untyped) IPV6_USE_MIN_MTU = ::T.let(nil, ::T.untyped) - IP_DONTFRAG = ::T.let(nil, ::T.untyped) IP_PORTRANGE = ::T.let(nil, ::T.untyped) IP_RECVDSTADDR = ::T.let(nil, ::T.untyped) IP_RECVIF = ::T.let(nil, ::T.untyped) @@ -28948,7 +28867,6 @@ module Socket::Constants IPV6_PATHMTU = ::T.let(nil, ::T.untyped) IPV6_RECVPATHMTU = ::T.let(nil, ::T.untyped) IPV6_USE_MIN_MTU = ::T.let(nil, ::T.untyped) - IP_DONTFRAG = ::T.let(nil, ::T.untyped) IP_PORTRANGE = ::T.let(nil, ::T.untyped) IP_RECVDSTADDR = ::T.let(nil, ::T.untyped) IP_RECVIF = ::T.let(nil, ::T.untyped)
true
Other
Homebrew
brew
95d18132d332e2377f29decac4e09625d8bebed3.json
sorbet: Update RBI files. Autogenerated by the [sorbet](https://github.com/Homebrew/brew/blob/master/.github/workflows/sorbet.yml) workflow.
Library/Homebrew/sorbet/rbi/todo.rbi
@@ -9,5 +9,3 @@ module T::InterfaceWrapper::Helpers; end module T::Private::Abstract::Hooks; end module T::Private::Methods::MethodHooks; end module T::Private::Methods::SingletonMethodHooks; end -module Test::Unit::AssertionFailedError; end -module Test::Unit::Assertions; end
true
Other
Homebrew
brew
7a40f1bf0abe181499b4addcfd4d6a6041726a32.json
os/mac: fix version error for prerelease macOS
Library/Homebrew/os/mac.rb
@@ -25,7 +25,7 @@ module Mac # This can be compared to numerics, strings, or symbols # using the standard Ruby Comparable methods. def version - @version ||= Version.from_symbol(full_version.to_sym) + @version ||= full_version.strip_patch end # This can be compared to numerics, strings, or symbols
false