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 | 8e5451df2fe2bafcfbfafa10646b8ebab10fef5a.json | style: use parentheses for assignment in conditions | Library/Homebrew/download_strategy.rb | @@ -441,11 +441,11 @@ def resolve_url_basename_time_file_size(url)
content_disposition_parser = Mechanize::HTTP::ContentDispositionParser.new
parse_content_disposition = lambda do |line|
- next unless content_disposition = content_disposition_parser.parse(line.sub(/; *$/, ""), true)
+ next unless (content_disposition = content_disposition_parser.parse(line.sub(/; *$/, ""), true))
filename = nil
- if filename_with_encoding = content_disposition.parameters["filename*"]
+ if (filename_with_encoding = content_disposition.parameters["filename*"])
encoding, encoded_filename = filename_with_encoding.split("''", 2)
filename = URI.decode_www_form_component(encoded_filename).encode(encoding) if encoding && encoded_filename
end | true |
Other | Homebrew | brew | 8e5451df2fe2bafcfbfafa10646b8ebab10fef5a.json | style: use parentheses for assignment in conditions | Library/Homebrew/exceptions.rb | @@ -453,7 +453,7 @@ def dump(verbose: false)
if formula.tap && defined?(OS::ISSUES_URL)
if formula.tap.official?
puts Formatter.error(Formatter.url(OS::ISSUES_URL), label: "READ THIS")
- elsif issues_url = formula.tap.issues_url
+ elsif (issues_url = formula.tap.issues_url)
puts <<~EOS
If reporting this issue please do so at (not Homebrew/brew or Homebrew/core):
#{Formatter.url(issues_url)} | true |
Other | Homebrew | brew | 8e5451df2fe2bafcfbfafa10646b8ebab10fef5a.json | style: use parentheses for assignment in conditions | Library/Homebrew/formula.rb | @@ -2061,7 +2061,7 @@ def system(cmd, *args)
if verbose_using_dots
last_dot = Time.at(0)
- while buf = rd.gets
+ while (buf = rd.gets)
log.puts buf
# make sure dots printed with interval of at least 1 min.
next unless (Time.now - last_dot) > 60
@@ -2072,7 +2072,7 @@ def system(cmd, *args)
end
puts
else
- while buf = rd.gets
+ while (buf = rd.gets)
log.puts buf
puts buf
end | true |
Other | Homebrew | brew | 8e5451df2fe2bafcfbfafa10646b8ebab10fef5a.json | style: use parentheses for assignment in conditions | Library/Homebrew/formula_auditor.rb | @@ -133,7 +133,7 @@ def audit_formula_name
return
end
- if oldname = CoreTap.instance.formula_renames[name]
+ if (oldname = CoreTap.instance.formula_renames[name])
problem "'#{name}' is reserved as the old name of #{oldname} in homebrew/core."
return
end
@@ -367,10 +367,10 @@ def audit_homepage
return unless DevelopmentTools.curl_handles_most_https_certificates?
- if http_content_problem = curl_check_http_content(homepage,
- user_agents: [:browser, :default],
- check_content: true,
- strict: @strict)
+ if (http_content_problem = curl_check_http_content(homepage,
+ user_agents: [:browser, :default],
+ check_content: true,
+ strict: @strict))
problem http_content_problem
end
end
@@ -472,7 +472,7 @@ def audit_specs
%w[Stable HEAD].each do |name|
spec_name = name.downcase.to_sym
- next unless spec = formula.send(spec_name)
+ next unless (spec = formula.send(spec_name))
ra = ResourceAuditor.new(spec, spec_name, online: @online, strict: @strict).audit
ra.problems.each do |message|
@@ -497,7 +497,7 @@ def audit_specs
)
end
- if stable = formula.stable
+ if (stable = formula.stable)
version = stable.version
problem "Stable: version (#{version}) is set to a string without a digit" if version.to_s !~ /\d/
if version.to_s.start_with?("HEAD") | true |
Other | Homebrew | brew | 8e5451df2fe2bafcfbfafa10646b8ebab10fef5a.json | style: use parentheses for assignment in conditions | Library/Homebrew/formula_installer.rb | @@ -575,7 +575,7 @@ def expand_requirements
formula_deps_map = Dependency.expand(formula)
.index_by(&:name)
- while f = formulae.pop
+ while (f = formulae.pop)
runtime_requirements = runtime_requirements(f)
f.recursive_requirements do |dependent, req|
build = effective_build_options_for(dependent) | true |
Other | Homebrew | brew | 8e5451df2fe2bafcfbfafa10646b8ebab10fef5a.json | style: use parentheses for assignment in conditions | Library/Homebrew/formulary.rb | @@ -467,14 +467,14 @@ def self.loader_for(ref, from: nil)
return FormulaLoader.new(name, path)
end
- if newref = CoreTap.instance.formula_renames[ref]
+ if (newref = CoreTap.instance.formula_renames[ref])
formula_with_that_oldname = core_path(newref)
return FormulaLoader.new(newref, formula_with_that_oldname) if formula_with_that_oldname.file?
end
possible_tap_newname_formulae = []
Tap.each do |tap|
- if newref = tap.formula_renames[ref]
+ if (newref = tap.formula_renames[ref])
possible_tap_newname_formulae << "#{tap.name}/#{newref}"
end
end | true |
Other | Homebrew | brew | 8e5451df2fe2bafcfbfafa10646b8ebab10fef5a.json | style: use parentheses for assignment in conditions | Library/Homebrew/livecheck/skip_conditions.rb | @@ -25,7 +25,7 @@ module SkipConditions
def formula_or_cask_skip(formula_or_cask, livecheckable, full_name: false, verbose: false)
formula = formula_or_cask if formula_or_cask.is_a?(Formula)
- if stable_url = formula&.stable&.url
+ if (stable_url = formula&.stable&.url)
stable_is_gist = stable_url.match?(%r{https?://gist\.github(?:usercontent)?\.com/}i)
stable_from_google_code_archive = stable_url.match?(
%r{https?://storage\.googleapis\.com/google-code-archive-downloads/}i, | true |
Other | Homebrew | brew | 8e5451df2fe2bafcfbfafa10646b8ebab10fef5a.json | style: use parentheses for assignment in conditions | Library/Homebrew/livecheck/strategy/sparkle.rb | @@ -61,7 +61,7 @@ def self.item_from_content(content)
title = (item > "title").first&.text&.strip
- if match = title&.match(/(\d+(?:\.\d+)*)\s*(\([^)]+\))?\Z/)
+ if (match = title&.match(/(\d+(?:\.\d+)*)\s*(\([^)]+\))?\Z/))
short_version ||= match[1]
version ||= match[2]
end | true |
Other | Homebrew | brew | 8e5451df2fe2bafcfbfafa10646b8ebab10fef5a.json | style: use parentheses for assignment in conditions | Library/Homebrew/locale.rb | @@ -29,7 +29,7 @@ class ParserError < StandardError
private_constant :LOCALE_REGEX
def self.parse(string)
- if locale = try_parse(string)
+ if (locale = try_parse(string))
return locale
end
@@ -42,12 +42,12 @@ def self.try_parse(string)
scanner = StringScanner.new(string)
- if language = scanner.scan(LANGUAGE_REGEX)
+ if (language = scanner.scan(LANGUAGE_REGEX))
sep = scanner.scan(/-/)
return if (sep && scanner.eos?) || (sep.nil? && !scanner.eos?)
end
- if region = scanner.scan(REGION_REGEX)
+ if (region = scanner.scan(REGION_REGEX))
sep = scanner.scan(/-/)
return if (sep && scanner.eos?) || (sep.nil? && !scanner.eos?)
end | true |
Other | Homebrew | brew | 8e5451df2fe2bafcfbfafa10646b8ebab10fef5a.json | style: use parentheses for assignment in conditions | Library/Homebrew/migrator.rb | @@ -138,7 +138,7 @@ def initialize(formula, force: false)
@new_cellar = HOMEBREW_CELLAR/formula.name
@new_cellar_existed = @new_cellar.exist?
- if @old_linked_keg = linked_old_linked_keg
+ if (@old_linked_keg = linked_old_linked_keg)
@old_linked_keg_record = old_linked_keg.linked_keg_record if old_linked_keg.linked?
@old_opt_record = old_linked_keg.opt_record if old_linked_keg.optlinked?
@new_linked_keg_record = HOMEBREW_CELLAR/"#{newname}/#{File.basename(old_linked_keg)}"
@@ -165,7 +165,7 @@ def from_same_tap_user?
new_tap = if old_tap
old_tap_user, = old_tap.user
- if migrate_tap = old_tap.tap_migrations[formula.oldname]
+ if (migrate_tap = old_tap.tap_migrations[formula.oldname])
new_tap_user, new_tap_repo = migrate_tap.split("/")
"#{new_tap_user}/#{new_tap_repo}"
end | true |
Other | Homebrew | brew | 8e5451df2fe2bafcfbfafa10646b8ebab10fef5a.json | style: use parentheses for assignment in conditions | Library/Homebrew/patch.rb | @@ -84,7 +84,7 @@ def contents
line = f.gets
break if line.nil? || line =~ /^__END__$/
end
- while line = f.gets
+ while (line = f.gets)
data << line
end
end | true |
Other | Homebrew | brew | 8e5451df2fe2bafcfbfafa10646b8ebab10fef5a.json | style: use parentheses for assignment in conditions | Library/Homebrew/requirements/x11_requirement.rb | @@ -31,12 +31,12 @@ def min_xdpyinfo_version
end
satisfy build_env: false do
- if which_xorg = which("Xorg")
+ if (which_xorg = which("Xorg"))
version = Utils.popen_read(which_xorg, "-version", err: :out)[/X Server (\d+\.\d+\.\d+)/, 1]
next true if $CHILD_STATUS.success? && version && Version.new(version) >= min_version
end
- if which_xdpyinfo = which("xdpyinfo")
+ if (which_xdpyinfo = which("xdpyinfo"))
version = Utils.popen_read(which_xdpyinfo, "-version")[/^xdpyinfo (\d+\.\d+\.\d+)/, 1]
next true if $CHILD_STATUS.success? && version && Version.new(version) >= min_xdpyinfo_version
end | true |
Other | Homebrew | brew | 8e5451df2fe2bafcfbfafa10646b8ebab10fef5a.json | style: use parentheses for assignment in conditions | Library/Homebrew/resource_auditor.rb | @@ -105,7 +105,7 @@ def audit_urls
# pull request.
next if url.match?(%r{^https://dl.bintray.com/homebrew/mirror/})
- if http_content_problem = curl_check_http_content(url, specs: specs)
+ if (http_content_problem = curl_check_http_content(url, specs: specs))
problem http_content_problem
end
elsif strategy <= GitDownloadStrategy | true |
Other | Homebrew | brew | 8e5451df2fe2bafcfbfafa10646b8ebab10fef5a.json | style: use parentheses for assignment in conditions | Library/Homebrew/rubocops/class.rb | @@ -47,7 +47,7 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node)
test_calls(test) do |node, params|
p1, p2 = params
- if match = string_content(p1).match(%r{(/usr/local/(s?bin))})
+ if (match = string_content(p1).match(%r{(/usr/local/(s?bin))}))
offending_node(p1)
problem "use \#{#{match[2]}} instead of #{match[1]} in #{node}" do |corrector|
corrector.replace(p1.source_range, p1.source.sub(match[1], "\#{#{match[2]}}")) | true |
Other | Homebrew | brew | 8e5451df2fe2bafcfbfafa10646b8ebab10fef5a.json | style: use parentheses for assignment in conditions | Library/Homebrew/rubocops/extend/formula.rb | @@ -155,7 +155,7 @@ def versioned_formula?
# Returns the formula tap.
def formula_tap
- return unless match_obj = @file_path.match(%r{/(homebrew-\w+)/})
+ return unless (match_obj = @file_path.match(%r{/(homebrew-\w+)/}))
match_obj[1]
end | true |
Other | Homebrew | brew | 8e5451df2fe2bafcfbfafa10646b8ebab10fef5a.json | style: use parentheses for assignment in conditions | Library/Homebrew/rubocops/lines.rb | @@ -162,15 +162,15 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node)
find_instance_method_call(body_node, :build, :without?) do |method|
arg = parameters(method).first
- next unless match = regex_match_group(arg, /^-?-?without-(.*)/)
+ next unless (match = regex_match_group(arg, /^-?-?without-(.*)/))
problem "Don't duplicate 'without': " \
"Use `build.without? \"#{match[1]}\"` to check for \"--without-#{match[1]}\""
end
find_instance_method_call(body_node, :build, :with?) do |method|
arg = parameters(method).first
- next unless match = regex_match_group(arg, /^-?-?with-(.*)/)
+ next unless (match = regex_match_group(arg, /^-?-?with-(.*)/))
problem "Don't duplicate 'with': Use `build.with? \"#{match[1]}\"` to check for \"--with-#{match[1]}\""
end
@@ -258,7 +258,7 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node)
popen_commands.each do |command|
find_instance_method_call(body_node, "Utils", command) do |method|
- next unless match = regex_match_group(parameters(method).first, /^([^"' ]+)=([^"' ]+)(?: (.*))?$/)
+ next unless (match = regex_match_group(parameters(method).first, /^([^"' ]+)=([^"' ]+)(?: (.*))?$/))
good_args = "Utils.#{command}({ \"#{match[1]}\" => \"#{match[2]}\" }, \"#{match[3]}\")"
@@ -329,7 +329,7 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node)
find_strings(body_node).each do |str|
content = string_content(str)
- next unless match = content.match(/^python(@)?(\d\.\d+)$/)
+ next unless (match = content.match(/^python(@)?(\d\.\d+)$/))
next if python_version == match[2]
fix = if match[1]
@@ -385,59 +385,59 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node)
end
find_instance_method_call(body_node, :man, :+) do |method|
- next unless match = regex_match_group(parameters(method).first, /^man[1-8]$/)
+ next unless (match = regex_match_group(parameters(method).first, /^man[1-8]$/))
problem "\"#{method.source}\" should be \"#{match[0]}\""
end
# Avoid hard-coding compilers
find_every_method_call_by_name(body_node, :system).each do |method|
param = parameters(method).first
- if match = regex_match_group(param, %r{^(/usr/bin/)?(gcc|llvm-gcc|clang)(\s|$)})
+ if (match = regex_match_group(param, %r{^(/usr/bin/)?(gcc|llvm-gcc|clang)(\s|$)}))
problem "Use \"\#{ENV.cc}\" instead of hard-coding \"#{match[2]}\""
- elsif match = regex_match_group(param, %r{^(/usr/bin/)?((g|llvm-g|clang)\+\+)(\s|$)})
+ elsif (match = regex_match_group(param, %r{^(/usr/bin/)?((g|llvm-g|clang)\+\+)(\s|$)}))
problem "Use \"\#{ENV.cxx}\" instead of hard-coding \"#{match[2]}\""
end
end
find_instance_method_call(body_node, "ENV", :[]=) do |method|
param = parameters(method)[1]
- if match = regex_match_group(param, %r{^(/usr/bin/)?(gcc|llvm-gcc|clang)(\s|$)})
+ if (match = regex_match_group(param, %r{^(/usr/bin/)?(gcc|llvm-gcc|clang)(\s|$)}))
problem "Use \"\#{ENV.cc}\" instead of hard-coding \"#{match[2]}\""
- elsif match = regex_match_group(param, %r{^(/usr/bin/)?((g|llvm-g|clang)\+\+)(\s|$)})
+ elsif (match = regex_match_group(param, %r{^(/usr/bin/)?((g|llvm-g|clang)\+\+)(\s|$)}))
problem "Use \"\#{ENV.cxx}\" instead of hard-coding \"#{match[2]}\""
end
end
# Prefer formula path shortcuts in strings
formula_path_strings(body_node, :share) do |p|
- next unless match = regex_match_group(p, %r{^(/(man))/?})
+ next unless (match = regex_match_group(p, %r{^(/(man))/?}))
problem "\"\#{share}#{match[1]}\" should be \"\#{#{match[2]}}\""
end
formula_path_strings(body_node, :prefix) do |p|
- if match = regex_match_group(p, %r{^(/share/(info|man))$})
+ if (match = regex_match_group(p, %r{^(/share/(info|man))$}))
problem "\"\#\{prefix}#{match[1]}\" should be \"\#{#{match[2]}}\""
end
- if match = regex_match_group(p, %r{^((/share/man/)(man[1-8]))})
+ if (match = regex_match_group(p, %r{^((/share/man/)(man[1-8]))}))
problem "\"\#\{prefix}#{match[1]}\" should be \"\#{#{match[3]}}\""
end
- if match = regex_match_group(p, %r{^(/(bin|include|libexec|lib|sbin|share|Frameworks))}i)
+ if (match = regex_match_group(p, %r{^(/(bin|include|libexec|lib|sbin|share|Frameworks))}i))
problem "\"\#\{prefix}#{match[1]}\" should be \"\#{#{match[2].downcase}}\""
end
end
find_every_method_call_by_name(body_node, :depends_on).each do |method|
key, value = destructure_hash(parameters(method).first)
next if key.nil? || value.nil?
- next unless match = regex_match_group(value, /^(lua|perl|python|ruby)(\d*)/)
+ next unless (match = regex_match_group(value, /^(lua|perl|python|ruby)(\d*)/))
problem "#{match[1]} modules should be vendored rather than use deprecated `#{method.source}`"
end
find_every_method_call_by_name(body_node, :system).each do |method|
- next unless match = regex_match_group(parameters(method).first, /^(env|export)(\s+)?/)
+ next unless (match = regex_match_group(parameters(method).first, /^(env|export)(\s+)?/))
problem "Use ENV instead of invoking '#{match[1]}' to modify the environment"
end
@@ -449,7 +449,7 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node)
option_child_nodes.each do |option|
find_strings(option).each do |dependency|
- next unless match = regex_match_group(dependency, /(with(out)?-\w+|c\+\+11)/)
+ next unless (match = regex_match_group(dependency, /(with(out)?-\w+|c\+\+11)/))
problem "Dependency #{string_content(dep)} should not use option #{match[0]}"
end
@@ -551,7 +551,7 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node)
path = parameters(method).first
next unless path.str_type?
- next unless match = regex_match_group(path, /^[^*{},]+$/)
+ next unless (match = regex_match_group(path, /^[^*{},]+$/))
problem "Dir([\"#{string_content(path)}\"]) is unnecessary; just use \"#{match[0]}\""
end
@@ -563,7 +563,7 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node)
)
find_every_method_call_by_name(body_node, :system).each do |method|
param = parameters(method).first
- next unless match = regex_match_group(param, fileutils_methods)
+ next unless (match = regex_match_group(param, fileutils_methods))
problem "Use the `#{match}` Ruby method instead of `#{method.source}`"
end
@@ -663,7 +663,7 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node)
# Only separate when no shell metacharacters are present
next if shell_metacharacters.any? { |meta| string_content(parameters(method).first).include?(meta) }
- next unless match = regex_match_group(parameters(method).first, shell_cmd_with_spaces_regex)
+ next unless (match = regex_match_group(parameters(method).first, shell_cmd_with_spaces_regex))
good_args = match[0].gsub(" ", "\", \"")
offending_node(parameters(method).first)
@@ -679,7 +679,7 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node)
# Only separate when no shell metacharacters are present
next if shell_metacharacters.any? { |meta| string_content(parameters(method)[index]).include?(meta) }
- next unless match = regex_match_group(parameters(method)[index], shell_cmd_with_spaces_regex)
+ next unless (match = regex_match_group(parameters(method)[index], shell_cmd_with_spaces_regex))
good_args = match[0].gsub(" ", "\", \"")
offending_node(parameters(method)[index]) | true |
Other | Homebrew | brew | 8e5451df2fe2bafcfbfafa10646b8ebab10fef5a.json | style: use parentheses for assignment in conditions | Library/Homebrew/rubocops/shared/desc_helper.rb | @@ -44,7 +44,7 @@ def audit_desc(type, name, desc_call)
desc_problem "Description shouldn't have trailing spaces." if regex_match_group(desc, /\s+$/)
# Check if "command-line" is spelled incorrectly in the desc.
- if match = regex_match_group(desc, /(command ?line)/i)
+ if (match = regex_match_group(desc, /(command ?line)/i))
c = match.to_s[0]
desc_problem "Description should use \"#{c}ommand-line\" instead of \"#{match}\"."
end | true |
Other | Homebrew | brew | 8e5451df2fe2bafcfbfafa10646b8ebab10fef5a.json | style: use parentheses for assignment in conditions | Library/Homebrew/rubocops/text.rb | @@ -15,7 +15,7 @@ class Text < FormulaCop
def audit_formula(node, _class_node, _parent_class_node, body_node)
full_source_content = source_buffer(node).source
- if match = full_source_content.match(/^require ['"]formula['"]$/)
+ if (match = full_source_content.match(/^require ['"]formula['"]$/))
range = source_range(source_buffer(node), match.pre_match.count("\n") + 1, 0, match[0].length)
add_offense(range, message: "`#{match}` is now unnecessary") do |corrector|
corrector.remove(range_with_surrounding_space(range: range))
@@ -95,7 +95,7 @@ def audit_formula(node, _class_node, _parent_class_node, body_node)
end
prefix_path(body_node) do |prefix_node, path|
- next unless match = path.match(%r{^(bin|include|libexec|lib|sbin|share|Frameworks)(?:/| |$)})
+ next unless (match = path.match(%r{^(bin|include|libexec|lib|sbin|share|Frameworks)(?:/| |$)}))
offending_node(prefix_node)
problem "Use `#{match[1].downcase}` instead of `prefix + \"#{match[1]}\"`" | true |
Other | Homebrew | brew | 8e5451df2fe2bafcfbfafa10646b8ebab10fef5a.json | style: use parentheses for assignment in conditions | Library/Homebrew/search.rb | @@ -10,7 +10,7 @@ module Homebrew
# @api private
module Search
def query_regexp(query)
- if m = query.match(%r{^/(.*)/$})
+ if (m = query.match(%r{^/(.*)/$}))
Regexp.new(m[1])
else
query | true |
Other | Homebrew | brew | 8e5451df2fe2bafcfbfafa10646b8ebab10fef5a.json | style: use parentheses for assignment in conditions | Library/Homebrew/uninstall.rb | @@ -108,7 +108,7 @@ def handle_unsatisfied_dependents(kegs_by_rack, casks: [], ignore_dependencies:
end
def check_for_dependents(kegs, casks: [], named_args: [])
- return false unless result = InstalledDependents.find_some_installed_dependents(kegs, casks: casks)
+ return false unless (result = InstalledDependents.find_some_installed_dependents(kegs, casks: casks))
if Homebrew::EnvConfig.developer?
DeveloperDependentsMessage.new(*result, named_args: named_args).output | true |
Other | Homebrew | brew | 8e5451df2fe2bafcfbfafa10646b8ebab10fef5a.json | style: use parentheses for assignment in conditions | Library/Homebrew/utils.rb | @@ -223,7 +223,7 @@ def odeprecated(method, replacement = nil, disable: false, disable_on: nil, call
tap_message = T.let(nil, T.nilable(String))
backtrace.each do |line|
- next unless match = line.match(HOMEBREW_TAP_PATH_REGEX)
+ next unless (match = line.match(HOMEBREW_TAP_PATH_REGEX))
tap = Tap.fetch(match[:user], match[:repo])
tap_message = +"\nPlease report this issue to the #{tap} tap (not Homebrew/brew or Homebrew/core)" | true |
Other | Homebrew | brew | 8e5451df2fe2bafcfbfafa10646b8ebab10fef5a.json | style: use parentheses for assignment in conditions | Library/Homebrew/utils/pypi.rb | @@ -42,7 +42,7 @@ def initialize(package_string, is_url: false)
@name = package_string
@name, @version = @name.split("==") if @name.include? "=="
- return unless match = @name.match(/^(.*?)\[(.+)\]$/)
+ return unless (match = @name.match(/^(.*?)\[(.+)\]$/))
@name = match[1]
@extras = match[2].split "," | true |
Other | Homebrew | brew | 8e5451df2fe2bafcfbfafa10646b8ebab10fef5a.json | style: use parentheses for assignment in conditions | Library/Homebrew/version.rb | @@ -115,7 +115,7 @@ def initialize
sig { override.params(other: T.untyped).returns(T.nilable(Integer)) }
def <=>(other)
- return unless other = Token.from(other)
+ return unless (other = Token.from(other))
case other
when NullToken
@@ -158,7 +158,7 @@ def initialize(value)
sig { override.params(other: T.untyped).returns(T.nilable(Integer)) }
def <=>(other)
- return unless other = Token.from(other)
+ return unless (other = Token.from(other))
case other
when StringToken
@@ -184,7 +184,7 @@ def initialize(value)
sig { override.params(other: T.untyped).returns(T.nilable(Integer)) }
def <=>(other)
- return unless other = Token.from(other)
+ return unless (other = Token.from(other))
case other
when NumericToken
@@ -216,7 +216,7 @@ class AlphaToken < CompositeToken
sig { override.params(other: T.untyped).returns(T.nilable(Integer)) }
def <=>(other)
- return unless other = Token.from(other)
+ return unless (other = Token.from(other))
case other
when AlphaToken
@@ -235,7 +235,7 @@ class BetaToken < CompositeToken
sig { override.params(other: T.untyped).returns(T.nilable(Integer)) }
def <=>(other)
- return unless other = Token.from(other)
+ return unless (other = Token.from(other))
case other
when BetaToken
@@ -256,7 +256,7 @@ class PreToken < CompositeToken
sig { override.params(other: T.untyped).returns(T.nilable(Integer)) }
def <=>(other)
- return unless other = Token.from(other)
+ return unless (other = Token.from(other))
case other
when PreToken
@@ -277,7 +277,7 @@ class RCToken < CompositeToken
sig { override.params(other: T.untyped).returns(T.nilable(Integer)) }
def <=>(other)
- return unless other = Token.from(other)
+ return unless (other = Token.from(other))
case other
when RCToken
@@ -298,7 +298,7 @@ class PatchToken < CompositeToken
sig { override.params(other: T.untyped).returns(T.nilable(Integer)) }
def <=>(other)
- return unless other = Token.from(other)
+ return unless (other = Token.from(other))
case other
when PatchToken
@@ -317,7 +317,7 @@ class PostToken < CompositeToken
sig { override.params(other: T.untyped).returns(T.nilable(Integer)) }
def <=>(other)
- return unless other = Token.from(other)
+ return unless (other = Token.from(other))
case other
when PostToken | true |
Other | Homebrew | brew | 983f7f6f1322b216843aae7031c1030d1e2f7f0a.json | Gemfile.lock: update sorbet-runtime to match sorbet | Library/Homebrew/Gemfile.lock | @@ -141,7 +141,7 @@ GEM
simplecov_json_formatter (0.1.2)
sorbet (0.5.6274)
sorbet-static (= 0.5.6274)
- sorbet-runtime (0.5.6267)
+ sorbet-runtime (0.5.6274)
sorbet-runtime-stub (0.2.0)
sorbet-static (0.5.6274-universal-darwin-14)
spoom (1.0.7) | false |
Other | Homebrew | brew | f66c47198ec13ce245e5bac06b8bad5d189de837.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/gems/warning@1.1.0.rbi | @@ -0,0 +1,8 @@
+# DO NOT EDIT MANUALLY
+# This is an autogenerated file for types exported from the `warning` gem.
+# Please instead update this file by running `tapioca sync`.
+
+# typed: true
+
+# THIS IS AN EMPTY RBI FILE.
+# see https://github.com/Shopify/tapioca/blob/master/README.md#manual-gem-requires | true |
Other | Homebrew | brew | f66c47198ec13ce245e5bac06b8bad5d189de837.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 | @@ -30018,8 +30018,27 @@ class WEBrick::HTTPServlet::FileHandler
def set_filesystem_encoding(str); end
end
+module Warning::Processor
+ def clear(); end
+
+ def dedup(); end
+
+ def freeze(); end
+
+ def ignore(regexp, path=T.unsafe(nil)); end
+
+ def process(path=T.unsafe(nil), actions=T.unsafe(nil), &block); end
+
+ def warn(str); end
+ IGNORE_MAP = ::T.let(nil, ::T.untyped)
+end
+
+module Warning::Processor
+end
+
module Warning
extend ::Warning
+ extend ::Warning::Processor
end
class WeakRef | true |
Other | Homebrew | brew | 810b8e515b65e4a4e98301acd8e4cb214b33bab7.json | dev-cmd/man: remove diacritics for manpage | Library/Homebrew/dev-cmd/man.rb | @@ -62,6 +62,7 @@ def regenerate_man_pages(preserve_date:, quiet:)
markup = build_man_page(quiet: quiet)
convert_man_page(markup, TARGET_DOC_PATH/"Manpage.md", preserve_date: preserve_date)
+ markup = I18n.transliterate(markup, locale: :en)
convert_man_page(markup, TARGET_MAN_PATH/"brew.1", preserve_date: preserve_date)
end
| true |
Other | Homebrew | brew | 810b8e515b65e4a4e98301acd8e4cb214b33bab7.json | dev-cmd/man: remove diacritics for manpage | manpages/brew.1 | @@ -2852,7 +2852,7 @@ Homebrew\'s Technical Steering Committee is FX Coudert, Markus Reiter, Michka Po
Homebrew\'s Linux maintainers are Daniel Nachun, Dawid Dziurla, Issy Long, Jonathan Chang, Michka Popoff and Shaun Jackman\.
.
.P
-Homebrew\'s other current maintainers are Alexander Bayandin, Bo Anderson, Caleb Xu, Carlo Cabrera, Claudia Pellegrino, Dustin Rodrigues, Eric Knibbe, Maxim Belkin, Miccal Matthews, Nanda H Krishna, Randall, Rylan Polster, Sam Ford, Seeker, Steve Peters, Thierry Moisan, Tom Schoonjans, Vítor Galvão and rui\.
+Homebrew\'s other current maintainers are Alexander Bayandin, Bo Anderson, Caleb Xu, Carlo Cabrera, Claudia Pellegrino, Dustin Rodrigues, Eric Knibbe, Maxim Belkin, Miccal Matthews, Nanda H Krishna, Randall, Rylan Polster, Sam Ford, Seeker, Steve Peters, Thierry Moisan, Tom Schoonjans, Vitor Galvao and rui\.
.
.P
Former maintainers with significant contributions include Jan Viljanen, JCount, commitay, Dominyk Tiller, Tim Smith, Baptiste Fontaine, Xu Cheng, Martin Afanasjew, Brett Koonce, Charlie Sharpsteen, Jack Nagel, Adam Vandenberg, Andrew Janke, Alex Dunn, neutric, Tomasz Pajor, Uladzislau Shablinski, Alyssa Ross, ilovezfs, Chongyu Zhu and Homebrew\'s creator: Max Howell\. | true |
Other | Homebrew | brew | b4995379d49328b3d07e382d48fde0b859bca9dd.json | dev-cmd/rubocop: call rubocop utility instead of `-S rubocop` | Library/Homebrew/dev-cmd/rubocop.sh | @@ -18,8 +18,6 @@ homebrew-rubocop() {
export GEM_HOME
export PATH="$GEM_HOME/bin:$PATH"
- # Unconditional -W0 to avoid printing e.g.:
- # warning: parser/current is loading parser/ruby26, which recognizes
- # warning: 2.6.6-compliant syntax, but you are running 2.6.3.
- exec "$HOMEBREW_RUBY_PATH" "$RUBY_DISABLE_OPTIONS" -W0 -S rubocop "$@"
+ RUBOCOP="$HOMEBREW_LIBRARY/Homebrew/utils/rubocop.rb"
+ exec "$HOMEBREW_RUBY_PATH" "$RUBOCOP" "$@"
} | false |
Other | Homebrew | brew | 3595ac1f7fe2fbb0421a7656bc9a6d59618a5afb.json | style: call rubocop directly | Library/Homebrew/Gemfile | @@ -21,6 +21,7 @@ gem "simplecov", require: false
gem "sorbet", require: false
gem "sorbet-runtime", require: false
gem "tapioca", require: false
+gem "warning", require: false
# vendored gems
gem "activesupport" | true |
Other | Homebrew | brew | 3595ac1f7fe2fbb0421a7656bc9a6d59618a5afb.json | style: call rubocop directly | Library/Homebrew/Gemfile.lock | @@ -163,6 +163,7 @@ GEM
unf_ext
unf_ext (0.0.7.7)
unicode-display_width (2.0.0)
+ warning (1.1.0)
webrick (1.7.0)
webrobots (0.1.2)
zeitwerk (2.4.2)
@@ -200,6 +201,7 @@ DEPENDENCIES
sorbet-runtime
sorbet-runtime-stub
tapioca
+ warning
BUNDLED WITH
1.17.3 | true |
Other | Homebrew | brew | 3595ac1f7fe2fbb0421a7656bc9a6d59618a5afb.json | style: call rubocop directly | Library/Homebrew/style.rb | @@ -72,6 +72,8 @@ def check_style_impl(files, output_type,
end
end
+ RUBOCOP = (HOMEBREW_LIBRARY_PATH/"utils/rubocop.rb").freeze
+
def run_rubocop(files, output_type,
fix: false, except_cops: nil, only_cops: nil, display_cop_names: false, reset_cache: false,
debug: false, verbose: false)
@@ -134,11 +136,6 @@ def run_rubocop(files, output_type,
FileUtils.rm_rf cache_env["XDG_CACHE_HOME"] if reset_cache
- ruby_args = [
- "-S",
- "rubocop",
- ].compact.freeze
-
case output_type
when :print
args << "--debug" if debug
@@ -149,11 +146,11 @@ def run_rubocop(files, output_type,
args << "--color" if Tty.color?
- system cache_env, RUBY_PATH, *ruby_args, *args
+ system cache_env, RUBY_PATH, RUBOCOP, *args
$CHILD_STATUS.success?
when :json
result = system_command RUBY_PATH,
- args: [*ruby_args, "--format", "json", *args],
+ args: [RUBOCOP, "--format", "json", *args],
env: cache_env
json = json_result!(result)
json["files"] | true |
Other | Homebrew | brew | 3595ac1f7fe2fbb0421a7656bc9a6d59618a5afb.json | style: call rubocop directly | Library/Homebrew/utils/rubocop.rb | @@ -0,0 +1,19 @@
+#!/usr/bin/env ruby
+# typed: false
+# frozen_string_literal: true
+
+require "warning"
+
+warnings = [
+ "warning: parser/current is loading parser/ruby26, which recognizes",
+ "warning: 2.6.6-compliant syntax, but you are running 2.6.3.",
+ "warning: please see https://github.com/whitequark/parser#compatibility-with-ruby-mri.",
+]
+
+warnings.each do |warning|
+ Warning.ignore Regexp.new(warning)
+end
+
+require "rubocop"
+
+exit RuboCop::CLI.new.run | true |
Other | Homebrew | brew | 3595ac1f7fe2fbb0421a7656bc9a6d59618a5afb.json | style: call rubocop directly | Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/warning-1.1.0/lib/warning.rb | @@ -0,0 +1,248 @@
+require 'monitor'
+
+module Warning
+ module Processor
+ # Map of symbols to regexps for warning messages to ignore.
+ IGNORE_MAP = {
+ ambiguous_slash: /: warning: ambiguous first argument; put parentheses or a space even after `\/' operator\n\z/,
+ arg_prefix: /: warning: `[&\*]' interpreted as argument prefix\n\z/,
+ bignum: /: warning: constant ::Bignum is deprecated\n\z/,
+ fixnum: /: warning: constant ::Fixnum is deprecated\n\z/,
+ method_redefined: /: warning: method redefined; discarding old .+\n\z|: warning: previous definition of .+ was here\n\z/,
+ missing_gvar: /: warning: global variable `\$.+' not initialized\n\z/,
+ missing_ivar: /: warning: instance variable @.+ not initialized\n\z/,
+ not_reached: /: warning: statement not reached\n\z/,
+ shadow: /: warning: shadowing outer local variable - \w+\n\z/,
+ unused_var: /: warning: assigned but unused variable - \w+\n\z/,
+ useless_operator: /: warning: possibly useless use of [><!=]+ in void context\n\z/,
+ keyword_separation: /: warning: (?:Using the last argument (?:for `.+' )?as keyword parameters is deprecated; maybe \*\* should be added to the call|Passing the keyword argument (?:for `.+' )?as the last hash parameter is deprecated|Splitting the last argument (?:for `.+' )?into positional and keyword parameters is deprecated|The called method (?:`.+' )?is defined here)\n\z/,
+ safe: /: warning: (?:rb_safe_level_2_warning|rb_safe_level|rb_set_safe_level_force|rb_set_safe_level|rb_secure|rb_insecure_operation|rb_check_safe_obj|\$SAFE) will (?:be removed|become a normal global variable) in Ruby 3\.0\n\z/,
+ taint: /: warning: (?:rb_error_untrusted|rb_check_trusted|Pathname#taint|Pathname#untaint|rb_env_path_tainted|Object#tainted\?|Object#taint|Object#untaint|Object#untrusted\?|Object#untrust|Object#trust|rb_obj_infect|rb_tainted_str_new|rb_tainted_str_new_cstr) is deprecated and will be removed in Ruby 3\.2\.\n\z/,
+ mismatched_indentations: /: warning: mismatched indentations at '.+' with '.+' at \d+\n\z/,
+ }
+
+ # Map of action symbols to procs that return the symbol
+ ACTION_PROC_MAP = {
+ default: proc{|_| :default},
+ backtrace: proc{|_| :backtrace},
+ raise: proc{|_| :raise},
+ }
+ private_constant :ACTION_PROC_MAP
+
+ # Clear all current ignored warnings, warning processors, and duplicate check cache.
+ # Also disables deduplicating warnings if that is currently enabled.
+ def clear
+ synchronize do
+ @ignore.clear
+ @process.clear
+ @dedup = false
+ end
+ end
+
+ # Deduplicate warnings, supress warning messages if the same warning message
+ # has already occurred. Note that this can lead to unbounded memory use
+ # if unique warnings are generated.
+ def dedup
+ @dedup = {}
+ end
+
+ def freeze
+ @ignore.freeze
+ @process.freeze
+ super
+ end
+
+ # Ignore any warning messages matching the given regexp, if they
+ # start with the given path.
+ # The regexp can also be one of the following symbols (or an array including them), which will
+ # use an appropriate regexp for the given warning:
+ #
+ # :arg_prefix :: Ignore warnings when using * or & as an argument prefix
+ # :ambiguous_slash :: Ignore warnings for things like <tt>method /regexp/</tt>
+ # :bignum :: Ignore warnings when referencing the ::Bignum constant.
+ # :fixnum :: Ignore warnings when referencing the ::Fixnum constant.
+ # :keyword_separation :: Ignore warnings related to keyword argument separation.
+ # :method_redefined :: Ignore warnings when defining a method in a class/module where a
+ # method of the same name was already defined in that class/module.
+ # :missing_gvar :: Ignore warnings for accesses to global variables
+ # that have not yet been initialized
+ # :missing_ivar :: Ignore warnings for accesses to instance variables
+ # that have not yet been initialized
+ # :not_reached :: Ignore statement not reached warnings.
+ # :safe :: Ignore warnings related to $SAFE and related C-API functions.
+ # :shadow :: Ignore warnings related to shadowing outer local variables.
+ # :taint :: Ignore warnings related to taint and related methods and C-API functions.
+ # :unused_var :: Ignore warnings for unused variables.
+ # :useless_operator :: Ignore warnings when using operators such as == and > when the
+ # result is not used.
+ #
+ # Examples:
+ #
+ # # Ignore all uninitialized instance variable warnings
+ # Warning.ignore(/instance variable @\w+ not initialized/)
+ #
+ # # Ignore all uninitialized instance variable warnings in current file
+ # Warning.ignore(/instance variable @\w+ not initialized/, __FILE__)
+ #
+ # # Ignore all uninitialized instance variable warnings in current file
+ # Warning.ignore(:missing_ivar, __FILE__)
+ #
+ # # Ignore all uninitialized instance variable and method redefined warnings in current file
+ # Warning.ignore([:missing_ivar, :method_redefined], __FILE__)
+ def ignore(regexp, path='')
+ unless regexp = convert_regexp(regexp)
+ raise TypeError, "first argument to Warning.ignore should be Regexp, Symbol, or Array of Symbols, got #{regexp.inspect}"
+ end
+
+ synchronize do
+ @ignore << [path, regexp]
+ end
+ nil
+ end
+
+ # Handle all warnings starting with the given path, instead of
+ # the default behavior of printing them to $stderr. Examples:
+ #
+ # # Write warning to LOGGER at level warning
+ # Warning.process do |warning|
+ # LOGGER.warning(warning)
+ # end
+ #
+ # # Write warnings in the current file to LOGGER at level error level
+ # Warning.process(__FILE__) do |warning|
+ # LOGGER.error(warning)
+ # end
+ #
+ # The block can return one of the following symbols:
+ #
+ # :default :: Take the default action (call super, printing to $stderr).
+ # :backtrace :: Take the default action (call super, printing to $stderr),
+ # and also print the backtrace.
+ # :raise :: Raise a RuntimeError with the warning as the message.
+ #
+ # If the block returns anything else, it is assumed the block completely handled
+ # the warning and takes no other action.
+ #
+ # Instead of passing a block, you can pass a hash of actions to take for specific
+ # warnings, using regexp as keys and a callable objects as values:
+ #
+ # Warning.ignore(__FILE__,
+ # /instance variable @\w+ not initialized/ => proc do |warning|
+ # LOGGER.warning(warning)
+ # end,
+ # /global variable `\$\w+' not initialized/ => proc do |warning|
+ # LOGGER.error(warning)
+ # end
+ # )
+ #
+ # Instead of passing a regexp as a key, you can pass a symbol that is recognized
+ # by Warning.ignore. Instead of passing a callable object as a value, you can
+ # pass a symbol, which will be treated as a callable object that returns that symbol:
+ #
+ # Warning.process(__FILE__, :missing_ivar=>:backtrace, :keyword_separation=>:raise)
+ def process(path='', actions=nil, &block)
+ if block
+ if actions
+ raise ArgumentError, "cannot pass both actions and block to Warning.process"
+ end
+ elsif actions
+ block = {}
+ actions.each do |regexp, value|
+ unless regexp = convert_regexp(regexp)
+ raise TypeError, "action provided to Warning.process should be Regexp, Symbol, or Array of Symbols, got #{regexp.inspect}"
+ end
+
+ block[regexp] = ACTION_PROC_MAP[value] || value
+ end
+ else
+ raise ArgumentError, "must pass either actions or block to Warning.process"
+ end
+
+ synchronize do
+ @process << [path, block]
+ @process.sort_by!(&:first)
+ @process.reverse!
+ end
+ nil
+ end
+
+ # Handle ignored warnings and warning processors. If the warning is
+ # not ignored, is not a duplicate warning (if checking for duplicates)
+ # and there is no warning processor setup for the warning
+ # string, then use the default behavior of writing to $stderr.
+ def warn(str)
+ synchronize{@ignore.dup}.each do |path, regexp|
+ if str.start_with?(path) && str =~ regexp
+ return
+ end
+ end
+
+ if @dedup
+ if synchronize{@dedup[str]}
+ return
+ end
+
+ synchronize{@dedup[str] = true}
+ end
+
+ action = catch(:action) do
+ synchronize{@process.dup}.each do |path, block|
+ if str.start_with?(path)
+ if block.is_a?(Hash)
+ block.each do |regexp, blk|
+ if str =~ regexp
+ throw :action, blk.call(str)
+ end
+ end
+ else
+ throw :action, block.call(str)
+ end
+ end
+ end
+
+ :default
+ end
+
+ case action
+ when :default
+ super
+ when :backtrace
+ super
+ $stderr.puts caller
+ when :raise
+ raise str
+ else
+ # nothing
+ end
+
+ nil
+ end
+
+ private
+
+ # Convert the given Regexp, Symbol, or Array of Symbols into a Regexp.
+ def convert_regexp(regexp)
+ case regexp
+ when Regexp
+ regexp
+ when Symbol
+ IGNORE_MAP.fetch(regexp)
+ when Array
+ Regexp.union(regexp.map{|re| IGNORE_MAP.fetch(re)})
+ else
+ # nothing
+ end
+ end
+
+ def synchronize(&block)
+ @monitor.synchronize(&block)
+ end
+ end
+
+ @ignore = []
+ @process = []
+ @dedup = false
+ @monitor = Monitor.new
+
+ extend Processor
+end | true |
Other | Homebrew | brew | 0e732d3917c013bad3404015d939e8f0fad35913.json | cmd/update-report: report outdated count & suggest `brew upgrade` | Library/Homebrew/cmd/update-report.rb | @@ -136,8 +136,28 @@ def update_report
DescriptionCacheStore.new(db)
.update_from_report!(hub)
end
+
+ unless args.preinstall?
+ outdated_formulae = Formula.installed.count(&:outdated?)
+ outdated_casks = Cask::Caskroom.casks.count(&:outdated?)
+ msg = ""
+ if outdated_formulae.positive?
+ msg += "#{Tty.bold}#{outdated_formulae}#{Tty.reset} outdated #{"formula".pluralize(outdated_formulae)}"
+ end
+ if outdated_casks.positive?
+ msg += " and " if msg.present?
+ msg += "#{Tty.bold}#{outdated_casks}#{Tty.reset} outdated #{"cask".pluralize(outdated_casks)}"
+ end
+ if msg.present?
+ puts_stdout_or_stderr
+ puts_stdout_or_stderr <<~EOS
+ You have #{msg} installed.
+ You can update them with #{Tty.bold}brew upgrade#{Tty.reset}.
+ EOS
+ end
+ end
end
- puts if args.preinstall?
+ puts_stdout_or_stderr if args.preinstall?
elsif !args.preinstall? && !ENV["HOMEBREW_UPDATE_FAILED"]
puts_stdout_or_stderr "Already up-to-date." unless args.quiet?
end
@@ -161,6 +181,7 @@ def update_report
return if new_repository_version.blank?
+ puts_stdout_or_stderr
ohai_stdout_or_stderr "Homebrew was updated to version #{new_repository_version}"
if new_repository_version.split(".").last == "0"
puts_stdout_or_stderr <<~EOS | true |
Other | Homebrew | brew | 0e732d3917c013bad3404015d939e8f0fad35913.json | cmd/update-report: report outdated count & suggest `brew upgrade` | Library/Homebrew/utils.rb | @@ -121,6 +121,7 @@ def ohai_stdout_or_stderr(message, *sput)
end
def puts_stdout_or_stderr(*message)
+ message = "\n" if message.empty?
if $stdout.tty?
puts(message)
else | true |
Other | Homebrew | brew | 8c81a2822cb1a2af4794d5d08ee38c8d376f43e2.json | os/mac/sdk: read version from SDKSettings | Library/Homebrew/os/mac/sdk.rb | @@ -9,6 +9,8 @@ module Mac
#
# @api private
class SDK
+ VERSIONED_SDK_REGEX = /MacOSX(\d+\.\d+)\.sdk$/.freeze
+
attr_reader :version, :path, :source
def initialize(version, path, source)
@@ -25,14 +27,39 @@ class BaseSDKLocator
class NoSDKError < StandardError; end
def sdk_for(v)
- path = sdk_paths[v]
- raise NoSDKError if path.nil?
+ sdk = all_sdks.find { |s| s.version == v }
+ raise NoSDKError if sdk.nil?
- SDK.new v, path, source
+ sdk
end
def all_sdks
- sdk_paths.map { |v, p| SDK.new v, p, source }
+ return @all_sdks if @all_sdks
+
+ @all_sdks = []
+
+ # Bail out if there is no SDK prefix at all
+ return @all_sdks unless File.directory? sdk_prefix
+
+ # Use unversioned SDK path on Big Sur to avoid issues such as:
+ # https://github.com/Homebrew/homebrew-core/issues/67075
+ unversioned_sdk_path = Pathname.new("#{sdk_prefix}/MacOSX.sdk")
+ version = read_sdk_version(unversioned_sdk_path)
+ if version && version >= :big_sur
+ unversioned_sdk_version = version
+ @all_sdks << SDK.new(unversioned_sdk_version, unversioned_sdk_path, source)
+ end
+
+ Dir["#{sdk_prefix}/MacOSX*.sdk"].each do |sdk_path|
+ next unless sdk_path.match?(SDK::VERSIONED_SDK_REGEX)
+
+ version = read_sdk_version(Pathname.new(sdk_path))
+ next if version.nil? || version == unversioned_sdk_version
+
+ @all_sdks << SDK.new(version, sdk_path, source)
+ end
+
+ @all_sdks
end
def sdk_if_applicable(v = nil)
@@ -64,43 +91,34 @@ def sdk_prefix
""
end
- def sdk_paths
- @sdk_paths ||= begin
- # Bail out if there is no SDK prefix at all
- if File.directory? sdk_prefix
- paths = {}
-
- Dir[File.join(sdk_prefix, "MacOSX*.sdk")].each do |sdk_path|
- version = sdk_path[/MacOSX(\d+\.\d+)u?\.sdk$/, 1]
- paths[OS::Mac::Version.new(version)] = sdk_path if version.present?
- end
-
- # Use unversioned SDK path on Big Sur to avoid issues such as:
- # https://github.com/Homebrew/homebrew-core/issues/67075
- # This creates an entry in `paths` whose key is the OS major version
- sdk_path = Pathname.new("#{sdk_prefix}/MacOSX.sdk")
- sdk_settings = sdk_path/"SDKSettings.json"
- if sdk_settings.exist? &&
- (sdk_settings_string = sdk_settings.read.presence) &&
- (sdk_settings_json = JSON.parse(sdk_settings_string).presence) &&
- (version_string = sdk_settings_json.fetch("Version", nil).presence) &&
- (version = version_string[/(\d+)\./, 1].presence)
- paths[OS::Mac::Version.new(version)] = sdk_path
- end
-
- paths
- else
- {}
- end
- end
+ def latest_sdk
+ all_sdks.max_by(&:version)
end
- # NOTE: This returns a versioned SDK path, even on Big Sur
- def latest_sdk
- return if sdk_paths.empty?
+ def read_sdk_version(sdk_path)
+ sdk_settings = sdk_path/"SDKSettings.json"
+ sdk_settings_string = sdk_settings.read if sdk_settings.exist?
- v, path = sdk_paths.max { |(v1, _), (v2, _)| v1 <=> v2 }
- SDK.new v, path, source
+ # Pre-10.14 SDKs
+ sdk_settings = sdk_path/"SDKSettings.plist"
+ if sdk_settings_string.blank? && sdk_settings.exist?
+ result = system_command("plutil", args: ["-convert", "json", "-o", "-", sdk_settings])
+ sdk_settings_string = result.stdout if result.success?
+ end
+
+ return if sdk_settings_string.blank?
+
+ sdk_settings_json = JSON.parse(sdk_settings_string)
+ return if sdk_settings_json.blank?
+
+ version_string = sdk_settings_json.fetch("Version", nil)
+ return if version_string.blank?
+
+ begin
+ OS::Mac::Version.new(version_string).strip_patch
+ rescue MacOSVersionError
+ nil
+ end
end
end
private_constant :BaseSDKLocator | false |
Other | Homebrew | brew | 04804c6db5ad4912efb946313930abee97d7fcf8.json | formula: add bottle_hash method.
Extract this method from `#to_hash` so it can be used in `brew bundle`. | Library/Homebrew/formula.rb | @@ -1822,25 +1822,7 @@ def to_hash
"revision" => stable.specs[:revision],
}
- if bottle_defined?
- bottle_spec = stable.bottle_specification
- bottle_info = {
- "rebuild" => bottle_spec.rebuild,
- "cellar" => (cellar = bottle_spec.cellar).is_a?(Symbol) ? cellar.inspect : cellar,
- "prefix" => bottle_spec.prefix,
- "root_url" => bottle_spec.root_url,
- }
- bottle_info["files"] = {}
- bottle_spec.collector.each_key do |os|
- bottle_url = "#{bottle_spec.root_url}/#{Bottle::Filename.create(self, os, bottle_spec.rebuild).bintray}"
- checksum = bottle_spec.collector[os][:checksum]
- bottle_info["files"][os] = {
- "url" => bottle_url,
- "sha256" => checksum.hexdigest,
- }
- end
- hsh["bottle"]["stable"] = bottle_info
- end
+ hsh["bottle"]["stable"] = bottle_hash if bottle_defined?
end
hsh["options"] = options.map do |opt|
@@ -1874,6 +1856,27 @@ def to_hash
hsh
end
+ # Returns the bottle information for a formula
+ def bottle_hash
+ bottle_spec = stable.bottle_specification
+ hash = {
+ "rebuild" => bottle_spec.rebuild,
+ "cellar" => (cellar = bottle_spec.cellar).is_a?(Symbol) ? cellar.inspect : cellar,
+ "prefix" => bottle_spec.prefix,
+ "root_url" => bottle_spec.root_url,
+ "files" => {},
+ }
+ bottle_spec.collector.each_key do |os|
+ bottle_url = "#{bottle_spec.root_url}/#{Bottle::Filename.create(self, os, bottle_spec.rebuild).bintray}"
+ checksum = bottle_spec.collector[os][:checksum]
+ hash["files"][os] = {
+ "url" => bottle_url,
+ "sha256" => checksum.hexdigest,
+ }
+ end
+ hash
+ end
+
# @private
def fetch(verify_download_integrity: true)
active_spec.fetch(verify_download_integrity: verify_download_integrity) | false |
Other | Homebrew | brew | fcb1aa8aef1fa09714166a60b887226d7a189d1f.json | test/keg_spec: add test to check for dependent casks | Library/Homebrew/test/keg_spec.rb | @@ -455,5 +455,31 @@ def unreliable_dependencies(deps)
dependencies [{ "full_name" => "foo", "version" => "1.1" }] # different version
expect(described_class.find_some_installed_dependents([keg])).to eq([[keg], ["bar"]])
end
+
+ def stub_cask_name(name, version, dependency)
+ c = Cask::CaskLoader.load(+<<-RUBY)
+ cask "#{name}" do
+ version "#{version}"
+
+ url "c-1"
+ depends_on formula: "#{dependency}"
+ end
+ RUBY
+
+ stub_cask_loader c
+ c
+ end
+
+ def setup_test_cask(name, version, dependency)
+ c = stub_cask_name(name, version, dependency)
+ Cask::Caskroom.path.join(name, c.version).mkpath
+ c
+ end
+
+ specify "identify dependent casks" do
+ setup_test_cask("qux", "1.0.0", "foo")
+ dependents = described_class.find_some_installed_dependents([keg]).last
+ expect(dependents.include?("qux")).to eq(true)
+ end
end
end | false |
Other | Homebrew | brew | 0a292c7041d4497d51259882fc7e44892e875133.json | linux: use preferred_gcc instead of gcc | Library/Homebrew/compilers.rb | @@ -110,16 +110,16 @@ def compiler
raise CompilerSelectionError, formula
end
- private
-
sig { returns(String) }
- def preferred_gcc
+ def self.preferred_gcc
"gcc"
end
+ private
+
def gnu_gcc_versions
# prioritize gcc version provided by gcc formula.
- v = Formulary.factory(preferred_gcc).version.to_s.slice(/\d+/)
+ v = Formulary.factory(CompilerSelector.preferred_gcc).version.to_s.slice(/\d+/)
GNU_GCC_VERSIONS - [v] + [v] # move the version to the end of the list
rescue FormulaUnavailableError
GNU_GCC_VERSIONS | true |
Other | Homebrew | brew | 0a292c7041d4497d51259882fc7e44892e875133.json | linux: use preferred_gcc instead of gcc | Library/Homebrew/extend/os/linux/compilers.rb | @@ -3,7 +3,7 @@
class CompilerSelector
sig { returns(String) }
- def preferred_gcc
+ def self.preferred_gcc
# gcc-5 is the lowest gcc version we support on Linux.
# gcc-5 is the default gcc in Ubuntu 16.04 (used for our CI)
"gcc@5" | true |
Other | Homebrew | brew | 0a292c7041d4497d51259882fc7e44892e875133.json | linux: use preferred_gcc instead of gcc | Library/Homebrew/extend/os/linux/keg_relocate.rb | @@ -1,6 +1,8 @@
# typed: true
# frozen_string_literal: true
+require "compilers"
+
class Keg
def relocate_dynamic_linkage(relocation)
# Patching the dynamic linker of glibc breaks it.
@@ -84,7 +86,7 @@ def self.relocation_formulae
def self.bottle_dependencies
@bottle_dependencies ||= begin
formulae = relocation_formulae
- gcc = Formula["gcc"]
+ gcc = Formulary.factory(CompilerSelector.preferred_gcc)
if !Homebrew::EnvConfig.force_homebrew_on_linux? &&
DevelopmentTools.non_apple_gcc_version("gcc") < gcc.version.to_i
formulae += gcc.recursive_dependencies.map(&:name) | true |
Other | Homebrew | brew | 0a292c7041d4497d51259882fc7e44892e875133.json | linux: use preferred_gcc instead of gcc | Library/Homebrew/extend/os/linux/linkage_checker.rb | @@ -1,6 +1,8 @@
# typed: true
# frozen_string_literal: true
+require "compilers"
+
class LinkageChecker
# Libraries provided by glibc and gcc.
SYSTEM_LIBRARY_ALLOWLIST = %w[
@@ -30,6 +32,6 @@ def check_dylibs(rebuild_cache:)
@unwanted_system_dylibs = @system_dylibs.reject do |s|
SYSTEM_LIBRARY_ALLOWLIST.include? File.basename(s)
end
- @undeclared_deps -= ["gcc", "glibc"]
+ @undeclared_deps -= [CompilerSelector.preferred_gcc, "glibc"]
end
end | true |
Other | Homebrew | brew | 0a292c7041d4497d51259882fc7e44892e875133.json | linux: use preferred_gcc instead of gcc | Library/Homebrew/extend/os/linux/system_config.rb | @@ -1,6 +1,7 @@
# typed: true
# frozen_string_literal: true
+require "compilers"
require "os/linux/glibc"
require "system_command"
@@ -46,7 +47,7 @@ def dump_verbose_config(out = $stdout)
out.puts "Host glibc: #{host_glibc_version}"
out.puts "/usr/bin/gcc: #{host_gcc_version}"
out.puts "/usr/bin/ruby: #{host_ruby_version}" if RUBY_PATH != HOST_RUBY_PATH
- ["glibc", "gcc", "xorg"].each do |f|
+ ["glibc", CompilerSelector.preferred_gcc, "xorg"].each do |f|
out.puts "#{f}: #{formula_linked_version(f)}"
end
end | true |
Other | Homebrew | brew | 0a292c7041d4497d51259882fc7e44892e875133.json | linux: use preferred_gcc instead of gcc | Library/Homebrew/test/formula_installer_bottle_spec.rb | @@ -24,6 +24,7 @@ def temporarily_install_bottle(formula)
stub_formula_loader formula
stub_formula_loader formula("gcc") { url "gcc-1.0" }
+ stub_formula_loader formula("gcc@5") { url "gcc-5.0" }
stub_formula_loader formula("patchelf") { url "patchelf-1.0" }
allow(Formula["patchelf"]).to receive(:latest_version_installed?).and_return(true)
| true |
Other | Homebrew | brew | 0a292c7041d4497d51259882fc7e44892e875133.json | linux: use preferred_gcc instead of gcc | Library/Homebrew/test/formulary_spec.rb | @@ -142,6 +142,7 @@ class Wrong#{described_class.class_s(formula_name)} < Formula
before do
allow(described_class).to receive(:loader_for).and_call_original
stub_formula_loader formula("gcc") { url "gcc-1.0" }
+ stub_formula_loader formula("gcc@5") { url "gcc-5.0" }
stub_formula_loader formula("patchelf") { url "patchelf-1.0" }
allow(Formula["patchelf"]).to receive(:latest_version_installed?).and_return(true)
end | true |
Other | Homebrew | brew | 61cda1465f6d5db241801f8e5a4ec66453711835.json | os/mac/version: add strip_patch method | Library/Homebrew/os/mac/version.rb | @@ -78,17 +78,19 @@ def <=>(other)
end
end
+ sig { returns(T.self_type) }
+ def strip_patch
+ # Big Sur is 11.x but Catalina is 10.15.x.
+ if major >= 11
+ self.class.new(major.to_s)
+ else
+ major_minor
+ end
+ end
+
sig { returns(Symbol) }
def to_sym
- @to_sym ||= begin
- # Big Sur is 11.x but Catalina is 10.15.
- major_macos = if major >= 11
- major
- else
- major_minor
- end.to_s
- SYMBOLS.invert.fetch(major_macos, :dunno)
- end
+ @to_sym ||= SYMBOLS.invert.fetch(strip_patch.to_s, :dunno)
end
sig { returns(String) } | false |
Other | Homebrew | brew | 1d204a08934ce17cf767d3543357954b33df204b.json | test/uninstall_spec: fix dependent cask handling | Library/Homebrew/test/uninstall_spec.rb | @@ -16,6 +16,8 @@
let(:dependent_cask) do
Cask::CaskLoader.load(+<<-RUBY)
cask "dependent_cask" do
+ version "1.0.0"
+
url "c-1"
depends_on formula: "dependency"
end
@@ -38,6 +40,8 @@
]
tab.write
+ Cask::Caskroom.path.join("dependent_cask", dependent_cask.version).mkpath
+
stub_formula_loader dependency
stub_formula_loader dependent_formula
stub_cask_loader dependent_cask | false |
Other | Homebrew | brew | 0969361c54e4f1843aa9b65f37c6a097fe202a9d.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 | @@ -6187,6 +6187,11 @@ class CompilerSelector::Compiler
def self.members(); end
end
+class CompilerSelector
+ extend ::T::Private::Methods::MethodHooks
+ extend ::T::Private::Methods::SingletonMethodHooks
+end
+
class Concurrent::Promises::AbstractEventFuture
include ::Concurrent::Promises::InternalStates
end | false |
Other | Homebrew | brew | 15f936a22a228f01482ce6819fefccdf73045afb.json | dev-cmd/update-maintainers: implement suggestions from code review | Library/Homebrew/.rubocop.yml | @@ -36,8 +36,9 @@ Metrics/PerceivedComplexity:
Max: 90
Metrics/MethodLength:
Max: 260
+# TODO: Reduce to 600 after refactoring utils/github
Metrics/ModuleLength:
- Max: 650
+ Max: 620
Exclude:
- "test/**/*"
| true |
Other | Homebrew | brew | 15f936a22a228f01482ce6819fefccdf73045afb.json | dev-cmd/update-maintainers: implement suggestions from code review | Library/Homebrew/dev-cmd/update-maintainers.rb | @@ -26,29 +26,32 @@ def update_maintainers
# We assume that only public members wish to be included in the README
public_members = GitHub.public_member_usernames("Homebrew")
- plc = GitHub.members_by_team("Homebrew", "plc")
- tsc = GitHub.members_by_team("Homebrew", "tsc")
- linux = GitHub.members_by_team("Homebrew", "linux")
- other = GitHub.members_by_team("Homebrew", "maintainers")
- other.except!(*[plc, tsc, linux].map(&:keys).flatten.uniq)
+ members = {
+ plc: GitHub.members_by_team("Homebrew", "plc"),
+ tsc: GitHub.members_by_team("Homebrew", "tsc"),
+ linux: GitHub.members_by_team("Homebrew", "linux"),
+ }
+ members[:other] = GitHub.members_by_team("Homebrew", "maintainers")
+ .except(*members.values.map(&:keys).flatten.uniq)
- sentences = [plc, tsc, linux, other].map do |h|
- h.slice!(*public_members)
- h.each { |k, v| h[k] = "[#{v}](https://github.com/#{k})" }
- h.values.sort.to_sentence
+ sentences = {}
+ members.each do |group, hash|
+ hash.slice!(*public_members)
+ hash.each { |login, name| hash[login] = "[#{name}](https://github.com/#{login})" }
+ sentences[group] = hash.values.sort.to_sentence
end
readme = HOMEBREW_REPOSITORY/"README.md"
content = readme.read
content.gsub!(/(Homebrew's \[Project Leadership Committee.*) is .*\./,
- "\\1 is #{sentences[0]}.")
+ "\\1 is #{sentences[:plc]}.")
content.gsub!(/(Homebrew's \[Technical Steering Committee.*) is .*\./,
- "\\1 is #{sentences[1]}.")
+ "\\1 is #{sentences[:tsc]}.")
content.gsub!(/(Homebrew's Linux maintainers are).*\./,
- "\\1 #{sentences[2]}.")
+ "\\1 #{sentences[:linux]}.")
content.gsub!(/(Homebrew's other current maintainers are).*\./,
- "\\1 #{sentences[3]}.")
+ "\\1 #{sentences[:other]}.")
File.open(readme, "w+") { |f| f.write(content) }
| true |
Other | Homebrew | brew | 15f936a22a228f01482ce6819fefccdf73045afb.json | dev-cmd/update-maintainers: implement suggestions from code review | Library/Homebrew/utils/github.rb | @@ -577,7 +577,7 @@ def public_member_usernames(org, per_page: 100)
members = []
(1..API_MAX_PAGES).each do |page|
- result = open_api(url + "&page=#{page}").map { |m| m["login"] }
+ result = open_api("#{url}&page=#{page}").map { |member| member["login"] }
members.concat(result)
return members if result.length < per_page
@@ -587,6 +587,11 @@ def public_member_usernames(org, per_page: 100)
def members_by_team(org, team)
query = <<~EOS
{ organization(login: "#{org}") {
+ teams(first: 100) {
+ nodes {
+ ... on Team { name }
+ }
+ }
team(slug: "#{team}") {
members(first: 100) {
nodes {
@@ -598,7 +603,14 @@ def members_by_team(org, team)
}
EOS
result = open_graphql(query, scopes: ["read:org", "user"])
- result["organization"]["team"]["members"]["nodes"].map { |m| [m["login"], m["name"]] }.to_h
+
+ if result["organization"]["teams"]["nodes"].blank?
+ raise Error,
+ "Your token needs the 'read:org' scope to access this API"
+ end
+ raise Error, "The team #{org}/#{team} does not exist" if result["organization"]["team"].blank?
+
+ result["organization"]["team"]["members"]["nodes"].map { |member| [member["login"], member["name"]] }.to_h
end
def sponsors_by_tier(user) | true |
Other | Homebrew | brew | f1ef1afd2130993cce87f27a634929810331ba1a.json | Add workflow scope to github.rb | Library/Homebrew/utils/github.rb | @@ -20,7 +20,8 @@ module GitHub
CREATE_GIST_SCOPES = ["gist"].freeze
CREATE_ISSUE_FORK_OR_PR_SCOPES = ["public_repo"].freeze
- ALL_SCOPES = (CREATE_GIST_SCOPES + CREATE_ISSUE_FORK_OR_PR_SCOPES).freeze
+ CREATE_WORKFLOW_SCOPES = ["workflow"].freeze
+ ALL_SCOPES = (CREATE_GIST_SCOPES + CREATE_ISSUE_FORK_OR_PR_SCOPES + CREATE_WORKFLOW_SCOPES).freeze
ALL_SCOPES_URL = Formatter.url(
"https://github.com/settings/tokens/new?scopes=#{ALL_SCOPES.join(",")}&description=Homebrew",
).freeze | false |
Other | Homebrew | brew | 221983dbcff442fa98d28c36cb2fb74af376d937.json | compilers: prefer gcc 5 on linux
Fixes #10170 by preferring gcc@5 on linux
This makes sure ENV.cc and ENV.cxx is correctly set:
If a formula does not explicitely depend on a brewed gcc,
ENV.cc is set to gcc-5 (system gcc-5 or brewed gcc-5) with this change,
even if other gcc versions are installed on the system. | Library/Homebrew/compilers.rb | @@ -78,6 +78,7 @@ def inspect
#
# @api private
class CompilerSelector
+ extend T::Sig
include CompilerConstants
Compiler = Struct.new(:name, :version)
@@ -111,9 +112,14 @@ def compiler
private
+ sig { returns(String) }
+ def preferred_gcc
+ "gcc"
+ end
+
def gnu_gcc_versions
# prioritize gcc version provided by gcc formula.
- v = Formulary.factory("gcc").version.to_s.slice(/\d+/)
+ v = Formulary.factory(preferred_gcc).version.to_s.slice(/\d+/)
GNU_GCC_VERSIONS - [v] + [v] # move the version to the end of the list
rescue FormulaUnavailableError
GNU_GCC_VERSIONS
@@ -150,3 +156,5 @@ def compiler_version(name)
end
end
end
+
+require "extend/os/compilers" | true |
Other | Homebrew | brew | 221983dbcff442fa98d28c36cb2fb74af376d937.json | compilers: prefer gcc 5 on linux
Fixes #10170 by preferring gcc@5 on linux
This makes sure ENV.cc and ENV.cxx is correctly set:
If a formula does not explicitely depend on a brewed gcc,
ENV.cc is set to gcc-5 (system gcc-5 or brewed gcc-5) with this change,
even if other gcc versions are installed on the system. | Library/Homebrew/extend/os/compilers.rb | @@ -0,0 +1,4 @@
+# typed: strict
+# frozen_string_literal: true
+
+require "extend/os/linux/compilers" if OS.linux? | true |
Other | Homebrew | brew | 221983dbcff442fa98d28c36cb2fb74af376d937.json | compilers: prefer gcc 5 on linux
Fixes #10170 by preferring gcc@5 on linux
This makes sure ENV.cc and ENV.cxx is correctly set:
If a formula does not explicitely depend on a brewed gcc,
ENV.cc is set to gcc-5 (system gcc-5 or brewed gcc-5) with this change,
even if other gcc versions are installed on the system. | Library/Homebrew/extend/os/linux/compilers.rb | @@ -0,0 +1,11 @@
+# typed: strict
+# frozen_string_literal: true
+
+class CompilerSelector
+ sig { returns(String) }
+ def preferred_gcc
+ # gcc-5 is the lowest gcc version we support on Linux.
+ # gcc-5 is the default gcc in Ubuntu 16.04 (used for our CI)
+ "gcc@5"
+ end
+end | true |
Other | Homebrew | brew | 221983dbcff442fa98d28c36cb2fb74af376d937.json | compilers: prefer gcc 5 on linux
Fixes #10170 by preferring gcc@5 on linux
This makes sure ENV.cc and ENV.cxx is correctly set:
If a formula does not explicitely depend on a brewed gcc,
ENV.cc is set to gcc-5 (system gcc-5 or brewed gcc-5) with this change,
even if other gcc versions are installed on the system. | Library/Homebrew/test/compiler_selector_spec.rb | @@ -22,6 +22,7 @@
case name
when "gcc-7" then Version.create("7.1")
when "gcc-6" then Version.create("6.1")
+ when "gcc-5" then Version.create("5.1")
else Version::NULL
end
end
@@ -42,16 +43,31 @@
expect(selector.compiler).to eq("gcc-7")
end
- it "returns gcc-6 if gcc formula offers gcc-6" do
+ it "returns gcc-6 if gcc formula offers gcc-6 on mac", :needs_macos do
software_spec.fails_with(:clang)
allow(Formulary).to receive(:factory).with("gcc").and_return(double(version: "6.0"))
expect(selector.compiler).to eq("gcc-6")
end
+ it "returns gcc-5 if gcc formula offers gcc-5 on linux", :needs_linux do
+ software_spec.fails_with(:clang)
+ allow(Formulary).to receive(:factory).with("gcc@5").and_return(double(version: "5.0"))
+ expect(selector.compiler).to eq("gcc-5")
+ end
+
+ it "returns gcc-6 if gcc formula offers gcc-6 and fails with gcc-5 and gcc-7 on linux", :needs_linux do
+ software_spec.fails_with(:clang)
+ software_spec.fails_with(gcc: "5")
+ software_spec.fails_with(gcc: "7")
+ allow(Formulary).to receive(:factory).with("gcc@5").and_return(double(version: "5.0"))
+ expect(selector.compiler).to eq("gcc-6")
+ end
+
it "raises an error when gcc or llvm is missing" do
software_spec.fails_with(:clang)
software_spec.fails_with(gcc: "7")
software_spec.fails_with(gcc: "6")
+ software_spec.fails_with(gcc: "5")
expect { selector.compiler }.to raise_error(CompilerSelectionError)
end | true |
Other | Homebrew | brew | 65d5c11f15644bc0103e5cb87011d4ba7a61b586.json | Update list_spec.rb for cask full_name | Library/Homebrew/test/cask/cmd/list_spec.rb | @@ -87,7 +87,7 @@
let(:casks) { ["local-caffeine", "local-transmission", "third-party/tap/third-party-cask"] }
let(:expected_output) {
<<~EOS
- [{"token":"local-caffeine","full_token":"homebrew/cask/local-caffeine","tap":"homebrew/cask","name":[],"desc":null,"homepage":"https://brew.sh/","url":"file:///usr/local/Homebrew/Library/Homebrew/test/support/fixtures/cask/caffeine.zip","appcast":null,"version":"1.2.3","installed":"1.2.3","outdated":false,"sha256":"67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94","artifacts":[["Caffeine.app"]],"caveats":null,"depends_on":{},"conflicts_with":null,"container":null,"auto_updates":null},{"token":"local-transmission","full_token":"homebrew/cask/local-transmission","tap":"homebrew/cask","name":["Transmission"],"desc":"BitTorrent client","homepage":"https://transmissionbt.com/","url":"file:///usr/local/Homebrew/Library/Homebrew/test/support/fixtures/cask/transmission-2.61.dmg","appcast":null,"version":"2.61","installed":"2.61","outdated":false,"sha256":"e44ffa103fbf83f55c8d0b1bea309a43b2880798dae8620b1ee8da5e1095ec68","artifacts":[["Transmission.app"]],"caveats":null,"depends_on":{},"conflicts_with":null,"container":null,"auto_updates":null},{"token":"third-party-cask","full_token":"third-party/tap/third-party-cask","tap":"third-party/tap","name":[],"desc":null,"homepage":"https://brew.sh/","url":"https://brew.sh/ThirdParty.dmg","appcast":null,"version":"1.2.3","installed":"1.2.3","outdated":false,"sha256":"8c62a2b791cf5f0da6066a0a4b6e85f62949cd60975da062df44adf887f4370b","artifacts":[["ThirdParty.app"]],"caveats":null,"depends_on":{},"conflicts_with":null,"container":null,"auto_updates":null}]
+ [{"token":"local-caffeine","full_token":"local-caffeine","tap":"homebrew/cask","name":[],"desc":null,"homepage":"https://brew.sh/","url":"file:///usr/local/Homebrew/Library/Homebrew/test/support/fixtures/cask/caffeine.zip","appcast":null,"version":"1.2.3","installed":"1.2.3","outdated":false,"sha256":"67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94","artifacts":[["Caffeine.app"]],"caveats":null,"depends_on":{},"conflicts_with":null,"container":null,"auto_updates":null},{"token":"local-transmission","full_token":"local-transmission","tap":"homebrew/cask","name":["Transmission"],"desc":"BitTorrent client","homepage":"https://transmissionbt.com/","url":"file:///usr/local/Homebrew/Library/Homebrew/test/support/fixtures/cask/transmission-2.61.dmg","appcast":null,"version":"2.61","installed":"2.61","outdated":false,"sha256":"e44ffa103fbf83f55c8d0b1bea309a43b2880798dae8620b1ee8da5e1095ec68","artifacts":[["Transmission.app"]],"caveats":null,"depends_on":{},"conflicts_with":null,"container":null,"auto_updates":null},{"token":"third-party-cask","full_token":"third-party/tap/third-party-cask","tap":"third-party/tap","name":[],"desc":null,"homepage":"https://brew.sh/","url":"https://brew.sh/ThirdParty.dmg","appcast":null,"version":"1.2.3","installed":"1.2.3","outdated":false,"sha256":"8c62a2b791cf5f0da6066a0a4b6e85f62949cd60975da062df44adf887f4370b","artifacts":[["ThirdParty.app"]],"caveats":null,"depends_on":{},"conflicts_with":null,"container":null,"auto_updates":null}]
EOS
}
| false |
Other | Homebrew | brew | ce7ab823ed5b93ae4588e754c3cc64974c0882f7.json | Replace test for checking formulae tap
As suggested by @Rylan12, integration tests are super slow.
Co-Authored-By: Rylan Polster <rslpolster@gmail.com> | Library/Homebrew/test/cmd/info_spec.rb | @@ -6,19 +6,6 @@
require "cmd/shared_examples/args_parse"
describe "brew info" do
- let(:tarball) do
- if OS.linux?
- TEST_FIXTURE_DIR/"tarballs/testball-0.1-linux.tbz"
- else
- TEST_FIXTURE_DIR/"tarballs/testball-0.1.tbz"
- end
- end
- let(:expected_output) {
- <<~EOS
- {"formulae":[{"name":"testball","full_name":"testball","tap":"homebrew/core","oldname":null,"aliases":[],"versioned_formulae":[],"desc":"Some test","license":null,"homepage":"https://brew.sh/testball","versions":{"stable":"0.1","head":null,"bottle":false},"urls":{"stable":{"url":"file://#{tarball}","tag":null,"revision":null}},"revision":0,"version_scheme":0,"bottle":{},"keg_only":false,"bottle_disabled":false,"options":[{"option":"--with-foo","description":"Build with foo"}],"build_dependencies":[],"dependencies":[],"recommended_dependencies":[],"optional_dependencies":[],"uses_from_macos":[],"requirements":[],"conflicts_with":[],"caveats":null,"installed":[],"linked_keg":null,"pinned":false,"outdated":false,"deprecated":false,"deprecation_date":null,"deprecation_reason":null,"disabled":false,"disable_date":null,"disable_reason":null}],"casks":[]}
- EOS
- }
-
it_behaves_like "parseable arguments"
it "prints as json with the --json=v1 flag", :integration_test do
@@ -39,13 +26,6 @@
.and be_a_success
end
- it "check --json=v2 format", :integration_test do
- setup_test_formula "testball"
-
- expect { brew "info", "testball", "--json=v2" }
- .to output(expected_output).to_stdout
- end
-
describe Homebrew do
describe "::github_remote_path" do
let(:remote) { "https://github.com/Homebrew/homebrew-core" } | true |
Other | Homebrew | brew | ce7ab823ed5b93ae4588e754c3cc64974c0882f7.json | Replace test for checking formulae tap
As suggested by @Rylan12, integration tests are super slow.
Co-Authored-By: Rylan Polster <rslpolster@gmail.com> | Library/Homebrew/test/formula_spec.rb | @@ -838,6 +838,7 @@
expect(h).to be_a(Hash)
expect(h["name"]).to eq("foo")
expect(h["full_name"]).to eq("foo")
+ expect(h["tap"]).to eq("homebrew/core")
expect(h["versions"]["stable"]).to eq("1.0")
expect(h["versions"]["bottle"]).to be_truthy
end | true |
Other | Homebrew | brew | 7ca79553f0ba9e2e83d3bad069ba90eb576fd3cf.json | Add test to check --json=v2 format | Library/Homebrew/test/cmd/info_spec.rb | @@ -6,6 +6,19 @@
require "cmd/shared_examples/args_parse"
describe "brew info" do
+ let(:tarball) do
+ if OS.linux?
+ TEST_FIXTURE_DIR/"tarballs/testball-0.1-linux.tbz"
+ else
+ TEST_FIXTURE_DIR/"tarballs/testball-0.1.tbz"
+ end
+ end
+ let(:expected_output) {
+ <<~EOS
+ {"formulae":[{"name":"testball","full_name":"testball","tap":"homebrew/core","oldname":null,"aliases":[],"versioned_formulae":[],"desc":"Some test","license":null,"homepage":"https://brew.sh/testball","versions":{"stable":"0.1","head":null,"bottle":false},"urls":{"stable":{"url":"file://#{tarball}","tag":null,"revision":null}},"revision":0,"version_scheme":0,"bottle":{},"keg_only":false,"bottle_disabled":false,"options":[{"option":"--with-foo","description":"Build with foo"}],"build_dependencies":[],"dependencies":[],"recommended_dependencies":[],"optional_dependencies":[],"uses_from_macos":[],"requirements":[],"conflicts_with":[],"caveats":null,"installed":[],"linked_keg":null,"pinned":false,"outdated":false,"deprecated":false,"deprecation_date":null,"deprecation_reason":null,"disabled":false,"disable_date":null,"disable_reason":null}],"casks":[]}
+ EOS
+ }
+
it_behaves_like "parseable arguments"
it "prints as json with the --json=v1 flag", :integration_test do
@@ -26,6 +39,13 @@
.and be_a_success
end
+ it "check --json=v2 format", :integration_test do
+ setup_test_formula "testball"
+
+ expect { brew "info", "testball", "--json=v2" }
+ .to output(expected_output).to_stdout
+ end
+
describe Homebrew do
describe "::github_remote_path" do
let(:remote) { "https://github.com/Homebrew/homebrew-core" } | false |
Other | Homebrew | brew | a20b60112059a2f807406a79505bc066c86712d8.json | Add tap to formula json output | Library/Homebrew/formula.rb | @@ -1766,6 +1766,7 @@ def to_hash
hsh = {
"name" => name,
"full_name" => full_name,
+ "tap" => tap.name,
"oldname" => oldname,
"aliases" => aliases.sort,
"versioned_formulae" => versioned_formulae.map(&:name), | false |
Other | Homebrew | brew | 84d80cf0bf9d651d5f1668e122215324fd7d015f.json | Add tap to cask json output | Library/Homebrew/cask/cask.rb | @@ -170,6 +170,7 @@ def to_h
{
"token" => token,
"full_token" => "#{tap.name}/#{token}",
+ "tap" => tap.name,
"name" => name,
"desc" => desc,
"homepage" => homepage, | true |
Other | Homebrew | brew | 84d80cf0bf9d651d5f1668e122215324fd7d015f.json | Add tap to cask json output | Library/Homebrew/test/cask/cmd/list_spec.rb | @@ -87,7 +87,7 @@
let(:casks) { ["local-caffeine", "local-transmission", "third-party/tap/third-party-cask"] }
let(:expected_output) {
<<~EOS
- [{"token":"local-caffeine","full_token":"homebrew/cask/local-caffeine","name":[],"desc":null,"homepage":"https://brew.sh/","url":"file:///usr/local/Homebrew/Library/Homebrew/test/support/fixtures/cask/caffeine.zip","appcast":null,"version":"1.2.3","installed":"1.2.3","outdated":false,"sha256":"67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94","artifacts":[["Caffeine.app"]],"caveats":null,"depends_on":{},"conflicts_with":null,"container":null,"auto_updates":null},{"token":"local-transmission","full_token":"homebrew/cask/local-transmission","name":["Transmission"],"desc":"BitTorrent client","homepage":"https://transmissionbt.com/","url":"file:///usr/local/Homebrew/Library/Homebrew/test/support/fixtures/cask/transmission-2.61.dmg","appcast":null,"version":"2.61","installed":"2.61","outdated":false,"sha256":"e44ffa103fbf83f55c8d0b1bea309a43b2880798dae8620b1ee8da5e1095ec68","artifacts":[["Transmission.app"]],"caveats":null,"depends_on":{},"conflicts_with":null,"container":null,"auto_updates":null},{"token":"third-party-cask","full_token":"third-party/tap/third-party-cask","name":[],"desc":null,"homepage":"https://brew.sh/","url":"https://brew.sh/ThirdParty.dmg","appcast":null,"version":"1.2.3","installed":"1.2.3","outdated":false,"sha256":"8c62a2b791cf5f0da6066a0a4b6e85f62949cd60975da062df44adf887f4370b","artifacts":[["ThirdParty.app"]],"caveats":null,"depends_on":{},"conflicts_with":null,"container":null,"auto_updates":null}]
+ [{"token":"local-caffeine","full_token":"homebrew/cask/local-caffeine","tap":"homebrew/cask","name":[],"desc":null,"homepage":"https://brew.sh/","url":"file:///usr/local/Homebrew/Library/Homebrew/test/support/fixtures/cask/caffeine.zip","appcast":null,"version":"1.2.3","installed":"1.2.3","outdated":false,"sha256":"67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94","artifacts":[["Caffeine.app"]],"caveats":null,"depends_on":{},"conflicts_with":null,"container":null,"auto_updates":null},{"token":"local-transmission","full_token":"homebrew/cask/local-transmission","tap":"homebrew/cask","name":["Transmission"],"desc":"BitTorrent client","homepage":"https://transmissionbt.com/","url":"file:///usr/local/Homebrew/Library/Homebrew/test/support/fixtures/cask/transmission-2.61.dmg","appcast":null,"version":"2.61","installed":"2.61","outdated":false,"sha256":"e44ffa103fbf83f55c8d0b1bea309a43b2880798dae8620b1ee8da5e1095ec68","artifacts":[["Transmission.app"]],"caveats":null,"depends_on":{},"conflicts_with":null,"container":null,"auto_updates":null},{"token":"third-party-cask","full_token":"third-party/tap/third-party-cask","tap":"third-party/tap","name":[],"desc":null,"homepage":"https://brew.sh/","url":"https://brew.sh/ThirdParty.dmg","appcast":null,"version":"1.2.3","installed":"1.2.3","outdated":false,"sha256":"8c62a2b791cf5f0da6066a0a4b6e85f62949cd60975da062df44adf887f4370b","artifacts":[["ThirdParty.app"]],"caveats":null,"depends_on":{},"conflicts_with":null,"container":null,"auto_updates":null}]
EOS
}
| true |
Other | Homebrew | brew | f68a3961c75fbc2dc2bd2b3fe0e67f70c981675f.json | Prepare deprecations for the old bottle syntax | Library/Homebrew/formula.rb | @@ -2447,11 +2447,11 @@ def sha256(val)
#
# <pre>bottle do
# root_url "https://example.com" # Optional root to calculate bottle URLs.
- # cellar "/opt/homebrew/Cellar" # Optional HOMEBREW_CELLAR in which the bottles were built.
# rebuild 1 # Marks the old bottle as outdated without bumping the version/revision of the formula.
- # sha256 "ef65c759c5097a36323fa9c77756468649e8d1980a3a4e05695c05e39568967c" => :catalina
- # sha256 "28f4090610946a4eb207df102d841de23ced0d06ba31cb79e040d883906dcd4f" => :mojave
- # sha256 "91dd0caca9bd3f38c439d5a7b6f68440c4274945615fae035ff0a369264b8a2f" => :high_sierra
+ # # Optionally specify the HOMEBREW_CELLAR in which the bottles were built.
+ # sha256 cellar: "/brew/Cellar", catalina: "ef65c759c5097a36323fa9c77756468649e8d1980a3a4e05695c05e39568967c"
+ # sha256 cellar: :any, mojave: "28f4090610946a4eb207df102d841de23ced0d06ba31cb79e040d883906dcd4f"
+ # sha256 high_sierra: "91dd0caca9bd3f38c439d5a7b6f68440c4274945615fae035ff0a369264b8a2f"
# end</pre>
#
# Homebrew maintainers aim to bottle all formulae that require compilation. | true |
Other | Homebrew | brew | f68a3961c75fbc2dc2bd2b3fe0e67f70c981675f.json | Prepare deprecations for the old bottle syntax | Library/Homebrew/software_spec.rb | @@ -371,6 +371,14 @@ def root_url(var = nil, specs = {})
end
def cellar(val = nil)
+ # TODO: (3.1) uncomment to deprecate the old bottle syntax
+ # if val.present?
+ # odeprecated(
+ # "`cellar` in a bottle block",
+ # "`brew style --fix` on the formula to update the style or use `sha256` with a `cellar:` argument",
+ # )
+ # end
+
return collector.dig(Utils::Bottles.tag, :cellar) || @all_tags_cellar if val.nil?
@all_tags_cellar = val
@@ -422,6 +430,14 @@ def sha256(hash)
digest, tag = hash.find do |key, value|
key.is_a?(String) && value.is_a?(Symbol) && key.match?(sha256_regex)
end
+
+ # TODO: (3.1) uncomment to deprecate the old bottle syntax
+ # if digest && tag
+ # odeprecated(
+ # '`sha256 "digest" => :tag` in a bottle block',
+ # '`brew style --fix` on the formula to update the style or use `sha256 tag: "digest"`',
+ # )
+ # end
end
cellar ||= all_tags_cellar | true |
Other | Homebrew | brew | ab08b01b3f4c6e45c8eba4867b80655f2f24e34a.json | workflows/doctor: fix workflow not running | .github/workflows/doctor.yml | @@ -8,20 +8,22 @@ on:
- Library/Homebrew/extend/os/diagnostic.rb
- Library/Homebrew/extend/os/mac/diagnostic.rb
- Library/Homebrew/os/mac/xcode.rb
- branches-ignore:
- - master
env:
HOMEBREW_DEVELOPER: 1
HOMEBREW_NO_AUTO_UPDATE: 1
+ HOMEBREW_CHANGE_ARCH_TO_ARM: 1
jobs:
tests:
strategy:
matrix:
- version: [10.15, 10.14, 10.13]
+ version: ['11-arm', '11.0', '10.15', '10.14']
fail-fast: false
runs-on: ${{ matrix.version }}
env:
- PATH: "/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
+ PATH: "/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
+ defaults:
+ run:
+ working-directory: /tmp
steps:
- name: Set up Homebrew
id: set-up-homebrew | false |
Other | Homebrew | brew | 9394fe2b5211e5a5f5a3d2bb5b991a3c7ccc7bc4.json | utils/github: Use constant everywhere for "create a PAT" message
- This way if we ever change this messaging, we only have to do so once. | Library/Homebrew/utils/github.rb | @@ -49,9 +49,8 @@ def initialize(reset, github_message)
@github_message = github_message
super <<~EOS
GitHub API Error: #{github_message}
- Try again in #{pretty_ratelimit_reset(reset)}, or create a personal access token:
- #{ALL_SCOPES_URL}
- #{Utils::Shell.set_variable_in_profile("HOMEBREW_GITHUB_API_TOKEN", "your_token_here")}
+ Try again in #{pretty_ratelimit_reset(reset)}, or:
+ #{CREATE_GITHUB_PAT_MESSAGE}
EOS
end
@@ -75,9 +74,7 @@ def initialize(github_message)
The GitHub credentials in the macOS keychain may be invalid.
Clear them with:
printf "protocol=https\\nhost=github.com\\n" | git credential-osxkeychain erase
- Or create a personal access token:
- #{ALL_SCOPES_URL}
- #{Utils::Shell.set_variable_in_profile("HOMEBREW_GITHUB_API_TOKEN", "your_token_here")}
+ #{CREATE_GITHUB_PAT_MESSAGE}
EOS
end
super message.freeze
@@ -182,9 +179,7 @@ def api_credentials_error_message(response_headers, needed_scopes)
Your #{what} credentials do not have sufficient scope!
Scopes required: #{needed_scopes}
Scopes present: #{credentials_scopes}
- Create a personal access token:
- #{ALL_SCOPES_URL}
- #{Utils::Shell.set_variable_in_profile("HOMEBREW_GITHUB_API_TOKEN", "your_token_here")}
+ #{CREATE_GITHUB_PAT_MESSAGE}
EOS
end
| false |
Other | Homebrew | brew | ccb6d5e834dbfe91043b324af95872840903aec7.json | utils/github: Handle users not having any GitHub credentials
- When running `brew request-bottle`, users who don't have credentials
in the macOS keychain (ie, Linux users) or `HOMEBREW_GITHUB_API_TOKEN`
receive "Error: Not Found" from the GitHub API returning a 404.
- This is cryptic and confusing for newcomers to Linux maintenance, and
potentially confusing to other folks using `open_api` where
credentials are expected yet unset.
- This adds a new `MissingAuthenticationError` to handle the case where
the GitHub API returns 404 and there are no creds yet API scopes are
required.
Before:
```
issyl0@sky:/home/linuxbrew/.linuxbrew/Homebrew$ brew request-bottle hello
==> Dispatching request to Homebrew/linuxbrew-core for hello
Error: Not Found
```
After:
```
issyl0@sky:/home/linuxbrew/.linuxbrew/Homebrew$ brew request-bottle hello
==> Dispatching request to Homebrew/linuxbrew-core for hello
Error: No GitHub credentials found in Keychain or environment.
Create a GitHub personal access token:
https://github.com/settings/tokens/new?scopes=gist,public_repo&description=Homebrew
echo 'export HOMEBREW_GITHUB_API_TOKEN=your_token_here' >> ~/.profile
``` | Library/Homebrew/utils/github.rb | @@ -24,6 +24,11 @@ module GitHub
ALL_SCOPES_URL = Formatter.url(
"https://github.com/settings/tokens/new?scopes=#{ALL_SCOPES.join(",")}&description=Homebrew",
).freeze
+ CREATE_GITHUB_PAT_MESSAGE = <<~EOS
+ Create a GitHub personal access token:
+ #{ALL_SCOPES_URL}
+ #{Utils::Shell.set_variable_in_profile("HOMEBREW_GITHUB_API_TOKEN", "your_token_here")}
+ EOS
# Generic API error.
class Error < RuntimeError
@@ -79,6 +84,15 @@ def initialize(github_message)
end
end
+ # Error when the user has no GitHub API credentials set at all (macOS keychain or envvar).
+ class MissingAuthenticationError < Error
+ def initialize
+ message = +"No GitHub credentials found in Keychain or environment.\n"
+ message << CREATE_GITHUB_PAT_MESSAGE
+ super message
+ end
+ end
+
# Error when the API returns a validation error.
class ValidationFailedError < Error
def initialize(github_message, errors)
@@ -277,6 +291,8 @@ def raise_api_error(output, errors, http_code, headers, scopes)
when "401", "403"
raise AuthenticationFailedError, message
when "404"
+ raise MissingAuthenticationError if api_credentials_type == :none && scopes.present?
+
raise HTTPNotFoundError, message
when "422"
errors = json&.[]("errors") || [] | false |
Other | Homebrew | brew | 3dccea251fd03fd35626de1654ab0e930ae6c53d.json | bottle: write bottles in correct order | Library/Homebrew/software_spec.rb | @@ -435,7 +435,10 @@ def checksum_for(tag)
def checksums
tags = collector.keys.sort_by do |tag|
- "#{OS::Mac::Version.from_symbol(tag)}_#{tag}"
+ version = OS::Mac::Version.from_symbol(tag)
+ # Give arm64 bottles a higher priority so they are first
+ priority = version.arch == :arm64 ? "2" : "1"
+ "#{priority}.#{version}_#{tag}"
rescue MacOSVersionError
# Sort non-MacOS tags below MacOS tags.
"0.#{tag}" | true |
Other | Homebrew | brew | 3dccea251fd03fd35626de1654ab0e930ae6c53d.json | bottle: write bottles in correct order | Library/Homebrew/test/dev-cmd/bottle_spec.rb | @@ -50,6 +50,17 @@
end
before do
+ Pathname("#{TEST_TMPDIR}/testball-1.0.arm64_big_sur.bottle.json").write stub_hash(
+ name: "testball",
+ version: "1.0",
+ path: "#{core_tap.path}/Formula/testball.rb",
+ cellar: "any_skip_relocation",
+ os: "arm64_big_sur",
+ filename: "testball-1.0.arm64_big_sur.bottle.tar.gz",
+ local_filename: "testball--1.0.arm64_big_sur.bottle.tar.gz",
+ sha256: "8f9aecd233463da6a4ea55f5f88fc5841718c013f3e2a7941350d6130f1dc149",
+ )
+
Pathname("#{TEST_TMPDIR}/testball-1.0.big_sur.bottle.json").write stub_hash(
name: "testball",
version: "1.0",
@@ -74,6 +85,7 @@
end
after do
+ FileUtils.rm_f "#{TEST_TMPDIR}/testball-1.0.arm64_big_sur.bottle.json"
FileUtils.rm_f "#{TEST_TMPDIR}/testball-1.0.catalina.bottle.json"
FileUtils.rm_f "#{TEST_TMPDIR}/testball-1.0.big_sur.bottle.json"
end
@@ -90,14 +102,16 @@
brew "bottle",
"--merge",
"--write",
+ "#{TEST_TMPDIR}/testball-1.0.arm64_big_sur.bottle.json",
"#{TEST_TMPDIR}/testball-1.0.big_sur.bottle.json",
"#{TEST_TMPDIR}/testball-1.0.catalina.bottle.json"
}.to output(<<~EOS).to_stdout
==> testball
bottle do
root_url "#{HOMEBREW_BOTTLE_DEFAULT_DOMAIN}"
- sha256 cellar: :any_skip_relocation, big_sur: "a0af7dcbb5c83f6f3f7ecd507c2d352c1a018f894d51ad241ce8492fa598010f"
- sha256 cellar: :any_skip_relocation, catalina: "5334dd344986e46b2aa4f0471cac7b0914bd7de7cb890a34415771788d03f2ac"
+ sha256 cellar: :any_skip_relocation, arm64_big_sur: "8f9aecd233463da6a4ea55f5f88fc5841718c013f3e2a7941350d6130f1dc149"
+ sha256 cellar: :any_skip_relocation, big_sur: "a0af7dcbb5c83f6f3f7ecd507c2d352c1a018f894d51ad241ce8492fa598010f"
+ sha256 cellar: :any_skip_relocation, catalina: "5334dd344986e46b2aa4f0471cac7b0914bd7de7cb890a34415771788d03f2ac"
end
EOS
@@ -110,8 +124,9 @@ class Testball < Formula
bottle do
root_url "#{HOMEBREW_BOTTLE_DEFAULT_DOMAIN}"
- sha256 cellar: :any_skip_relocation, big_sur: "a0af7dcbb5c83f6f3f7ecd507c2d352c1a018f894d51ad241ce8492fa598010f"
- sha256 cellar: :any_skip_relocation, catalina: "5334dd344986e46b2aa4f0471cac7b0914bd7de7cb890a34415771788d03f2ac"
+ sha256 cellar: :any_skip_relocation, arm64_big_sur: "8f9aecd233463da6a4ea55f5f88fc5841718c013f3e2a7941350d6130f1dc149"
+ sha256 cellar: :any_skip_relocation, big_sur: "a0af7dcbb5c83f6f3f7ecd507c2d352c1a018f894d51ad241ce8492fa598010f"
+ sha256 cellar: :any_skip_relocation, catalina: "5334dd344986e46b2aa4f0471cac7b0914bd7de7cb890a34415771788d03f2ac"
end
option "with-foo", "Build with foo"
@@ -141,8 +156,9 @@ def install
bottle do
root_url "#{HOMEBREW_BOTTLE_DEFAULT_DOMAIN}"
cellar :any_skip_relocation
- sha256 big_sur: "6b276491297d4052538bd2fd22d5129389f27d90a98f831987236a5b90511b98"
- sha256 catalina: "16cf230afdfcb6306c208d169549cf8773c831c8653d2c852315a048960d7e72"
+ sha256 "6b276491297d4052538bd2fd22d5129389f27d90a98f831987236a5b90511b98" => :big_sur
+ sha256 "c3c650d75f5188f5d6edd351dd3215e141b73b8ec1cf9144f30e39cbc45de72e" => :arm64_big_sur
+ sha256 "16cf230afdfcb6306c208d169549cf8773c831c8653d2c852315a048960d7e72" => :catalina
end
EOS
system "git", "add", "--all"
@@ -153,14 +169,16 @@ def install
brew "bottle",
"--merge",
"--write",
+ "#{TEST_TMPDIR}/testball-1.0.arm64_big_sur.bottle.json",
"#{TEST_TMPDIR}/testball-1.0.big_sur.bottle.json",
"#{TEST_TMPDIR}/testball-1.0.catalina.bottle.json"
}.to output(<<~EOS).to_stdout
==> testball
bottle do
root_url "#{HOMEBREW_BOTTLE_DEFAULT_DOMAIN}"
- sha256 cellar: :any_skip_relocation, big_sur: "a0af7dcbb5c83f6f3f7ecd507c2d352c1a018f894d51ad241ce8492fa598010f"
- sha256 cellar: :any_skip_relocation, catalina: "5334dd344986e46b2aa4f0471cac7b0914bd7de7cb890a34415771788d03f2ac"
+ sha256 cellar: :any_skip_relocation, arm64_big_sur: "8f9aecd233463da6a4ea55f5f88fc5841718c013f3e2a7941350d6130f1dc149"
+ sha256 cellar: :any_skip_relocation, big_sur: "a0af7dcbb5c83f6f3f7ecd507c2d352c1a018f894d51ad241ce8492fa598010f"
+ sha256 cellar: :any_skip_relocation, catalina: "5334dd344986e46b2aa4f0471cac7b0914bd7de7cb890a34415771788d03f2ac"
end
EOS
@@ -175,8 +193,9 @@ class Testball < Formula
bottle do
root_url "#{HOMEBREW_BOTTLE_DEFAULT_DOMAIN}"
- sha256 cellar: :any_skip_relocation, big_sur: "a0af7dcbb5c83f6f3f7ecd507c2d352c1a018f894d51ad241ce8492fa598010f"
- sha256 cellar: :any_skip_relocation, catalina: "5334dd344986e46b2aa4f0471cac7b0914bd7de7cb890a34415771788d03f2ac"
+ sha256 cellar: :any_skip_relocation, arm64_big_sur: "8f9aecd233463da6a4ea55f5f88fc5841718c013f3e2a7941350d6130f1dc149"
+ sha256 cellar: :any_skip_relocation, big_sur: "a0af7dcbb5c83f6f3f7ecd507c2d352c1a018f894d51ad241ce8492fa598010f"
+ sha256 cellar: :any_skip_relocation, catalina: "5334dd344986e46b2aa4f0471cac7b0914bd7de7cb890a34415771788d03f2ac"
end
def install
@@ -203,8 +222,9 @@ def install
bottle do
root_url "#{HOMEBREW_BOTTLE_DEFAULT_DOMAIN}"
- sha256 cellar: :any_skip_relocation, big_sur: "6b276491297d4052538bd2fd22d5129389f27d90a98f831987236a5b90511b98"
- sha256 cellar: :any_skip_relocation, catalina: "16cf230afdfcb6306c208d169549cf8773c831c8653d2c852315a048960d7e72"
+ sha256 cellar: :any_skip_relocation, arm64_big_sur: "c3c650d75f5188f5d6edd351dd3215e141b73b8ec1cf9144f30e39cbc45de72e"
+ sha256 cellar: :any_skip_relocation, big_sur: "6b276491297d4052538bd2fd22d5129389f27d90a98f831987236a5b90511b98"
+ sha256 cellar: :any_skip_relocation, catalina: "16cf230afdfcb6306c208d169549cf8773c831c8653d2c852315a048960d7e72"
end
EOS
system "git", "add", "--all"
@@ -215,14 +235,16 @@ def install
brew "bottle",
"--merge",
"--write",
+ "#{TEST_TMPDIR}/testball-1.0.arm64_big_sur.bottle.json",
"#{TEST_TMPDIR}/testball-1.0.big_sur.bottle.json",
"#{TEST_TMPDIR}/testball-1.0.catalina.bottle.json"
}.to output(<<~EOS).to_stdout
==> testball
bottle do
root_url "#{HOMEBREW_BOTTLE_DEFAULT_DOMAIN}"
- sha256 cellar: :any_skip_relocation, big_sur: "a0af7dcbb5c83f6f3f7ecd507c2d352c1a018f894d51ad241ce8492fa598010f"
- sha256 cellar: :any_skip_relocation, catalina: "5334dd344986e46b2aa4f0471cac7b0914bd7de7cb890a34415771788d03f2ac"
+ sha256 cellar: :any_skip_relocation, arm64_big_sur: "8f9aecd233463da6a4ea55f5f88fc5841718c013f3e2a7941350d6130f1dc149"
+ sha256 cellar: :any_skip_relocation, big_sur: "a0af7dcbb5c83f6f3f7ecd507c2d352c1a018f894d51ad241ce8492fa598010f"
+ sha256 cellar: :any_skip_relocation, catalina: "5334dd344986e46b2aa4f0471cac7b0914bd7de7cb890a34415771788d03f2ac"
end
EOS
@@ -237,8 +259,9 @@ class Testball < Formula
bottle do
root_url "#{HOMEBREW_BOTTLE_DEFAULT_DOMAIN}"
- sha256 cellar: :any_skip_relocation, big_sur: "a0af7dcbb5c83f6f3f7ecd507c2d352c1a018f894d51ad241ce8492fa598010f"
- sha256 cellar: :any_skip_relocation, catalina: "5334dd344986e46b2aa4f0471cac7b0914bd7de7cb890a34415771788d03f2ac"
+ sha256 cellar: :any_skip_relocation, arm64_big_sur: "8f9aecd233463da6a4ea55f5f88fc5841718c013f3e2a7941350d6130f1dc149"
+ sha256 cellar: :any_skip_relocation, big_sur: "a0af7dcbb5c83f6f3f7ecd507c2d352c1a018f894d51ad241ce8492fa598010f"
+ sha256 cellar: :any_skip_relocation, catalina: "5334dd344986e46b2aa4f0471cac7b0914bd7de7cb890a34415771788d03f2ac"
end
def install
@@ -271,6 +294,7 @@ def install
"--merge",
"--write",
"--keep-old",
+ "#{TEST_TMPDIR}/testball-1.0.arm64_big_sur.bottle.json",
"#{TEST_TMPDIR}/testball-1.0.big_sur.bottle.json",
"#{TEST_TMPDIR}/testball-1.0.catalina.bottle.json"
}.to output("Error: `--keep-old` was passed but there was no existing bottle block!\n").to_stderr
@@ -296,15 +320,17 @@ def install
"--merge",
"--write",
"--keep-old",
+ "#{TEST_TMPDIR}/testball-1.0.arm64_big_sur.bottle.json",
"#{TEST_TMPDIR}/testball-1.0.big_sur.bottle.json",
"#{TEST_TMPDIR}/testball-1.0.catalina.bottle.json"
}.to output(<<~EOS).to_stdout
==> testball
bottle do
root_url "#{HOMEBREW_BOTTLE_DEFAULT_DOMAIN}"
- sha256 cellar: :any_skip_relocation, big_sur: "a0af7dcbb5c83f6f3f7ecd507c2d352c1a018f894d51ad241ce8492fa598010f"
- sha256 cellar: :any_skip_relocation, catalina: "5334dd344986e46b2aa4f0471cac7b0914bd7de7cb890a34415771788d03f2ac"
- sha256 cellar: :any, high_sierra: "6971b6eebf4c00eaaed72a1104a49be63861eabc95d679a0c84040398e320059"
+ sha256 cellar: :any_skip_relocation, arm64_big_sur: "8f9aecd233463da6a4ea55f5f88fc5841718c013f3e2a7941350d6130f1dc149"
+ sha256 cellar: :any_skip_relocation, big_sur: "a0af7dcbb5c83f6f3f7ecd507c2d352c1a018f894d51ad241ce8492fa598010f"
+ sha256 cellar: :any_skip_relocation, catalina: "5334dd344986e46b2aa4f0471cac7b0914bd7de7cb890a34415771788d03f2ac"
+ sha256 cellar: :any, high_sierra: "6971b6eebf4c00eaaed72a1104a49be63861eabc95d679a0c84040398e320059"
end
EOS
@@ -319,9 +345,10 @@ class Testball < Formula
bottle do
root_url "#{HOMEBREW_BOTTLE_DEFAULT_DOMAIN}"
- sha256 cellar: :any_skip_relocation, big_sur: "a0af7dcbb5c83f6f3f7ecd507c2d352c1a018f894d51ad241ce8492fa598010f"
- sha256 cellar: :any_skip_relocation, catalina: "5334dd344986e46b2aa4f0471cac7b0914bd7de7cb890a34415771788d03f2ac"
- sha256 cellar: :any, high_sierra: "6971b6eebf4c00eaaed72a1104a49be63861eabc95d679a0c84040398e320059"
+ sha256 cellar: :any_skip_relocation, arm64_big_sur: "8f9aecd233463da6a4ea55f5f88fc5841718c013f3e2a7941350d6130f1dc149"
+ sha256 cellar: :any_skip_relocation, big_sur: "a0af7dcbb5c83f6f3f7ecd507c2d352c1a018f894d51ad241ce8492fa598010f"
+ sha256 cellar: :any_skip_relocation, catalina: "5334dd344986e46b2aa4f0471cac7b0914bd7de7cb890a34415771788d03f2ac"
+ sha256 cellar: :any, high_sierra: "6971b6eebf4c00eaaed72a1104a49be63861eabc95d679a0c84040398e320059"
end
def install
@@ -360,15 +387,17 @@ def install
"--merge",
"--write",
"--keep-old",
+ "#{TEST_TMPDIR}/testball-1.0.arm64_big_sur.bottle.json",
"#{TEST_TMPDIR}/testball-1.0.big_sur.bottle.json",
"#{TEST_TMPDIR}/testball-1.0.catalina.bottle.json"
}.to output(<<~EOS).to_stdout
==> testball
bottle do
root_url "#{HOMEBREW_BOTTLE_DEFAULT_DOMAIN}"
- sha256 cellar: :any_skip_relocation, big_sur: "a0af7dcbb5c83f6f3f7ecd507c2d352c1a018f894d51ad241ce8492fa598010f"
- sha256 cellar: :any_skip_relocation, catalina: "5334dd344986e46b2aa4f0471cac7b0914bd7de7cb890a34415771788d03f2ac"
- sha256 cellar: :any, high_sierra: "6971b6eebf4c00eaaed72a1104a49be63861eabc95d679a0c84040398e320059"
+ sha256 cellar: :any_skip_relocation, arm64_big_sur: "8f9aecd233463da6a4ea55f5f88fc5841718c013f3e2a7941350d6130f1dc149"
+ sha256 cellar: :any_skip_relocation, big_sur: "a0af7dcbb5c83f6f3f7ecd507c2d352c1a018f894d51ad241ce8492fa598010f"
+ sha256 cellar: :any_skip_relocation, catalina: "5334dd344986e46b2aa4f0471cac7b0914bd7de7cb890a34415771788d03f2ac"
+ sha256 cellar: :any, high_sierra: "6971b6eebf4c00eaaed72a1104a49be63861eabc95d679a0c84040398e320059"
end
EOS
@@ -383,9 +412,10 @@ class Testball < Formula
bottle do
root_url "#{HOMEBREW_BOTTLE_DEFAULT_DOMAIN}"
- sha256 cellar: :any_skip_relocation, big_sur: "a0af7dcbb5c83f6f3f7ecd507c2d352c1a018f894d51ad241ce8492fa598010f"
- sha256 cellar: :any_skip_relocation, catalina: "5334dd344986e46b2aa4f0471cac7b0914bd7de7cb890a34415771788d03f2ac"
- sha256 cellar: :any, high_sierra: "6971b6eebf4c00eaaed72a1104a49be63861eabc95d679a0c84040398e320059"
+ sha256 cellar: :any_skip_relocation, arm64_big_sur: "8f9aecd233463da6a4ea55f5f88fc5841718c013f3e2a7941350d6130f1dc149"
+ sha256 cellar: :any_skip_relocation, big_sur: "a0af7dcbb5c83f6f3f7ecd507c2d352c1a018f894d51ad241ce8492fa598010f"
+ sha256 cellar: :any_skip_relocation, catalina: "5334dd344986e46b2aa4f0471cac7b0914bd7de7cb890a34415771788d03f2ac"
+ sha256 cellar: :any, high_sierra: "6971b6eebf4c00eaaed72a1104a49be63861eabc95d679a0c84040398e320059"
end
def install | true |
Other | Homebrew | brew | a90fb27adb42655191b90fdc42acae364fde81de.json | untap: add missing --force switch | Library/Homebrew/cmd/untap.rb | @@ -14,6 +14,8 @@ def untap_args
description <<~EOS
Remove a tapped formula repository.
EOS
+ switch "-f", "--force",
+ description: "Untap even if formulae or casks from this tap are currently installed."
named_args :tap, min: 1
end | true |
Other | Homebrew | brew | a90fb27adb42655191b90fdc42acae364fde81de.json | untap: add missing --force switch | completions/bash/brew | @@ -2047,6 +2047,7 @@ _brew_untap() {
-*)
__brewcomp "
--debug
+ --force
--help
--quiet
--verbose | true |
Other | Homebrew | brew | a90fb27adb42655191b90fdc42acae364fde81de.json | untap: add missing --force switch | completions/fish/brew.fish | @@ -1406,6 +1406,7 @@ __fish_brew_complete_arg 'unpin' -a '(__fish_brew_suggest_formulae_installed)'
__fish_brew_complete_cmd 'untap' 'Remove a tapped formula repository'
__fish_brew_complete_arg 'untap' -l debug -d 'Display any debugging information'
+__fish_brew_complete_arg 'untap' -l force -d 'Untap even if formulae or casks from this tap are currently installed'
__fish_brew_complete_arg 'untap' -l help -d 'Show this message'
__fish_brew_complete_arg 'untap' -l quiet -d 'Make some output more quiet'
__fish_brew_complete_arg 'untap' -l verbose -d 'Make some output more verbose' | true |
Other | Homebrew | brew | a90fb27adb42655191b90fdc42acae364fde81de.json | untap: add missing --force switch | completions/zsh/_brew | @@ -1638,6 +1638,7 @@ _brew_unpin() {
_brew_untap() {
_arguments \
'--debug[Display any debugging information]' \
+ '--force[Untap even if formulae or casks from this tap are currently installed]' \
'--help[Show this message]' \
'--quiet[Make some output more quiet]' \
'--verbose[Make some output more verbose]' \ | true |
Other | Homebrew | brew | a90fb27adb42655191b90fdc42acae364fde81de.json | untap: add missing --force switch | docs/Manpage.md | @@ -590,10 +590,13 @@ for temporarily disabling a formula:
Unpin *`formula`*, allowing them to be upgraded by `brew upgrade` *`formula`*.
See also `pin`.
-### `untap` *`tap`* [...]
+### `untap` [*`--force`*] *`tap`* [...]
Remove a tapped formula repository.
+* `-f`, `--force`:
+ Untap even if formulae or casks from this tap are currently installed.
+
### `update` [*`options`*]
Fetch the newest version of Homebrew and all formulae from GitHub using `git`(1) and perform any necessary migrations. | true |
Other | Homebrew | brew | a90fb27adb42655191b90fdc42acae364fde81de.json | untap: add missing --force switch | manpages/brew.1 | @@ -793,9 +793,13 @@ List files which would be unlinked without actually unlinking or deleting any fi
.SS "\fBunpin\fR \fIinstalled_formula\fR [\.\.\.]"
Unpin \fIformula\fR, allowing them to be upgraded by \fBbrew upgrade\fR \fIformula\fR\. See also \fBpin\fR\.
.
-.SS "\fBuntap\fR \fItap\fR [\.\.\.]"
+.SS "\fBuntap\fR [\fI\-\-force\fR] \fItap\fR [\.\.\.]"
Remove a tapped formula repository\.
.
+.TP
+\fB\-f\fR, \fB\-\-force\fR
+Untap even if formulae or casks from this tap are currently installed\.
+.
.SS "\fBupdate\fR [\fIoptions\fR]"
Fetch the newest version of Homebrew and all formulae from GitHub using \fBgit\fR(1) and perform any necessary migrations\.
. | true |
Other | Homebrew | brew | 7d8437608e7ba37f7dbd0561d25210ff30c4e099.json | Add JSONFormatter explicitly | Library/Homebrew/test/spec_helper.rb | @@ -3,22 +3,17 @@
if ENV["HOMEBREW_TESTS_COVERAGE"]
require "simplecov"
+ require "simplecov_json_formatter"
- formatters = [SimpleCov::Formatter::HTMLFormatter]
- if RUBY_PLATFORM[/darwin/]
- require "simplecov_json_formatter"
-
- formatters << SimpleCov::Formatter::JSONFormatter
+ formatters = [SimpleCov::Formatter::HTMLFormatter, SimpleCov::Formatter::JSONFormatter]
+ SimpleCov.formatters = SimpleCov::Formatter::MultiFormatter.new(formatters)
- if ENV["TEST_ENV_NUMBER"]
- SimpleCov.at_exit do
- result = SimpleCov.result
- result.format! if ParallelTests.number_of_running_processes <= 1
- end
+ if RUBY_PLATFORM[/darwin/] && ENV["TEST_ENV_NUMBER"]
+ SimpleCov.at_exit do
+ result = SimpleCov.result
+ result.format! if ParallelTests.number_of_running_processes <= 1
end
end
-
- SimpleCov.formatters = SimpleCov::Formatter::MultiFormatter.new(formatters)
end
require "rspec/its" | false |
Other | Homebrew | brew | 6e3011a8cc639980fc90c8f05d29fc8c4499f959.json | docs: update bottle documentation | docs/Bottles.md | @@ -22,9 +22,10 @@ A simple (and typical) example:
```ruby
bottle do
- sha256 "4921af80137af9cc3d38fd17c9120da882448a090b0a8a3a19af3199b415bfca" => :sierra
- sha256 "c71db15326ee9196cd98602e38d0b7fb2b818cdd48eede4ee8eb827d809e09ba" => :el_capitan
- sha256 "85cc828a96735bdafcf29eb6291ca91bac846579bcef7308536e0c875d6c81d7" => :yosemite
+ sha256 arm64_big_sur: "a9ae578b05c3da46cedc07dd428d94a856aeae7f3ef80a0f405bf89b8cde893a"
+ sha256 big_sur: "5dc376aa20241233b76e2ec2c1d4e862443a0250916b2838a1ff871e8a6dc2c5"
+ sha256 catalina: "924afbbc16549d8c2b80544fd03104ff8c17a4b1460238e3ed17a1313391a2af"
+ sha256 mojave: "678d338adc7d6e8c352800fe03fc56660c796bd6da23eda2b1411fed18bd0d8d"
end
```
@@ -33,11 +34,11 @@ A full example:
```ruby
bottle do
root_url "https://example.com"
- cellar "/opt/homebrew/Cellar"
rebuild 4
- sha256 "4921af80137af9cc3d38fd17c9120da882448a090b0a8a3a19af3199b415bfca" => :sierra
- sha256 "c71db15326ee9196cd98602e38d0b7fb2b818cdd48eede4ee8eb827d809e09ba" => :el_capitan
- sha256 "85cc828a96735bdafcf29eb6291ca91bac846579bcef7308536e0c875d6c81d7" => :yosemite
+ sha256 cellar: "/opt/homebrew/Cellar", arm64_big_sur: "a9ae578b05c3da46cedc07dd428d94a856aeae7f3ef80a0f405bf89b8cde893a"
+ sha256 cellar: :any, big_sur: "5dc376aa20241233b76e2ec2c1d4e862443a0250916b2838a1ff871e8a6dc2c5"
+ sha256 catalina: "924afbbc16549d8c2b80544fd03104ff8c17a4b1460238e3ed17a1313391a2af"
+ sha256 mojave: "678d338adc7d6e8c352800fe03fc56660c796bd6da23eda2b1411fed18bd0d8d"
end
```
| false |
Other | Homebrew | brew | 727ac9b47f0b0726e1bc18bf5d2d4aa7817b1a14.json | bottle: write bottles with new syntax | Library/Homebrew/dev-cmd/bottle.rb | @@ -194,24 +194,50 @@ def keg_contain_absolute_symlink_starting_with?(string, keg, args:)
!absolute_symlinks_start_with_string.empty?
end
- def generate_sha256_line(tag, digest, cellar)
+ def cellar_parameter_needed?(cellar)
default_cellars = [
Homebrew::DEFAULT_MACOS_CELLAR,
Homebrew::DEFAULT_MACOS_ARM_CELLAR,
Homebrew::DEFAULT_LINUX_CELLAR,
]
+ cellar.present? && default_cellars.exclude?(cellar)
+ end
+
+ def generate_sha256_line(tag, digest, cellar, tag_column, digest_column)
+ line = "sha256 "
+ tag_column += line.length
+ digest_column += line.length
if cellar.is_a?(Symbol)
- %Q(sha256 cellar: :#{cellar}, #{tag}: "#{digest}")
- elsif cellar.present? && default_cellars.exclude?(cellar)
- %Q(sha256 cellar: "#{cellar}", #{tag}: "#{digest}")
- else
- %Q(sha256 #{tag}: "#{digest}")
+ line += "cellar: :#{cellar},"
+ elsif cellar_parameter_needed?(cellar)
+ line += %Q(cellar: "#{cellar}",)
end
+ line += " " * (tag_column - line.length)
+ line += "#{tag}:"
+ line += " " * (digest_column - line.length)
+ %Q(#{line}"#{digest}")
end
def bottle_output(bottle)
+ cellars = bottle.checksums.map do |checksum|
+ cellar = checksum["cellar"]
+ next unless cellar_parameter_needed? cellar
+
+ case cellar
+ when String
+ %Q("#{cellar}")
+ when Symbol
+ ":#{cellar}"
+ end
+ end.compact
+ tag_column = cellars.empty? ? 0 : "cellar: #{cellars.max_by(&:length)}, ".length
+
+ tags = bottle.checksums.map { |checksum| checksum["tag"] }
+ # Start where the tag ends, add the max length of the tag, add two for the `: `
+ digest_column = tag_column + tags.max_by(&:length).length + 2
+
sha256_lines = bottle.checksums.map do |checksum|
- generate_sha256_line(checksum["tag"], checksum["digest"], checksum["cellar"])
+ generate_sha256_line(checksum["tag"], checksum["digest"], checksum["cellar"], tag_column, digest_column)
end
erb_binding = bottle.instance_eval { binding }
erb_binding.local_variable_set(:sha256_lines, sha256_lines) | true |
Other | Homebrew | brew | 727ac9b47f0b0726e1bc18bf5d2d4aa7817b1a14.json | bottle: write bottles with new syntax | Library/Homebrew/test/dev-cmd/bottle_spec.rb | @@ -96,7 +96,7 @@
==> testball
bottle do
root_url "#{HOMEBREW_BOTTLE_DEFAULT_DOMAIN}"
- sha256 cellar: :any_skip_relocation, big_sur: "a0af7dcbb5c83f6f3f7ecd507c2d352c1a018f894d51ad241ce8492fa598010f"
+ sha256 cellar: :any_skip_relocation, big_sur: "a0af7dcbb5c83f6f3f7ecd507c2d352c1a018f894d51ad241ce8492fa598010f"
sha256 cellar: :any_skip_relocation, catalina: "5334dd344986e46b2aa4f0471cac7b0914bd7de7cb890a34415771788d03f2ac"
end
EOS
@@ -110,7 +110,7 @@ class Testball < Formula
bottle do
root_url "#{HOMEBREW_BOTTLE_DEFAULT_DOMAIN}"
- sha256 cellar: :any_skip_relocation, big_sur: "a0af7dcbb5c83f6f3f7ecd507c2d352c1a018f894d51ad241ce8492fa598010f"
+ sha256 cellar: :any_skip_relocation, big_sur: "a0af7dcbb5c83f6f3f7ecd507c2d352c1a018f894d51ad241ce8492fa598010f"
sha256 cellar: :any_skip_relocation, catalina: "5334dd344986e46b2aa4f0471cac7b0914bd7de7cb890a34415771788d03f2ac"
end
@@ -133,7 +133,7 @@ def install
EOS
end
- it "replaces the bottle block in a formula that already has a bottle block" do
+ it "replaces the bottle block in a formula that already has a bottle block in the old format" do
core_tap.path.cd do
system "git", "init"
setup_test_formula "testball", bottle_block: <<~EOS
@@ -159,7 +159,7 @@ def install
==> testball
bottle do
root_url "#{HOMEBREW_BOTTLE_DEFAULT_DOMAIN}"
- sha256 cellar: :any_skip_relocation, big_sur: "a0af7dcbb5c83f6f3f7ecd507c2d352c1a018f894d51ad241ce8492fa598010f"
+ sha256 cellar: :any_skip_relocation, big_sur: "a0af7dcbb5c83f6f3f7ecd507c2d352c1a018f894d51ad241ce8492fa598010f"
sha256 cellar: :any_skip_relocation, catalina: "5334dd344986e46b2aa4f0471cac7b0914bd7de7cb890a34415771788d03f2ac"
end
EOS
@@ -175,7 +175,69 @@ class Testball < Formula
bottle do
root_url "#{HOMEBREW_BOTTLE_DEFAULT_DOMAIN}"
- sha256 cellar: :any_skip_relocation, big_sur: "a0af7dcbb5c83f6f3f7ecd507c2d352c1a018f894d51ad241ce8492fa598010f"
+ sha256 cellar: :any_skip_relocation, big_sur: "a0af7dcbb5c83f6f3f7ecd507c2d352c1a018f894d51ad241ce8492fa598010f"
+ sha256 cellar: :any_skip_relocation, catalina: "5334dd344986e46b2aa4f0471cac7b0914bd7de7cb890a34415771788d03f2ac"
+ end
+
+ def install
+ (prefix/"foo"/"test").write("test") if build.with? "foo"
+ prefix.install Dir["*"]
+ (buildpath/"test.c").write \
+ "#include <stdio.h>\\nint main(){printf(\\"test\\");return 0;}"
+ bin.mkpath
+ system ENV.cc, "test.c", "-o", bin/"test"
+ end
+
+
+
+ # something here
+
+ end
+ EOS
+ end
+
+ it "replaces the bottle block in a formula that already has a bottle block" do
+ core_tap.path.cd do
+ system "git", "init"
+ setup_test_formula "testball", bottle_block: <<~EOS
+
+ bottle do
+ root_url "#{HOMEBREW_BOTTLE_DEFAULT_DOMAIN}"
+ sha256 cellar: :any_skip_relocation, big_sur: "6b276491297d4052538bd2fd22d5129389f27d90a98f831987236a5b90511b98"
+ sha256 cellar: :any_skip_relocation, catalina: "16cf230afdfcb6306c208d169549cf8773c831c8653d2c852315a048960d7e72"
+ end
+ EOS
+ system "git", "add", "--all"
+ system "git", "commit", "-m", "testball 0.1"
+ end
+
+ expect {
+ brew "bottle",
+ "--merge",
+ "--write",
+ "#{TEST_TMPDIR}/testball-1.0.big_sur.bottle.json",
+ "#{TEST_TMPDIR}/testball-1.0.catalina.bottle.json"
+ }.to output(<<~EOS).to_stdout
+ ==> testball
+ bottle do
+ root_url "#{HOMEBREW_BOTTLE_DEFAULT_DOMAIN}"
+ sha256 cellar: :any_skip_relocation, big_sur: "a0af7dcbb5c83f6f3f7ecd507c2d352c1a018f894d51ad241ce8492fa598010f"
+ sha256 cellar: :any_skip_relocation, catalina: "5334dd344986e46b2aa4f0471cac7b0914bd7de7cb890a34415771788d03f2ac"
+ end
+ EOS
+
+ expect((core_tap.path/"Formula/testball.rb").read).to eq <<~EOS
+ class Testball < Formula
+ desc "Some test"
+ homepage "https://brew.sh/testball"
+ url "file://#{tarball}"
+ sha256 "#{tarball.sha256}"
+
+ option "with-foo", "Build with foo"
+
+ bottle do
+ root_url "#{HOMEBREW_BOTTLE_DEFAULT_DOMAIN}"
+ sha256 cellar: :any_skip_relocation, big_sur: "a0af7dcbb5c83f6f3f7ecd507c2d352c1a018f894d51ad241ce8492fa598010f"
sha256 cellar: :any_skip_relocation, catalina: "5334dd344986e46b2aa4f0471cac7b0914bd7de7cb890a34415771788d03f2ac"
end
@@ -214,7 +276,7 @@ def install
}.to output("Error: `--keep-old` was passed but there was no existing bottle block!\n").to_stderr
end
- it "updates the bottle block in a formula that already has a bottle block when using --keep-old" do
+ it "updates the bottle block in a formula that already has a bottle block (old format) when using --keep-old" do
core_tap.path.cd do
system "git", "init"
setup_test_formula "testball", bottle_block: <<~EOS
@@ -240,9 +302,9 @@ def install
==> testball
bottle do
root_url "#{HOMEBREW_BOTTLE_DEFAULT_DOMAIN}"
- sha256 cellar: :any_skip_relocation, big_sur: "a0af7dcbb5c83f6f3f7ecd507c2d352c1a018f894d51ad241ce8492fa598010f"
- sha256 cellar: :any_skip_relocation, catalina: "5334dd344986e46b2aa4f0471cac7b0914bd7de7cb890a34415771788d03f2ac"
- sha256 cellar: :any, high_sierra: "6971b6eebf4c00eaaed72a1104a49be63861eabc95d679a0c84040398e320059"
+ sha256 cellar: :any_skip_relocation, big_sur: "a0af7dcbb5c83f6f3f7ecd507c2d352c1a018f894d51ad241ce8492fa598010f"
+ sha256 cellar: :any_skip_relocation, catalina: "5334dd344986e46b2aa4f0471cac7b0914bd7de7cb890a34415771788d03f2ac"
+ sha256 cellar: :any, high_sierra: "6971b6eebf4c00eaaed72a1104a49be63861eabc95d679a0c84040398e320059"
end
EOS
@@ -257,10 +319,74 @@ class Testball < Formula
bottle do
root_url "#{HOMEBREW_BOTTLE_DEFAULT_DOMAIN}"
- sha256 cellar: :any_skip_relocation, big_sur: "a0af7dcbb5c83f6f3f7ecd507c2d352c1a018f894d51ad241ce8492fa598010f"
- sha256 cellar: :any_skip_relocation, catalina: "5334dd344986e46b2aa4f0471cac7b0914bd7de7cb890a34415771788d03f2ac"
+ sha256 cellar: :any_skip_relocation, big_sur: "a0af7dcbb5c83f6f3f7ecd507c2d352c1a018f894d51ad241ce8492fa598010f"
+ sha256 cellar: :any_skip_relocation, catalina: "5334dd344986e46b2aa4f0471cac7b0914bd7de7cb890a34415771788d03f2ac"
+ sha256 cellar: :any, high_sierra: "6971b6eebf4c00eaaed72a1104a49be63861eabc95d679a0c84040398e320059"
+ end
+
+ def install
+ (prefix/"foo"/"test").write("test") if build.with? "foo"
+ prefix.install Dir["*"]
+ (buildpath/"test.c").write \
+ "#include <stdio.h>\\nint main(){printf(\\"test\\");return 0;}"
+ bin.mkpath
+ system ENV.cc, "test.c", "-o", bin/"test"
+ end
+
+
+
+ # something here
+
+ end
+ EOS
+ end
+
+ it "updates the bottle block in a formula that already has a bottle block when using --keep-old" do
+ core_tap.path.cd do
+ system "git", "init"
+ setup_test_formula "testball", bottle_block: <<~EOS
+
+ bottle do
+ root_url "#{HOMEBREW_BOTTLE_DEFAULT_DOMAIN}"
sha256 cellar: :any, high_sierra: "6971b6eebf4c00eaaed72a1104a49be63861eabc95d679a0c84040398e320059"
end
+ EOS
+ system "git", "add", "--all"
+ system "git", "commit", "-m", "testball 0.1"
+ end
+
+ expect {
+ brew "bottle",
+ "--merge",
+ "--write",
+ "--keep-old",
+ "#{TEST_TMPDIR}/testball-1.0.big_sur.bottle.json",
+ "#{TEST_TMPDIR}/testball-1.0.catalina.bottle.json"
+ }.to output(<<~EOS).to_stdout
+ ==> testball
+ bottle do
+ root_url "#{HOMEBREW_BOTTLE_DEFAULT_DOMAIN}"
+ sha256 cellar: :any_skip_relocation, big_sur: "a0af7dcbb5c83f6f3f7ecd507c2d352c1a018f894d51ad241ce8492fa598010f"
+ sha256 cellar: :any_skip_relocation, catalina: "5334dd344986e46b2aa4f0471cac7b0914bd7de7cb890a34415771788d03f2ac"
+ sha256 cellar: :any, high_sierra: "6971b6eebf4c00eaaed72a1104a49be63861eabc95d679a0c84040398e320059"
+ end
+ EOS
+
+ expect((core_tap.path/"Formula/testball.rb").read).to eq <<~EOS
+ class Testball < Formula
+ desc "Some test"
+ homepage "https://brew.sh/testball"
+ url "file://#{tarball}"
+ sha256 "#{tarball.sha256}"
+
+ option "with-foo", "Build with foo"
+
+ bottle do
+ root_url "#{HOMEBREW_BOTTLE_DEFAULT_DOMAIN}"
+ sha256 cellar: :any_skip_relocation, big_sur: "a0af7dcbb5c83f6f3f7ecd507c2d352c1a018f894d51ad241ce8492fa598010f"
+ sha256 cellar: :any_skip_relocation, catalina: "5334dd344986e46b2aa4f0471cac7b0914bd7de7cb890a34415771788d03f2ac"
+ sha256 cellar: :any, high_sierra: "6971b6eebf4c00eaaed72a1104a49be63861eabc95d679a0c84040398e320059"
+ end
def install
(prefix/"foo"/"test").write("test") if build.with? "foo"
@@ -438,36 +564,70 @@ def install
describe "::generate_sha256_line" do
it "generates a string without cellar" do
- expect(homebrew.generate_sha256_line(:catalina, "deadbeef", nil)).to eq(
+ expect(homebrew.generate_sha256_line(:catalina, "deadbeef", nil, 0, 10)).to eq(
<<~RUBY.chomp,
sha256 catalina: "deadbeef"
RUBY
)
end
it "generates a string with cellar symbol" do
- expect(homebrew.generate_sha256_line(:catalina, "deadbeef", :any)).to eq(
+ expect(homebrew.generate_sha256_line(:catalina, "deadbeef", :any, 14, 24)).to eq(
<<~RUBY.chomp,
sha256 cellar: :any, catalina: "deadbeef"
RUBY
)
end
it "generates a string with default cellar path" do
- expect(homebrew.generate_sha256_line(:catalina, "deadbeef", Homebrew::DEFAULT_LINUX_CELLAR)).to eq(
+ expect(homebrew.generate_sha256_line(:catalina, "deadbeef", Homebrew::DEFAULT_LINUX_CELLAR, 0, 10)).to eq(
<<~RUBY.chomp,
sha256 catalina: "deadbeef"
RUBY
)
end
it "generates a string with non-default cellar path" do
- expect(homebrew.generate_sha256_line(:catalina, "deadbeef", "/home/test")).to eq(
+ expect(homebrew.generate_sha256_line(:catalina, "deadbeef", "/home/test", 22, 32)).to eq(
<<~RUBY.chomp,
sha256 cellar: "/home/test", catalina: "deadbeef"
RUBY
)
end
+
+ context "with offsets" do
+ it "generates a string without cellar" do
+ expect(homebrew.generate_sha256_line(:catalina, "deadbeef", nil, 0, 15)).to eq(
+ <<~RUBY.chomp,
+ sha256 catalina: "deadbeef"
+ RUBY
+ )
+ end
+
+ it "generates a string with cellar symbol" do
+ expect(homebrew.generate_sha256_line(:catalina, "deadbeef", :any, 20, 35)).to eq(
+ <<~RUBY.chomp,
+ sha256 cellar: :any, catalina: "deadbeef"
+ RUBY
+ )
+ end
+
+ it "generates a string with default cellar path" do
+ expect(homebrew.generate_sha256_line(:catalina, "deadbeef", Homebrew::DEFAULT_LINUX_CELLAR, 14, 30)).to eq(
+ <<~RUBY.chomp,
+ sha256 catalina: "deadbeef"
+ RUBY
+ )
+ end
+
+ it "generates a string with non-default cellar path" do
+ expect(homebrew.generate_sha256_line(:catalina, "deadbeef", "/home/test", 25, 36)).to eq(
+ <<~RUBY.chomp,
+ sha256 cellar: "/home/test", catalina: "deadbeef"
+ RUBY
+ )
+ end
+ end
end
end
end | true |
Other | Homebrew | brew | dee57c307d75bc8cd920bcd1fb9bd55cf75e9a48.json | style: allow long lines for bottle digests | Library/.rubocop.yml | @@ -356,6 +356,7 @@ Layout/LineLength:
' pkg "',
' pkgutil: "',
" sha256 cellar: ",
+ " sha256 ",
"#{language}",
"#{version.",
' "/Library/Application Support/', | false |
Other | Homebrew | brew | 440803e98bf27e01a5669b5c7e1d0e3c5f0a6b7d.json | Update RBI files for rubocop-rspec. | Library/Homebrew/sorbet/rbi/gems/rubocop-rspec@2.2.0.rbi | @@ -82,12 +82,13 @@ end
RuboCop::Cop::RSpec::AlignRightLetBrace::MSG = T.let(T.unsafe(nil), String)
class RuboCop::Cop::RSpec::AnyInstance < ::RuboCop::Cop::RSpec::Base
- def disallowed_stub(param0 = T.unsafe(nil)); end
def on_send(node); end
end
RuboCop::Cop::RSpec::AnyInstance::MSG = T.let(T.unsafe(nil), String)
+RuboCop::Cop::RSpec::AnyInstance::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
+
class RuboCop::Cop::RSpec::AroundBlock < ::RuboCop::Cop::RSpec::Base
def find_arg_usage(param0); end
def hook(param0 = T.unsafe(nil)); end
@@ -130,13 +131,17 @@ end
RuboCop::Cop::RSpec::BeEql::MSG = T.let(T.unsafe(nil), String)
+RuboCop::Cop::RSpec::BeEql::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
+
class RuboCop::Cop::RSpec::BeforeAfterAll < ::RuboCop::Cop::RSpec::Base
def before_or_after_all(param0 = T.unsafe(nil)); end
def on_send(node); end
end
RuboCop::Cop::RSpec::BeforeAfterAll::MSG = T.let(T.unsafe(nil), String)
+RuboCop::Cop::RSpec::BeforeAfterAll::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
+
module RuboCop::Cop::RSpec::Capybara
end
@@ -158,6 +163,8 @@ end
RuboCop::Cop::RSpec::Capybara::CurrentPathExpectation::MSG = T.let(T.unsafe(nil), String)
+RuboCop::Cop::RSpec::Capybara::CurrentPathExpectation::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
+
class RuboCop::Cop::RSpec::Capybara::FeatureMethods < ::RuboCop::Cop::RSpec::Base
extend(::RuboCop::Cop::AutoCorrector)
@@ -196,6 +203,18 @@ RuboCop::Cop::RSpec::Capybara::VisibilityMatcher::MSG_FALSE = T.let(T.unsafe(nil
RuboCop::Cop::RSpec::Capybara::VisibilityMatcher::MSG_TRUE = T.let(T.unsafe(nil), String)
+RuboCop::Cop::RSpec::Capybara::VisibilityMatcher::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
+
+module RuboCop::Cop::RSpec::CommentsHelp
+ include(::RuboCop::Cop::RSpec::FinalEndLocation)
+
+ def begin_pos_with_comment(node); end
+ def buffer; end
+ def end_line_position(node); end
+ def source_range_with_comment(node); end
+ def start_line_position(node); end
+end
+
class RuboCop::Cop::RSpec::ContextMethod < ::RuboCop::Cop::RSpec::Base
extend(::RuboCop::Cop::AutoCorrector)
@@ -255,6 +274,8 @@ end
RuboCop::Cop::RSpec::DescribeSymbol::MSG = T.let(T.unsafe(nil), String)
+RuboCop::Cop::RSpec::DescribeSymbol::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
+
class RuboCop::Cop::RSpec::DescribedClass < ::RuboCop::Cop::RSpec::Base
include(::RuboCop::Cop::ConfigurableEnforcedStyle)
extend(::RuboCop::Cop::AutoCorrector)
@@ -405,7 +426,6 @@ module RuboCop::Cop::RSpec::EmptyLineSeparation
end
class RuboCop::Cop::RSpec::ExampleLength < ::RuboCop::Cop::RSpec::Base
- include(::RuboCop::Cop::ConfigurableMax)
include(::RuboCop::Cop::CodeLength)
def on_block(node); end
@@ -494,6 +514,8 @@ RuboCop::Cop::RSpec::ExpectChange::MSG_BLOCK = T.let(T.unsafe(nil), String)
RuboCop::Cop::RSpec::ExpectChange::MSG_CALL = T.let(T.unsafe(nil), String)
+RuboCop::Cop::RSpec::ExpectChange::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
+
class RuboCop::Cop::RSpec::ExpectInHook < ::RuboCop::Cop::RSpec::Base
def expectation(param0); end
def on_block(node); end
@@ -611,6 +633,8 @@ RuboCop::Cop::RSpec::FactoryBot::CreateList::MSG_CREATE_LIST = T.let(T.unsafe(ni
RuboCop::Cop::RSpec::FactoryBot::CreateList::MSG_N_TIMES = T.let(T.unsafe(nil), String)
+RuboCop::Cop::RSpec::FactoryBot::CreateList::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
+
class RuboCop::Cop::RSpec::FactoryBot::CreateList::TimesCorrector
include(::RuboCop::Cop::RSpec::FactoryBot::CreateList::Corrector)
@@ -639,6 +663,8 @@ RuboCop::Cop::RSpec::FactoryBot::FactoryClassName::ALLOWED_CONSTANTS = T.let(T.u
RuboCop::Cop::RSpec::FactoryBot::FactoryClassName::MSG = T.let(T.unsafe(nil), String)
+RuboCop::Cop::RSpec::FactoryBot::FactoryClassName::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
+
class RuboCop::Cop::RSpec::FilePath < ::RuboCop::Cop::RSpec::Base
include(::RuboCop::Cop::RSpec::TopLevelGroup)
@@ -738,6 +764,8 @@ end
RuboCop::Cop::RSpec::ImplicitBlockExpectation::MSG = T.let(T.unsafe(nil), String)
+RuboCop::Cop::RSpec::ImplicitBlockExpectation::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
+
class RuboCop::Cop::RSpec::ImplicitExpect < ::RuboCop::Cop::RSpec::Base
include(::RuboCop::Cop::ConfigurableEnforcedStyle)
extend(::RuboCop::Cop::AutoCorrector)
@@ -773,6 +801,8 @@ end
RuboCop::Cop::RSpec::ImplicitSubject::MSG = T.let(T.unsafe(nil), String)
+RuboCop::Cop::RSpec::ImplicitSubject::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
+
module RuboCop::Cop::RSpec::InflectedHelper
include(::RuboCop::RSpec::Language)
extend(::RuboCop::AST::NodePattern::Macros)
@@ -840,6 +870,8 @@ end
RuboCop::Cop::RSpec::ItBehavesLike::MSG = T.let(T.unsafe(nil), String)
+RuboCop::Cop::RSpec::ItBehavesLike::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
+
class RuboCop::Cop::RSpec::IteratedExpectation < ::RuboCop::Cop::RSpec::Base
def each?(param0 = T.unsafe(nil)); end
def expectation?(param0 = T.unsafe(nil), param1); end
@@ -917,12 +949,13 @@ end
RuboCop::Cop::RSpec::LetSetup::MSG = T.let(T.unsafe(nil), String)
class RuboCop::Cop::RSpec::MessageChain < ::RuboCop::Cop::RSpec::Base
- def message_chain(param0 = T.unsafe(nil)); end
def on_send(node); end
end
RuboCop::Cop::RSpec::MessageChain::MSG = T.let(T.unsafe(nil), String)
+RuboCop::Cop::RSpec::MessageChain::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
+
class RuboCop::Cop::RSpec::MessageExpectation < ::RuboCop::Cop::RSpec::Base
include(::RuboCop::Cop::ConfigurableEnforcedStyle)
@@ -937,6 +970,8 @@ end
RuboCop::Cop::RSpec::MessageExpectation::MSG = T.let(T.unsafe(nil), String)
+RuboCop::Cop::RSpec::MessageExpectation::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
+
RuboCop::Cop::RSpec::MessageExpectation::SUPPORTED_STYLES = T.let(T.unsafe(nil), Array)
class RuboCop::Cop::RSpec::MessageSpies < ::RuboCop::Cop::RSpec::Base
@@ -1075,6 +1110,8 @@ end
RuboCop::Cop::RSpec::NotToNot::MSG = T.let(T.unsafe(nil), String)
+RuboCop::Cop::RSpec::NotToNot::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
+
class RuboCop::Cop::RSpec::OverwritingSetup < ::RuboCop::Cop::RSpec::Base
def first_argument_name(param0 = T.unsafe(nil)); end
def on_block(node); end
@@ -1151,6 +1188,8 @@ RuboCop::Cop::RSpec::Rails::HttpStatus::NumericStyleChecker::ALLOWED_STATUSES =
RuboCop::Cop::RSpec::Rails::HttpStatus::NumericStyleChecker::MSG = T.let(T.unsafe(nil), String)
+RuboCop::Cop::RSpec::Rails::HttpStatus::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
+
class RuboCop::Cop::RSpec::Rails::HttpStatus::SymbolicStyleChecker
def initialize(node); end
@@ -1185,6 +1224,8 @@ end
RuboCop::Cop::RSpec::ReceiveCounts::MSG = T.let(T.unsafe(nil), String)
+RuboCop::Cop::RSpec::ReceiveCounts::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
+
class RuboCop::Cop::RSpec::ReceiveNever < ::RuboCop::Cop::RSpec::Base
extend(::RuboCop::Cop::AutoCorrector)
@@ -1198,6 +1239,8 @@ end
RuboCop::Cop::RSpec::ReceiveNever::MSG = T.let(T.unsafe(nil), String)
+RuboCop::Cop::RSpec::ReceiveNever::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
+
class RuboCop::Cop::RSpec::RepeatedDescription < ::RuboCop::Cop::RSpec::Base
def on_block(node); end
@@ -1323,6 +1366,8 @@ RuboCop::Cop::RSpec::ReturnFromStub::MSG_AND_RETURN = T.let(T.unsafe(nil), Strin
RuboCop::Cop::RSpec::ReturnFromStub::MSG_BLOCK = T.let(T.unsafe(nil), String)
+RuboCop::Cop::RSpec::ReturnFromStub::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
+
class RuboCop::Cop::RSpec::ScatteredLet < ::RuboCop::Cop::RSpec::Base
extend(::RuboCop::Cop::AutoCorrector)
@@ -1405,6 +1450,8 @@ end
RuboCop::Cop::RSpec::SingleArgumentMessageChain::MSG = T.let(T.unsafe(nil), String)
+RuboCop::Cop::RSpec::SingleArgumentMessageChain::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
+
class RuboCop::Cop::RSpec::StubbedMock < ::RuboCop::Cop::RSpec::Base
def configured_response?(param0 = T.unsafe(nil)); end
def expectation(param0 = T.unsafe(nil)); end
@@ -1464,6 +1511,8 @@ end
RuboCop::Cop::RSpec::UnspecifiedException::MSG = T.let(T.unsafe(nil), String)
+RuboCop::Cop::RSpec::UnspecifiedException::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
+
module RuboCop::Cop::RSpec::Variable
extend(::RuboCop::AST::NodePattern::Macros)
@@ -1516,6 +1565,8 @@ end
RuboCop::Cop::RSpec::VerifiedDoubles::MSG = T.let(T.unsafe(nil), String)
+RuboCop::Cop::RSpec::VerifiedDoubles::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
+
class RuboCop::Cop::RSpec::VoidExpect < ::RuboCop::Cop::RSpec::Base
def expect?(param0 = T.unsafe(nil)); end
def expect_block?(param0 = T.unsafe(nil)); end
@@ -1530,6 +1581,8 @@ end
RuboCop::Cop::RSpec::VoidExpect::MSG = T.let(T.unsafe(nil), String)
+RuboCop::Cop::RSpec::VoidExpect::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
+
class RuboCop::Cop::RSpec::Yield < ::RuboCop::Cop::RSpec::Base
include(::RuboCop::Cop::RangeHelp)
extend(::RuboCop::Cop::AutoCorrector)
@@ -1599,6 +1652,7 @@ end
class RuboCop::RSpec::Corrector::MoveNode
include(::RuboCop::Cop::RangeHelp)
include(::RuboCop::Cop::RSpec::FinalEndLocation)
+ include(::RuboCop::Cop::RSpec::CommentsHelp)
def initialize(node, corrector, processed_source); end
| false |
Other | Homebrew | brew | 9f7d0d1fb9cb2a01a4bb44582f1f418dccbdf750.json | Update RBI files for sorbet. | 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
@@ -2825,99 +2809,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
@@ -3048,13 +2945,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
@@ -5675,15 +5565,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
@@ -7126,6 +7007,8 @@ end
class Errno::EBADRPC
end
+Errno::ECAPMODE = Errno::NOERROR
+
Errno::EDEADLOCK = Errno::NOERROR
class Errno::EDEVERR
@@ -7146,6 +7029,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
@@ -7167,6 +7057,8 @@ end
class Errno::ENOPOLICY
end
+Errno::ENOTCAPABLE = Errno::NOERROR
+
class Errno::ENOTSUP
Errno = ::T.let(nil, ::T.untyped)
end
@@ -7209,12 +7101,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)
@@ -8350,14 +8237,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
@@ -9714,13 +9593,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
@@ -12030,8 +11907,6 @@ class Module
def anonymous?(); end
- def autoload_without_bootsnap(_, _1); end
-
def context(*a, &b); end
def deprecate(*method_names); end
@@ -12386,9 +12261,13 @@ end
Net::HTTPFatalErrorCode = Net::HTTPClientError
-Net::HTTPInformation::EXCEPTION_TYPE = Net::HTTPError
+class Net::HTTPInformation
+end
+
+Net::HTTPInformationCode::EXCEPTION_TYPE = Net::HTTPError
-Net::HTTPInformationCode = Net::HTTPInformation
+class Net::HTTPInformation
+end
class Net::HTTPLoopDetected
HAS_BODY = ::T.let(nil, ::T.untyped)
@@ -12452,9 +12331,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)
@@ -12624,7 +12507,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)
@@ -12689,8 +12571,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)
@@ -12743,7 +12623,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
@@ -12752,20 +12636,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
@@ -17274,7 +17167,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
@@ -28044,10 +27936,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
@@ -28937,7 +28825,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)
@@ -29029,7 +28916,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) | false |
Other | Homebrew | brew | 23701543ae1bb5d4044b874b00dbbe0fff799e33.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
@@ -2825,99 +2809,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
@@ -3048,13 +2945,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
@@ -5675,15 +5565,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
@@ -7126,6 +7007,8 @@ end
class Errno::EBADRPC
end
+Errno::ECAPMODE = Errno::NOERROR
+
Errno::EDEADLOCK = Errno::NOERROR
class Errno::EDEVERR
@@ -7146,6 +7029,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
@@ -7167,6 +7057,8 @@ end
class Errno::ENOPOLICY
end
+Errno::ENOTCAPABLE = Errno::NOERROR
+
class Errno::ENOTSUP
Errno = ::T.let(nil, ::T.untyped)
end
@@ -7209,12 +7101,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)
@@ -8350,14 +8237,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
@@ -9714,13 +9593,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
@@ -12030,8 +11907,6 @@ class Module
def anonymous?(); end
- def autoload_without_bootsnap(_, _1); end
-
def context(*a, &b); end
def deprecate(*method_names); end
@@ -12386,9 +12261,13 @@ end
Net::HTTPFatalErrorCode = Net::HTTPClientError
-Net::HTTPInformation::EXCEPTION_TYPE = Net::HTTPError
+class Net::HTTPInformation
+end
+
+Net::HTTPInformationCode::EXCEPTION_TYPE = Net::HTTPError
-Net::HTTPInformationCode = Net::HTTPInformation
+class Net::HTTPInformation
+end
class Net::HTTPLoopDetected
HAS_BODY = ::T.let(nil, ::T.untyped)
@@ -12452,9 +12331,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)
@@ -12624,7 +12507,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)
@@ -12689,8 +12571,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)
@@ -12743,7 +12623,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
@@ -12752,20 +12636,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
@@ -17274,7 +17167,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
@@ -28044,10 +27936,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
@@ -28937,7 +28825,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)
@@ -29029,7 +28916,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) | false |
Other | Homebrew | brew | f15681ccd9ae827551906c51c88bf64dd6634333.json | utils/github: fix false positive API credential error | Library/Homebrew/utils/github.rb | @@ -150,13 +150,11 @@ def api_credentials_error_message(response_headers, needed_scopes)
return if response_headers.empty?
scopes = response_headers["x-accepted-oauth-scopes"].to_s.split(", ")
- return if scopes.present?
-
- needed_human_scopes = needed_scopes.join(", ")
+ needed_scopes = Set.new(scopes || needed_scopes)
credentials_scopes = response_headers["x-oauth-scopes"]
- return if needed_human_scopes.blank? && credentials_scopes.blank?
+ return if needed_scopes.subset?(Set.new(credentials_scopes.to_s.split(", ")))
- needed_human_scopes = "none" if needed_human_scopes.blank?
+ needed_scopes = needed_scopes.to_a.join(", ").presence || "none"
credentials_scopes = "none" if credentials_scopes.blank?
what = case api_credentials_type
@@ -168,7 +166,7 @@ def api_credentials_error_message(response_headers, needed_scopes)
@api_credentials_error_message ||= onoe <<~EOS
Your #{what} credentials do not have sufficient scope!
- Scopes required: #{needed_human_scopes}
+ Scopes required: #{needed_scopes}
Scopes present: #{credentials_scopes}
Create a personal access token:
#{ALL_SCOPES_URL} | false |
Other | Homebrew | brew | 7dd69d2c94ed801285a164439f3fcbf17a2a6894.json | cmd/--prefix: ignore shared-mime-info and mactex
The shared-mime-info formula and the mactex cask currently install into
locations that are picked up by `brew --prefix --unbrewed`. This leads
to a very large number of files being found.
Before:
```
❯ brew --prefix --unbrewed | wc -l
206735
```
After
```
❯ brew --prefix --unbrewed | wc -l
3
``` | Library/Homebrew/cmd/--prefix.rb | @@ -88,6 +88,8 @@ def __prefix
share/pypy3/*
share/info/dir
share/man/whatis
+ share/mime/*
+ texlive/*
].freeze
def list_unbrewed | false |
Other | Homebrew | brew | b670ab1c7b1bf3a2edecbbe0e12f8ab5b86732af.json | Deprecate additional arch functions | Library/Homebrew/hardware.rb | @@ -80,6 +80,8 @@ def arch
end
def universal_archs
+ odeprecated "Hardware::CPU.universal_archs"
+
[arch].extend ArchitectureListExtension
end
| true |
Other | Homebrew | brew | b670ab1c7b1bf3a2edecbbe0e12f8ab5b86732af.json | Deprecate additional arch functions | Library/Homebrew/os/mac/architecture_list.rb | @@ -1,6 +1,8 @@
# typed: false
# frozen_string_literal: true
+# TODO: (3.2) remove this module when the linked deprecated functions are removed.
+
require "hardware"
module ArchitectureListExtension | true |
Other | Homebrew | brew | b670ab1c7b1bf3a2edecbbe0e12f8ab5b86732af.json | Deprecate additional arch functions | Library/Homebrew/os/mac/mach.rb | @@ -67,6 +67,7 @@ def dynamically_linked_libraries(except: :none)
end
def archs
+ # TODO: (3.2) remove ArchitectureListExtension
mach_data.map { |m| m.fetch :arch }.extend(ArchitectureListExtension)
end
| true |
Other | Homebrew | brew | b670ab1c7b1bf3a2edecbbe0e12f8ab5b86732af.json | Deprecate additional arch functions | Library/Homebrew/utils.rb | @@ -384,6 +384,8 @@ def gzip(*paths)
# Returns array of architectures that the given command or library is built for.
def archs_for_command(cmd)
+ odeprecated "archs_for_command"
+
cmd = which(cmd) unless Pathname.new(cmd).absolute?
Pathname.new(cmd).archs
end | true |
Other | Homebrew | brew | d0fa752c690907bcc778553d8efe466f702390d6.json | env_config: update HOMEBREW_BOOTSNAP description.
Note that it is a no-op when using portable ruby. | Library/Homebrew/env_config.rb | @@ -40,7 +40,8 @@ module EnvConfig
description: "Use this username when accessing the Bintray API (where bottles are stored).",
},
HOMEBREW_BOOTSNAP: {
- description: "If set, use Bootsnap to speed up repeated `brew` calls.",
+ description: "If set, use Bootsnap to speed up repeated `brew` calls. "\
+ "A no-op when using Homebrew's vendored, relocatable Ruby on macOS (as it doesn't work).",
boolean: true,
},
HOMEBREW_BOTTLE_DOMAIN: { | true |
Other | Homebrew | brew | d0fa752c690907bcc778553d8efe466f702390d6.json | env_config: update HOMEBREW_BOOTSNAP description.
Note that it is a no-op when using portable ruby. | docs/Manpage.md | @@ -1708,7 +1708,7 @@ example, run `export HOMEBREW_NO_INSECURE_REDIRECT=1` rather than just
<br>Use this username when accessing the Bintray API (where bottles are stored).
- `HOMEBREW_BOOTSNAP`
- <br>If set, use Bootsnap to speed up repeated `brew` calls.
+ <br>If set, use Bootsnap to speed up repeated `brew` calls. A no-op when using Homebrew's vendored, relocatable Ruby on macOS (as it doesn't work).
- `HOMEBREW_BOTTLE_DOMAIN`
<br>Use this URL as the download mirror for bottles. For example, `HOMEBREW_BOTTLE_DOMAIN=http://localhost:8080` will cause all bottles to download from the prefix `http://localhost:8080/`. | true |
Other | Homebrew | brew | d0fa752c690907bcc778553d8efe466f702390d6.json | env_config: update HOMEBREW_BOOTSNAP description.
Note that it is a no-op when using portable ruby. | manpages/brew.1 | @@ -2379,7 +2379,7 @@ Use this username when accessing the Bintray API (where bottles are stored)\.
\fBHOMEBREW_BOOTSNAP\fR
.
.br
-If set, use Bootsnap to speed up repeated \fBbrew\fR calls\.
+If set, use Bootsnap to speed up repeated \fBbrew\fR calls\. A no\-op when using Homebrew\'s vendored, relocatable Ruby on macOS (as it doesn\'t work)\.
.
.TP
\fBHOMEBREW_BOTTLE_DOMAIN\fR | true |
Other | Homebrew | brew | d3507d9899e94c5371e8172162cc5082b242aec8.json | test/language/java_spec: test both Mac and Linux | Library/Homebrew/test/language/java_spec.rb | @@ -11,55 +11,53 @@
end
end
+ let(:expected_home) do
+ if OS.mac?
+ f.opt_libexec/"openjdk.jdk/Contents/Home"
+ else
+ f.opt_libexec
+ end
+ end
+
before do
allow(Formula).to receive(:[]).and_return(f)
allow(f).to receive(:any_version_installed?).and_return(true)
allow(f).to receive(:any_installed_version).and_return(f.version)
end
describe "::java_home" do
- it "returns valid JAVA_HOME if version is specified", :needs_macos do
- java_home = described_class.java_home("1.8+")
- expect(java_home).to eql(f.opt_libexec/"openjdk.jdk/Contents/Home")
- end
-
- it "returns valid JAVA_HOME if version is not specified", :needs_macos do
- java_home = described_class.java_home
- expect(java_home).to eql(f.opt_libexec/"openjdk.jdk/Contents/Home")
- end
-
- it "returns valid JAVA_HOME if version is specified", :needs_linux do
+ it "returns valid JAVA_HOME if version is specified" do
java_home = described_class.java_home("1.8+")
- expect(java_home).to eql(f.opt_libexec)
+ expect(java_home).to eql(expected_home)
end
- it "returns valid JAVA_HOME if version is not specified", :needs_linux do
+ it "returns valid JAVA_HOME if version is not specified" do
java_home = described_class.java_home
- expect(java_home).to eql(f.opt_libexec)
+ expect(java_home).to eql(expected_home)
end
end
describe "::java_home_env" do
it "returns java_home path if version specified" do
java_home_env = described_class.java_home_env("1.8+")
- expect(java_home_env[:JAVA_HOME]).to include(f.opt_libexec.to_s)
+ expect(java_home_env[:JAVA_HOME]).to eql(expected_home.to_s)
end
it "returns java_home path if version is not specified" do
java_home_env = described_class.java_home_env
- expect(java_home_env[:JAVA_HOME]).to include(f.opt_libexec.to_s)
+ expect(java_home_env[:JAVA_HOME]).to eql(expected_home.to_s)
end
end
describe "::overridable_java_home_env" do
it "returns java_home path if version specified" do
overridable_java_home_env = described_class.overridable_java_home_env("1.8+")
- expect(overridable_java_home_env[:JAVA_HOME]).to include(f.opt_libexec.to_s)
+ expect(overridable_java_home_env[:JAVA_HOME]).to eql("${JAVA_HOME:-#{expected_home}}")
end
it "returns java_home path if version is not specified" do
overridable_java_home_env = described_class.overridable_java_home_env
- expect(overridable_java_home_env[:JAVA_HOME]).to include(f.opt_libexec.to_s)
+ expect(overridable_java_home_env[:JAVA_HOME]).to eql("${JAVA_HOME:-#{expected_home}}")
end
end
end | false |
Other | Homebrew | brew | 240d2c34fb72a642a6163fa163bfd0b971761574.json | utils/fork: fix bootsnap handling.
Also, while we're here:
- remove unused block argument
- remove unneeded RuboCop disable comment | Library/Homebrew/utils/fork.rb | @@ -29,12 +29,15 @@ def self.rewrite_child_error(child_error)
error
end
- def self.safe_fork(&_block)
+ def self.safe_fork
Dir.mktmpdir("homebrew", HOMEBREW_TEMP) do |tmpdir|
UNIXServer.open("#{tmpdir}/socket") do |server|
read, write = IO.pipe
pid = fork do
+ # bootsnap doesn't like these forked processes
+ ENV["HOMEBREW_NO_BOOTSNAP"] = "1"
+
ENV["HOMEBREW_ERROR_PIPE"] = server.path
server.close
read.close
@@ -56,7 +59,7 @@ def self.safe_fork(&_block)
write.close
exit!
- else # rubocop:disable Layout/ElseAlignment
+ else
exit!(true)
end
| false |
Other | Homebrew | brew | b33a24feb0e29986345bec56db0c5f56eacfac56.json | homebrew_bootsnap: remove deprecated option.
Otherwise this prints a warning. | Library/Homebrew/homebrew_bootsnap.rb | @@ -27,10 +27,9 @@
raise "Needs HOMEBREW_TEMP or HOMEBREW_DEFAULT_TEMP!" unless tmp
Bootsnap.setup(
- cache_dir: "#{tmp}/homebrew-bootsnap",
- development_mode: false, # TODO: use ENV["HOMEBREW_DEVELOPER"]?,
- load_path_cache: true,
- autoload_paths_cache: true,
- compile_cache_iseq: true,
- compile_cache_yaml: true,
+ cache_dir: "#{tmp}/homebrew-bootsnap",
+ development_mode: false, # TODO: use ENV["HOMEBREW_DEVELOPER"]?,
+ load_path_cache: true,
+ compile_cache_iseq: true,
+ compile_cache_yaml: true,
) | false |
Other | Homebrew | brew | 26755632a93f35ef338b927beccfe1101c802b42.json | rubocop.yml: restore buggy 1.9.0 cops. | Library/.rubocop.yml | @@ -54,12 +54,6 @@ FormulaAudit:
FormulaAuditStrict:
Enabled: true
-# TODO: try to re-enable in RuboCop >=1.9.1
-Lint/SymbolConversion:
- Enabled: false
-Style/EvalWithLocation:
- Enabled: false
-
# makes DSL usage ugly.
Layout/SpaceBeforeBrackets:
Exclude:
@@ -212,8 +206,7 @@ Rails/TimeZone:
# Don't allow cops to be disabled in casks and formulae.
Style/DisableCopsWithinSourceCodeDirective:
- # TODO: try to re-enable in RuboCop >=1.9.1
- Enabled: false
+ Enabled: true
Include:
- "Taps/*/*/*.rb"
- "/**/{Formula,Casks}/*.rb" | false |
Other | Homebrew | brew | d6bba1c4938ea9c9a9d58ba2f209775dd71a8537.json | java: fix java_home on macOS | Library/Homebrew/extend/os/language/java.rb | @@ -0,0 +1,4 @@
+# typed: strict
+# frozen_string_literal: true
+
+require "extend/os/mac/language/java" if OS.mac? | true |
Other | Homebrew | brew | d6bba1c4938ea9c9a9d58ba2f209775dd71a8537.json | java: fix java_home on macOS | Library/Homebrew/extend/os/mac/language/java.rb | @@ -0,0 +1,10 @@
+# typed: true
+# frozen_string_literal: true
+
+module Language
+ module Java
+ def self.java_home(version = nil)
+ find_openjdk_formula(version)&.opt_libexec&.join("openjdk.jdk/Contents/Home")
+ end
+ end
+end | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.