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
02164a35dbc2320e9f4eb2e27ff952e0a157b6fa.json
Use ORIGINAL_PATHS over envs; reject nil PATH
Library/Homebrew/test/cask/artifact/installer_spec.rb
@@ -34,7 +34,7 @@ expect(command).to receive(:run!).with( executable, a_hash_including( - env: { "PATH" => PATH.new("#{HOMEBREW_PREFIX}/bin", "#{HOMEBREW_PREFIX}/sbin", ENV["PATH"]) }, + env: { "PATH" => PATH.new("#{HOMEBREW_PREFIX}/bin", "#{HOMEBREW_PREFIX}/sbin", ENV.fetch("PATH")) }, ), )
true
Other
Homebrew
brew
02164a35dbc2320e9f4eb2e27ff952e0a157b6fa.json
Use ORIGINAL_PATHS over envs; reject nil PATH
Library/Homebrew/test/cmd/custom-external-command_spec.rb
@@ -13,7 +13,7 @@ SH FileUtils.chmod "+x", file - expect { brew cmd, "PATH" => "#{path}#{File::PATH_SEPARATOR}#{ENV["PATH"]}" } + expect { brew cmd, "PATH" => "#{path}#{File::PATH_SEPARATOR}#{ENV.fetch("PATH")}" } .to output("I am #{cmd}.\n").to_stdout .and not_to_output.to_stderr .and be_a_success
true
Other
Homebrew
brew
02164a35dbc2320e9f4eb2e27ff952e0a157b6fa.json
Use ORIGINAL_PATHS over envs; reject nil PATH
Library/Homebrew/test/diagnostic_checks_spec.rb
@@ -20,7 +20,7 @@ FileUtils.chmod 0755, anaconda FileUtils.chmod 0755, python - ENV["PATH"] = "#{path}#{File::PATH_SEPARATOR}#{ENV["PATH"]}" + ENV["PATH"] = "#{path}#{File::PATH_SEPARATOR}#{ENV.fetch("PATH")}" expect(checks.check_for_anaconda).to match("Anaconda") end @@ -75,10 +75,12 @@ specify "#check_user_path_3" do sbin = HOMEBREW_PREFIX/"sbin" - ENV["HOMEBREW_PATH"] = + (sbin/"something").mkpath + + homebrew_path = "#{HOMEBREW_PREFIX}/bin#{File::PATH_SEPARATOR}" + ENV["HOMEBREW_PATH"].gsub(/(?:^|#{Regexp.escape(File::PATH_SEPARATOR)})#{Regexp.escape(sbin)}/, "") - (sbin/"something").mkpath + stub_const("ORIGINAL_PATHS", PATH.new(homebrew_path).map { |path| Pathname.new(path).expand_path }.compact) expect(checks.check_user_path_1).to be_nil expect(checks.check_user_path_2).to be_nil @@ -93,8 +95,7 @@ file = "#{path}/foo-config" FileUtils.touch file FileUtils.chmod 0755, file - ENV["HOMEBREW_PATH"] = ENV["PATH"] = - "#{path}#{File::PATH_SEPARATOR}#{ENV["PATH"]}" + ENV["PATH"] = "#{path}#{File::PATH_SEPARATOR}#{ENV.fetch("PATH")}" expect(checks.check_for_config_scripts) .to match('"config" scripts exist')
true
Other
Homebrew
brew
02164a35dbc2320e9f4eb2e27ff952e0a157b6fa.json
Use ORIGINAL_PATHS over envs; reject nil PATH
Library/Homebrew/test/spec_helper.rb
@@ -150,7 +150,7 @@ skip "Subversion is not installed." unless quiet_system svn_shim, "--version" svn_shim_path = Pathname(Utils.popen_read(svn_shim, "--homebrew=print-path").chomp.presence) - svn_paths = PATH.new(ENV["PATH"]) + svn_paths = PATH.new(ENV.fetch("PATH")) svn_paths.prepend(svn_shim_path.dirname) if OS.mac? @@ -164,7 +164,7 @@ svnadmin = which("svnadmin", svn_paths) skip "svnadmin is not installed." unless svnadmin - ENV["PATH"] = PATH.new(ENV["PATH"]) + ENV["PATH"] = PATH.new(ENV.fetch("PATH")) .append(svn.dirname) .append(svnadmin.dirname) end
true
Other
Homebrew
brew
02164a35dbc2320e9f4eb2e27ff952e0a157b6fa.json
Use ORIGINAL_PATHS over envs; reject nil PATH
Library/Homebrew/test/support/helper/spec/shared_context/integration_test.rb
@@ -73,7 +73,7 @@ def brew(*args) env["PATH"], (HOMEBREW_LIBRARY_PATH/"test/support/helper/cmd").realpath.to_s, (HOMEBREW_PREFIX/"bin").realpath.to_s, - ENV["PATH"], + ENV.fetch("PATH"), ].compact.join(File::PATH_SEPARATOR) env.merge!(
true
Other
Homebrew
brew
02164a35dbc2320e9f4eb2e27ff952e0a157b6fa.json
Use ORIGINAL_PATHS over envs; reject nil PATH
Library/Homebrew/test/utils_spec.rb
@@ -274,17 +274,19 @@ def esc(code) describe "#with_env" do it "sets environment variables within the block" do - expect(ENV["PATH"]).not_to eq("/bin") + expect(ENV.fetch("PATH")).not_to eq("/bin") with_env(PATH: "/bin") do - expect(ENV["PATH"]).to eq("/bin") + expect(ENV.fetch("PATH", nil)).to eq("/bin") end end it "restores ENV after the block" do with_env(PATH: "/bin") do - expect(ENV["PATH"]).to eq("/bin") + expect(ENV.fetch("PATH", nil)).to eq("/bin") end - expect(ENV["PATH"]).not_to eq("/bin") + path = ENV.fetch("PATH", nil) + expect(path).not_to be_nil + expect(path).not_to eq("/bin") end it "restores ENV if an exception is raised" do @@ -294,7 +296,9 @@ def esc(code) end }.to raise_error(StandardError) - expect(ENV["PATH"]).not_to eq("/bin") + path = ENV.fetch("PATH", nil) + expect(path).not_to be_nil + expect(path).not_to eq("/bin") end end
true
Other
Homebrew
brew
02164a35dbc2320e9f4eb2e27ff952e0a157b6fa.json
Use ORIGINAL_PATHS over envs; reject nil PATH
Library/Homebrew/unpack_strategy/cab.rb
@@ -23,7 +23,7 @@ def self.can_extract?(path) def extract_to_dir(unpack_dir, basename:, verbose:) system_command! "cabextract", args: ["-d", unpack_dir, "--", path], - env: { "PATH" => PATH.new(Formula["cabextract"].opt_bin, ENV["PATH"]) }, + env: { "PATH" => PATH.new(Formula["cabextract"].opt_bin, ENV.fetch("PATH")) }, verbose: verbose end
true
Other
Homebrew
brew
02164a35dbc2320e9f4eb2e27ff952e0a157b6fa.json
Use ORIGINAL_PATHS over envs; reject nil PATH
Library/Homebrew/unpack_strategy/fossil.rb
@@ -39,7 +39,7 @@ def extract_to_dir(unpack_dir, basename:, verbose:) system_command! "fossil", args: ["open", path, *args], chdir: unpack_dir, - env: { "PATH" => PATH.new(Formula["fossil"].opt_bin, ENV["PATH"]) }, + env: { "PATH" => PATH.new(Formula["fossil"].opt_bin, ENV.fetch("PATH")) }, verbose: verbose end end
true
Other
Homebrew
brew
02164a35dbc2320e9f4eb2e27ff952e0a157b6fa.json
Use ORIGINAL_PATHS over envs; reject nil PATH
Library/Homebrew/unpack_strategy/generic_unar.rb
@@ -32,7 +32,7 @@ def extract_to_dir(unpack_dir, basename:, verbose:) "-force-overwrite", "-quiet", "-no-directory", "-output-directory", unpack_dir, "--", path ], - env: { "PATH" => PATH.new(Formula["unar"].opt_bin, ENV["PATH"]) }, + env: { "PATH" => PATH.new(Formula["unar"].opt_bin, ENV.fetch("PATH")) }, verbose: verbose end end
true
Other
Homebrew
brew
02164a35dbc2320e9f4eb2e27ff952e0a157b6fa.json
Use ORIGINAL_PATHS over envs; reject nil PATH
Library/Homebrew/unpack_strategy/lha.rb
@@ -29,7 +29,7 @@ def dependencies def extract_to_dir(unpack_dir, basename:, verbose:) system_command! "lha", args: ["xq2w=#{unpack_dir}", path], - env: { "PATH" => PATH.new(Formula["lha"].opt_bin, ENV["PATH"]) }, + env: { "PATH" => PATH.new(Formula["lha"].opt_bin, ENV.fetch("PATH")) }, verbose: verbose end end
true
Other
Homebrew
brew
02164a35dbc2320e9f4eb2e27ff952e0a157b6fa.json
Use ORIGINAL_PATHS over envs; reject nil PATH
Library/Homebrew/unpack_strategy/lzip.rb
@@ -31,7 +31,7 @@ def extract_to_dir(unpack_dir, basename:, verbose:) quiet_flags = verbose ? [] : ["-q"] system_command! "lzip", args: ["-d", *quiet_flags, unpack_dir/basename], - env: { "PATH" => PATH.new(Formula["lzip"].opt_bin, ENV["PATH"]) }, + env: { "PATH" => PATH.new(Formula["lzip"].opt_bin, ENV.fetch("PATH")) }, verbose: verbose end end
true
Other
Homebrew
brew
02164a35dbc2320e9f4eb2e27ff952e0a157b6fa.json
Use ORIGINAL_PATHS over envs; reject nil PATH
Library/Homebrew/unpack_strategy/lzma.rb
@@ -31,7 +31,7 @@ def extract_to_dir(unpack_dir, basename:, verbose:) quiet_flags = verbose ? [] : ["-q"] system_command! "unlzma", args: [*quiet_flags, "--", unpack_dir/basename], - env: { "PATH" => PATH.new(Formula["xz"].opt_bin, ENV["PATH"]) }, + env: { "PATH" => PATH.new(Formula["xz"].opt_bin, ENV.fetch("PATH")) }, verbose: verbose end end
true
Other
Homebrew
brew
02164a35dbc2320e9f4eb2e27ff952e0a157b6fa.json
Use ORIGINAL_PATHS over envs; reject nil PATH
Library/Homebrew/unpack_strategy/mercurial.rb
@@ -17,7 +17,7 @@ def self.can_extract?(path) def extract_to_dir(unpack_dir, basename:, verbose:) system_command! "hg", args: ["--cwd", path, "archive", "--subrepos", "-y", "-t", "files", unpack_dir], - env: { "PATH" => PATH.new(Formula["mercurial"].opt_bin, ENV["PATH"]) }, + env: { "PATH" => PATH.new(Formula["mercurial"].opt_bin, ENV.fetch("PATH")) }, verbose: verbose end end
true
Other
Homebrew
brew
02164a35dbc2320e9f4eb2e27ff952e0a157b6fa.json
Use ORIGINAL_PATHS over envs; reject nil PATH
Library/Homebrew/unpack_strategy/p7zip.rb
@@ -29,7 +29,7 @@ def dependencies def extract_to_dir(unpack_dir, basename:, verbose:) system_command! "7zr", args: ["x", "-y", "-bd", "-bso0", path, "-o#{unpack_dir}"], - env: { "PATH" => PATH.new(Formula["p7zip"].opt_bin, ENV["PATH"]) }, + env: { "PATH" => PATH.new(Formula["p7zip"].opt_bin, ENV.fetch("PATH")) }, verbose: verbose end end
true
Other
Homebrew
brew
02164a35dbc2320e9f4eb2e27ff952e0a157b6fa.json
Use ORIGINAL_PATHS over envs; reject nil PATH
Library/Homebrew/unpack_strategy/rar.rb
@@ -29,7 +29,7 @@ def dependencies def extract_to_dir(unpack_dir, basename:, verbose:) system_command! "unrar", args: ["x", "-inul", path, unpack_dir], - env: { "PATH" => PATH.new(Formula["unrar"].opt_bin, ENV["PATH"]) }, + env: { "PATH" => PATH.new(Formula["unrar"].opt_bin, ENV.fetch("PATH")) }, verbose: verbose end end
true
Other
Homebrew
brew
02164a35dbc2320e9f4eb2e27ff952e0a157b6fa.json
Use ORIGINAL_PATHS over envs; reject nil PATH
Library/Homebrew/unpack_strategy/xz.rb
@@ -31,7 +31,7 @@ def extract_to_dir(unpack_dir, basename:, verbose:) quiet_flags = verbose ? [] : ["-q"] system_command! "unxz", args: [*quiet_flags, "-T0", "--", unpack_dir/basename], - env: { "PATH" => PATH.new(Formula["xz"].opt_bin, ENV["PATH"]) }, + env: { "PATH" => PATH.new(Formula["xz"].opt_bin, ENV.fetch("PATH")) }, verbose: verbose end end
true
Other
Homebrew
brew
02164a35dbc2320e9f4eb2e27ff952e0a157b6fa.json
Use ORIGINAL_PATHS over envs; reject nil PATH
Library/Homebrew/unpack_strategy/zip.rb
@@ -37,7 +37,7 @@ def extract_to_dir(unpack_dir, basename:, verbose:) quiet_flags = verbose ? [] : ["-qq"] result = system_command! "unzip", args: [*quiet_flags, "-o", path, "-d", unpack_dir], - env: { "PATH" => PATH.new(unzip&.opt_bin, ENV["PATH"]) }, + env: { "PATH" => PATH.new(unzip&.opt_bin, ENV.fetch("PATH")) }, verbose: verbose, print_stderr: false
true
Other
Homebrew
brew
02164a35dbc2320e9f4eb2e27ff952e0a157b6fa.json
Use ORIGINAL_PATHS over envs; reject nil PATH
Library/Homebrew/unpack_strategy/zstd.rb
@@ -31,7 +31,7 @@ def extract_to_dir(unpack_dir, basename:, verbose:) quiet_flags = verbose ? [] : ["-q"] system_command! "unzstd", args: [*quiet_flags, "-T0", "--rm", "--", unpack_dir/basename], - env: { "PATH" => PATH.new(Formula["zstd"].opt_bin, ENV["PATH"]) }, + env: { "PATH" => PATH.new(Formula["zstd"].opt_bin, ENV.fetch("PATH")) }, verbose: verbose end end
true
Other
Homebrew
brew
02164a35dbc2320e9f4eb2e27ff952e0a157b6fa.json
Use ORIGINAL_PATHS over envs; reject nil PATH
Library/Homebrew/utils.rb
@@ -305,7 +305,7 @@ def interactive_shell(f = nil) end def with_homebrew_path(&block) - with_env(PATH: PATH.new(ENV["HOMEBREW_PATH"]), &block) + with_env(PATH: PATH.new(ORIGINAL_PATHS), &block) end def with_custom_locale(locale, &block) @@ -329,7 +329,7 @@ def quiet_system(cmd, *args) end end - def which(cmd, path = ENV["PATH"]) + def which(cmd, path = ENV.fetch("PATH")) PATH.new(path).each do |p| begin pcmd = File.expand_path(cmd, p) @@ -343,7 +343,7 @@ def which(cmd, path = ENV["PATH"]) nil end - def which_all(cmd, path = ENV["PATH"]) + def which_all(cmd, path = ENV.fetch("PATH")) PATH.new(path).map do |p| begin pcmd = File.expand_path(cmd, p) @@ -362,7 +362,7 @@ def which_editor # Find Atom, Sublime Text, VS Code, Textmate, BBEdit / TextWrangler, or vim editor = %w[atom subl code mate edit vim].find do |candidate| - candidate if which(candidate, ENV["HOMEBREW_PATH"]) + candidate if which(candidate, ORIGINAL_PATHS) end editor ||= "vim" @@ -499,7 +499,7 @@ def ensure_executable!(name, formula_name = nil, reason: "") executable = [ which(name), - which(name, ENV["HOMEBREW_PATH"]), + which(name, ORIGINAL_PATHS), HOMEBREW_PREFIX/"bin/#{name}", ].compact.first return executable if executable.exist? @@ -508,11 +508,7 @@ def ensure_executable!(name, formula_name = nil, reason: "") end def paths - @paths ||= PATH.new(ENV["HOMEBREW_PATH"]).map do |p| - File.expand_path(p).chomp("/") - rescue ArgumentError - onoe "The following PATH component is invalid: #{p}" - end.uniq.compact + @paths ||= ORIGINAL_PATHS.uniq.map(&:to_s) end def parse_author!(author)
true
Other
Homebrew
brew
02164a35dbc2320e9f4eb2e27ff952e0a157b6fa.json
Use ORIGINAL_PATHS over envs; reject nil PATH
Library/Homebrew/utils/git.rb
@@ -124,7 +124,7 @@ def setup_gpg! gnupg_bin = HOMEBREW_PREFIX/"opt/gnupg/bin" return unless gnupg_bin.directory? - ENV["PATH"] = PATH.new(ENV["PATH"]) + ENV["PATH"] = PATH.new(ENV.fetch("PATH")) .prepend(gnupg_bin) end
true
Other
Homebrew
brew
8ada737d40b46dd020de3425ef1088a53cf89fa4.json
Encapsulate ENV["SHELL"] usage
Library/Homebrew/dev-cmd/sh.rb
@@ -44,16 +44,18 @@ def sh ENV["VERBOSE"] = "1" if args.verbose? if args.cmd.present? - safe_system(ENV["SHELL"], "-c", args.cmd) + safe_system(preferred_shell, "-c", args.cmd) elsif args.named.present? - safe_system(ENV["SHELL"], args.named.first) + safe_system(preferred_shell, args.named.first) else - subshell = if ENV["SHELL"].include?("zsh") - "PS1='brew %B%F{green}%~%f%b$ ' #{ENV["SHELL"]} -d -f" - elsif ENV["SHELL"].include?("bash") - "PS1=\"brew \\[\\033[1;32m\\]\\w\\[\\033[0m\\]$ \" #{ENV["SHELL"]} --noprofile --norc" + shell_type = Utils::Shell.preferred + subshell = case shell_type + when :zsh + "PS1='brew %B%F{green}%~%f%b$ ' #{preferred_shell} -d -f" + when :bash + "PS1=\"brew \\[\\033[1;32m\\]\\w\\[\\033[0m\\]$ \" #{preferred_shell} --noprofile --norc" else - "PS1=\"brew \\[\\033[1;32m\\]\\w\\[\\033[0m\\]$ \" #{ENV["SHELL"]}" + "PS1=\"brew \\[\\033[1;32m\\]\\w\\[\\033[0m\\]$ \" #{preferred_shell}" end puts <<~EOS Your shell has been configured to use Homebrew's build environment;
true
Other
Homebrew
brew
8ada737d40b46dd020de3425ef1088a53cf89fa4.json
Encapsulate ENV["SHELL"] usage
Library/Homebrew/utils.rb
@@ -291,12 +291,12 @@ def interactive_shell(f = nil) ENV["HOMEBREW_DEBUG_INSTALL"] = f.full_name end - if ENV["SHELL"].include?("zsh") && (home = Dir.home).start_with?(HOMEBREW_TEMP.resolved_path.to_s) + if Utils::Shell.preferred == :zsh && (home = Dir.home).start_with?(HOMEBREW_TEMP.resolved_path.to_s) FileUtils.mkdir_p home FileUtils.touch "#{home}/.zshrc" end - Process.wait fork { exec ENV.fetch("SHELL") } + Process.wait fork { exec preferred_shell } return if $CHILD_STATUS.success? raise "Aborted due to non-zero exit status (#{$CHILD_STATUS.exitstatus})" if $CHILD_STATUS.exited? @@ -608,6 +608,11 @@ def with_env(hash) end end + sig { returns(String) } + def preferred_shell + ENV.fetch("SHELL", "/bin/sh") + end + sig { returns(String) } def shell_profile Utils::Shell.profile
true
Other
Homebrew
brew
e78665f4f7a73bf18a26f2cb32d310de38e67898.json
Replace ENV["HOME"] with Dir.home
Library/Homebrew/cask/artifact/abstract_uninstall.rb
@@ -106,7 +106,7 @@ def uninstall_launchctl(*services, command: nil, **_) +"/Library/LaunchAgents/#{service}.plist", +"/Library/LaunchDaemons/#{service}.plist", ] - paths.each { |elt| elt.prepend(ENV["HOME"]).freeze } unless with_sudo + paths.each { |elt| elt.prepend(Dir.home).freeze } unless with_sudo paths = paths.map { |elt| Pathname(elt) }.select(&:exist?) paths.each do |path| command.run!("/bin/rm", args: ["-f", "--", path], sudo: with_sudo)
true
Other
Homebrew
brew
e78665f4f7a73bf18a26f2cb32d310de38e67898.json
Replace ENV["HOME"] with Dir.home
Library/Homebrew/cask/artifact/relocated.rb
@@ -96,7 +96,7 @@ def add_altname_metadata(file, altname, command: nil) end def printable_target - target.to_s.sub(/^#{ENV['HOME']}(#{File::SEPARATOR}|$)/, "~/") + target.to_s.sub(/^#{Dir.home}(#{File::SEPARATOR}|$)/, "~/") end end end
true
Other
Homebrew
brew
e78665f4f7a73bf18a26f2cb32d310de38e67898.json
Replace ENV["HOME"] with Dir.home
Library/Homebrew/cask/cask.rb
@@ -241,7 +241,7 @@ def to_h def to_h_string_gsubs(string) string.to_s - .gsub(ENV["HOME"], "$HOME") + .gsub(Dir.home, "$HOME") .gsub(HOMEBREW_PREFIX, "$(brew --prefix)") end
true
Other
Homebrew
brew
e78665f4f7a73bf18a26f2cb32d310de38e67898.json
Replace ENV["HOME"] with Dir.home
Library/Homebrew/cask/config.rb
@@ -190,7 +190,7 @@ def explicit_s key = "language" value = T.cast(explicit.fetch(:languages, []), T::Array[String]).join(",") end - "#{key}: \"#{value.to_s.sub(/^#{ENV['HOME']}/, "~")}\"" + "#{key}: \"#{value.to_s.sub(/^#{Dir.home}/, "~")}\"" end.join(", ") end
true
Other
Homebrew
brew
e78665f4f7a73bf18a26f2cb32d310de38e67898.json
Replace ENV["HOME"] with Dir.home
Library/Homebrew/diagnostic.rb
@@ -70,7 +70,7 @@ def inject_file_list(list, string) end def user_tilde(path) - path.gsub(ENV["HOME"], "~") + path.gsub(Dir.home, "~") end sig { returns(String) } @@ -766,7 +766,7 @@ def check_for_non_prefixed_coreutils end def check_for_pydistutils_cfg_in_home - return unless File.exist? "#{ENV["HOME"]}/.pydistutils.cfg" + return unless File.exist? "#{Dir.home}/.pydistutils.cfg" <<~EOS A '.pydistutils.cfg' file was found in $HOME, which may cause Python
true
Other
Homebrew
brew
e78665f4f7a73bf18a26f2cb32d310de38e67898.json
Replace ENV["HOME"] with Dir.home
Library/Homebrew/formula.rb
@@ -2433,7 +2433,7 @@ def common_stage_test_env GOCACHE: "#{HOMEBREW_CACHE}/go_cache", GOPATH: "#{HOMEBREW_CACHE}/go_mod_cache", CARGO_HOME: "#{HOMEBREW_CACHE}/cargo_cache", - CURL_HOME: ENV["CURL_HOME"] || ENV["HOME"], + CURL_HOME: ENV.fetch("CURL_HOME") { Dir.home }, } end
true
Other
Homebrew
brew
e78665f4f7a73bf18a26f2cb32d310de38e67898.json
Replace ENV["HOME"] with Dir.home
Library/Homebrew/formula_installer.rb
@@ -904,7 +904,7 @@ def build sandbox = Sandbox.new formula.logs.mkpath sandbox.record_log(formula.logs/"build.sandbox.log") - sandbox.allow_write_path(ENV["HOME"]) if interactive? + sandbox.allow_write_path(Dir.home) if interactive? sandbox.allow_write_temp_and_cache sandbox.allow_write_log(formula) sandbox.allow_cvs
true
Other
Homebrew
brew
e78665f4f7a73bf18a26f2cb32d310de38e67898.json
Replace ENV["HOME"] with Dir.home
Library/Homebrew/test/support/fixtures/cask/Casks/with-uninstall-script-user-relative.rb
@@ -8,9 +8,9 @@ app "MyFancyApp/MyFancyApp.app", target: "~/MyFancyApp.app" postflight do - File.write "#{ENV["HOME"]}/MyFancyApp.app/uninstall.sh", <<~SH + File.write "#{Dir.home}/MyFancyApp.app/uninstall.sh", <<~SH #!/bin/sh - /bin/rm -r "#{ENV["HOME"]}/MyFancyApp.app" + /bin/rm -r "#{Dir.home}/MyFancyApp.app" SH end
true
Other
Homebrew
brew
e78665f4f7a73bf18a26f2cb32d310de38e67898.json
Replace ENV["HOME"] with Dir.home
Library/Homebrew/utils.rb
@@ -291,7 +291,7 @@ def interactive_shell(f = nil) ENV["HOMEBREW_DEBUG_INSTALL"] = f.full_name end - if ENV["SHELL"].include?("zsh") && (home = ENV["HOME"])&.start_with?(HOMEBREW_TEMP.resolved_path.to_s) + if ENV["SHELL"].include?("zsh") && (home = Dir.home).start_with?(HOMEBREW_TEMP.resolved_path.to_s) FileUtils.mkdir_p home FileUtils.touch "#{home}/.zshrc" end
true
Other
Homebrew
brew
e78665f4f7a73bf18a26f2cb32d310de38e67898.json
Replace ENV["HOME"] with Dir.home
Library/Homebrew/utils/shell.rb
@@ -49,7 +49,7 @@ def export_value(key, value, shell = preferred) def profile case preferred when :bash - bash_profile = "#{ENV["HOME"]}/.bash_profile" + bash_profile = "#{Dir.home}/.bash_profile" return bash_profile if File.exist? bash_profile when :zsh return "#{ENV["ZDOTDIR"]}/.zshrc" if ENV["ZDOTDIR"].present?
true
Other
Homebrew
brew
fae972c9d708179f8fb1b91e49800f1ff2031bf9.json
brew.rb: remove 'nice' error message for missing envs
Library/Homebrew/brew.rb
@@ -11,11 +11,7 @@ std_trap = trap("INT") { exit! 130 } # no backtrace thanks # check ruby version before requiring any modules. -unless ENV["HOMEBREW_REQUIRED_RUBY_VERSION"] - raise "HOMEBREW_REQUIRED_RUBY_VERSION was not exported! Please call bin/brew directly!" -end - -REQUIRED_RUBY_X, REQUIRED_RUBY_Y, = ENV["HOMEBREW_REQUIRED_RUBY_VERSION"].split(".").map(&:to_i) +REQUIRED_RUBY_X, REQUIRED_RUBY_Y, = ENV.fetch("HOMEBREW_REQUIRED_RUBY_VERSION").split(".").map(&:to_i) RUBY_X, RUBY_Y, = RUBY_VERSION.split(".").map(&:to_i) if RUBY_X < REQUIRED_RUBY_X || (RUBY_X == REQUIRED_RUBY_X && RUBY_Y < REQUIRED_RUBY_Y) raise "Homebrew must be run under Ruby #{REQUIRED_RUBY_X}.#{REQUIRED_RUBY_Y}! " \
false
Other
Homebrew
brew
a2033c397e3ab0783aceac84025c9924ebed5c3f.json
Use EnvConfig methods over direct ENV access
Library/Homebrew/cmd/update-report.rb
@@ -54,19 +54,19 @@ def output_update_report ENV["HOMEBREW_LINUXBREW_CORE_MIGRATION"].blank? ohai "Re-running `brew update` for linuxbrew-core migration" - if ENV["HOMEBREW_CORE_DEFAULT_GIT_REMOTE"] != ENV["HOMEBREW_CORE_GIT_REMOTE"] + if HOMEBREW_CORE_DEFAULT_GIT_REMOTE != Homebrew::EnvConfig.core_git_remote opoo <<~EOS - HOMEBREW_CORE_GIT_REMOTE was set: #{ENV["HOMEBREW_CORE_GIT_REMOTE"]}. + HOMEBREW_CORE_GIT_REMOTE was set: #{Homebrew::EnvConfig.core_git_remote}. It has been unset for the migration. You may need to change this from a linuxbrew-core mirror to a homebrew-core one. EOS end ENV.delete("HOMEBREW_CORE_GIT_REMOTE") - if ENV["HOMEBREW_BOTTLE_DEFAULT_DOMAIN"] != ENV["HOMEBREW_BOTTLE_DOMAIN"] + if HOMEBREW_BOTTLE_DEFAULT_DOMAIN != Homebrew::EnvConfig.bottle_domain opoo <<~EOS - HOMEBREW_BOTTLE_DOMAIN was set: #{ENV["HOMEBREW_BOTTLE_DOMAIN"]}. + HOMEBREW_BOTTLE_DOMAIN was set: #{Homebrew::EnvConfig.bottle_domain}. It has been unset for the migration. You may need to change this from a Linuxbrew package mirror to a Homebrew one. @@ -142,7 +142,7 @@ def output_update_report end Homebrew.failed = true if ENV["HOMEBREW_UPDATE_FAILED"] - return if ENV["HOMEBREW_DISABLE_LOAD_FORMULA"] + return if Homebrew::EnvConfig.disable_load_formula? hub = ReporterHub.new
true
Other
Homebrew
brew
a2033c397e3ab0783aceac84025c9924ebed5c3f.json
Use EnvConfig methods over direct ENV access
Library/Homebrew/dev-cmd/livecheck.rb
@@ -12,7 +12,7 @@ module Homebrew module_function WATCHLIST_PATH = ( - ENV["HOMEBREW_LIVECHECK_WATCHLIST"] || + Homebrew::EnvConfig.livecheck_watchlist || "#{Dir.home}/.brew_livecheck_watchlist" ).freeze @@ -58,7 +58,7 @@ def livecheck if args.debug? && args.verbose? puts args - puts ENV["HOMEBREW_LIVECHECK_WATCHLIST"] if ENV["HOMEBREW_LIVECHECK_WATCHLIST"].present? + puts Homebrew::EnvConfig.livecheck_watchlist if Homebrew::EnvConfig.livecheck_watchlist.present? end formulae_and_casks_to_check = if args.tap
true
Other
Homebrew
brew
8500c264191be27ccbf07b87761cecf131a724b2.json
.rubocop.yml: fix obsolete parameter usage
Library/.rubocop.yml
@@ -97,7 +97,7 @@ Naming/InclusiveLanguage: - "patches/13_fix_scope_for_show_slave_status_data.patch" # Used in formula `mytop` Naming/MethodName: - IgnoredPatterns: + AllowedPatterns: - '\A(fetch_)?HEAD\?\Z' # Both styles are used depending on context, @@ -389,7 +389,7 @@ Naming/MethodParameterName: Layout/LineLength: Max: 118 # ignore manpage comments and long single-line strings - IgnoredPatterns: + AllowedPatterns: [ "#: ", ' url "',
false
Other
Homebrew
brew
ad5391830283973b20522b1d2616a7310727ecbc.json
Update RBI files for rubocop.
Library/Homebrew/sorbet/rbi/gems/rubocop@1.30.1.rbi
@@ -49,6 +49,8 @@ class RuboCop::CLI::Command::AutoGenerateConfig < ::RuboCop::CLI::Command::Base def line_length_enabled?(config); end def max_line_length(config); end def maybe_run_line_length_cop; end + def options_config_in_root?; end + def relative_path_to_todo_from_options_config; end def reset_config_and_auto_gen_file; end def run_all_cops(line_length_contents); end def run_line_length_cop; end @@ -319,6 +321,8 @@ class RuboCop::ConfigLoader def ignore_parent_exclusion; end def ignore_parent_exclusion=(_arg0); end def ignore_parent_exclusion?; end + def ignore_unrecognized_cops; end + def ignore_unrecognized_cops=(_arg0); end def load_file(file, check: T.unsafe(nil)); end def load_yaml_configuration(absolute_path); end def loaded_features; end @@ -564,6 +568,7 @@ class RuboCop::ConfigValidator def check_obsoletions; end def check_target_ruby; end def each_invalid_parameter(cop_name); end + def list_unknown_cops(invalid_cop_names); end def msg_not_boolean(parent, key, value); end def reject_conflicting_safe_settings; end def reject_mutually_exclusive_defaults; end @@ -638,6 +643,16 @@ module RuboCop::Cop::AllowedMethods def allowed_methods; end end +module RuboCop::Cop::AllowedPattern + private + + def allowed_line?(line); end + def allowed_patterns; end + def ignored_line?(line); end + def matches_allowed_pattern?(line); end + def matches_ignored_pattern?(line); end +end + class RuboCop::Cop::AmbiguousCopName < ::RuboCop::Error def initialize(name, origin, badges); end end @@ -1528,6 +1543,49 @@ end RuboCop::Cop::Gemspec::DateAssignment::MSG = T.let(T.unsafe(nil), String) +class RuboCop::Cop::Gemspec::DependencyVersion < ::RuboCop::Cop::Base + include ::RuboCop::Cop::ConfigurableEnforcedStyle + include ::RuboCop::Cop::GemspecHelp + + def add_dependency_method_declarations(param0); end + def includes_commit_reference?(param0 = T.unsafe(nil)); end + def includes_version_specification?(param0 = T.unsafe(nil)); end + def on_new_investigation; end + + private + + def add_dependency_method?(method_name); end + def add_dependency_method_nodes; end + def allowed_gem?(node); end + def allowed_gems; end + def forbidden_offense?(node); end + def forbidden_style?; end + def match_block_variable_name?(receiver_name); end + def message(range); end + def offense?(node); end + def required_offense?(node); end + def required_style?; end + def version_specification?(expression); end +end + +RuboCop::Cop::Gemspec::DependencyVersion::FORBIDDEN_MSG = T.let(T.unsafe(nil), String) +RuboCop::Cop::Gemspec::DependencyVersion::REQUIRED_MSG = T.let(T.unsafe(nil), String) +RuboCop::Cop::Gemspec::DependencyVersion::VERSION_SPECIFICATION_REGEX = T.let(T.unsafe(nil), Regexp) + +class RuboCop::Cop::Gemspec::DeprecatedAttributeAssignment < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + def gem_specification(param0 = T.unsafe(nil)); end + def on_block(block_node); end + + private + + def use_test_files?(node, block_parameter); end +end + +RuboCop::Cop::Gemspec::DeprecatedAttributeAssignment::MSG = T.let(T.unsafe(nil), String) + class RuboCop::Cop::Gemspec::DuplicatedAssignment < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp include ::RuboCop::Cop::GemspecHelp @@ -1537,7 +1595,6 @@ class RuboCop::Cop::Gemspec::DuplicatedAssignment < ::RuboCop::Cop::Base private - def assignment_method?(method_name); end def duplicated_assignment_method_nodes; end def match_block_variable_name?(receiver_name); end def register_offense(node, assignment, line_of_first_occurrence); end @@ -1745,6 +1802,7 @@ module RuboCop::Cop::HashShorthandSyntax def enforced_shorthand_syntax; end def ignore_hash_shorthand_syntax?(pair_node); end + def register_offense(node, message, replacement); end def require_hash_value?(hash_key_source, node); end def require_hash_value_for_around_hash_literal?(node); end def use_element_of_hash_literal_as_receiver?(ancestor, parent); end @@ -1884,13 +1942,7 @@ module RuboCop::Cop::IgnoredNode def ignored_nodes; end end -module RuboCop::Cop::IgnoredPattern - private - - def ignored_line?(line); end - def ignored_patterns; end - def matches_ignored_pattern?(line); end -end +RuboCop::Cop::IgnoredPattern = RuboCop::Cop::AllowedPattern module RuboCop::Cop::IntegerNode private @@ -1972,12 +2024,16 @@ class RuboCop::Cop::Layout::ArgumentAlignment < ::RuboCop::Cop::Base def arguments_or_first_arg_pairs(node); end def arguments_with_last_arg_pairs(node); end def autocorrect(corrector, node); end + def autocorrect_incompatible_with_other_cops?; end def base_column(node, first_argument); end + def enforce_hash_argument_with_separator?; end def fixed_indentation?; end def flattened_arguments(node); end + def hash_argument_config; end def message(_node); end def multiple_arguments?(node); end def target_method_lineno(node); end + def with_first_argument_style?; end end RuboCop::Cop::Layout::ArgumentAlignment::ALIGN_PARAMS_MSG = T.let(T.unsafe(nil), String) @@ -2090,6 +2146,8 @@ class RuboCop::Cop::Layout::CaseIndentation < ::RuboCop::Cop::Base def base_column(case_node, base); end def check_when(when_node, branch_type); end def detect_incorrect_style(when_node); end + def end_and_last_conditional_same_line?(node); end + def enforced_style_end?; end def incorrect_style(when_node, branch_type); end def indent_one_step?; end def indentation_width; end @@ -2878,6 +2936,7 @@ class RuboCop::Cop::Layout::HashAlignment < ::RuboCop::Cop::Base end RuboCop::Cop::Layout::HashAlignment::MESSAGES = T.let(T.unsafe(nil), Hash) +RuboCop::Cop::Layout::HashAlignment::SEPARATOR_ALIGNMENT_STYLES = T.let(T.unsafe(nil), Array) class RuboCop::Cop::Layout::HeredocArgumentClosingParenthesis < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp @@ -2997,7 +3056,7 @@ class RuboCop::Cop::Layout::IndentationWidth < ::RuboCop::Cop::Base include ::RuboCop::Cop::EndKeywordAlignment include ::RuboCop::Cop::Alignment include ::RuboCop::Cop::CheckAssignment - include ::RuboCop::Cop::IgnoredPattern + include ::RuboCop::Cop::AllowedPattern extend ::RuboCop::Cop::AutoCorrector def access_modifier?(param0 = T.unsafe(nil)); end @@ -3118,7 +3177,7 @@ RuboCop::Cop::Layout::LineEndStringConcatenationIndentation::PARENT_TYPES_FOR_IN class RuboCop::Cop::Layout::LineLength < ::RuboCop::Cop::Base include ::RuboCop::Cop::CheckLineBreakable - include ::RuboCop::Cop::IgnoredPattern + include ::RuboCop::Cop::AllowedPattern include ::RuboCop::Cop::RangeHelp include ::RuboCop::Cop::LineLengthHelp extend ::RuboCop::Cop::AutoCorrector @@ -3136,6 +3195,7 @@ class RuboCop::Cop::Layout::LineLength < ::RuboCop::Cop::Base def allow_heredoc?; end def allowed_heredoc; end + def allowed_line?(line, line_index); end def breakable_block_range(block_node); end def breakable_range; end def breakable_range=(_arg0); end @@ -3151,7 +3211,6 @@ class RuboCop::Cop::Layout::LineLength < ::RuboCop::Cop::Base def extract_heredocs(ast); end def heredocs; end def highlight_start(line); end - def ignored_line?(line, line_index); end def line_in_heredoc?(line_number); end def line_in_permitted_heredoc?(line_number); end def max; end @@ -3295,6 +3354,8 @@ class RuboCop::Cop::Layout::MultilineMethodCallIndentation < ::RuboCop::Cop::Bas def autocorrect(corrector, node); end def base_source; end def extra_indentation(given_style, parent); end + def first_call_has_a_dot(node); end + def get_dot_right_above(node); end def message(node, lhs, rhs); end def no_base_message(lhs, rhs, node); end def offending_range(node, lhs, rhs, given_style); end @@ -3704,6 +3765,7 @@ class RuboCop::Cop::Layout::SpaceBeforeBrackets < ::RuboCop::Cop::Base private + def dot_before_brackets?(node, receiver_end_pos, selector_begin_pos); end def offense_range(node, begin_pos); end def offense_range_for_assignment(node, begin_pos); end def reference_variable_with_brackets?(node); end @@ -4046,6 +4108,7 @@ class RuboCop::Cop::LineBreakCorrector def remove_semicolon(node, corrector); end def semicolon(node); end + def trailing_class_definition?(token, body); end end end @@ -4465,6 +4528,9 @@ end RuboCop::Cop::Lint::DuplicateRegexpCharacterClassElement::MSG_REPEATED_ELEMENT = T.let(T.unsafe(nil), String) class RuboCop::Cop::Lint::DuplicateRequire < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + def on_new_investigation; end def on_send(node); end def require_call?(param0 = T.unsafe(nil)); end @@ -4609,8 +4675,8 @@ RuboCop::Cop::Lint::EnsureReturn::MSG = T.let(T.unsafe(nil), String) class RuboCop::Cop::Lint::ErbNewArguments < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp - extend ::RuboCop::Cop::TargetRubyVersion extend ::RuboCop::Cop::AutoCorrector + extend ::RuboCop::Cop::TargetRubyVersion def erb_new_with_non_keyword_arguments(param0 = T.unsafe(nil)); end def on_send(node); end @@ -5286,6 +5352,7 @@ RuboCop::Cop::Lint::RedundantDirGlobSort::RESTRICT_ON_SEND = T.let(T.unsafe(nil) class RuboCop::Cop::Lint::RedundantRequireStatement < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector + extend ::RuboCop::Cop::TargetRubyVersion def on_send(node); end def unnecessary_require_statement?(param0 = T.unsafe(nil)); end @@ -5458,17 +5525,15 @@ class RuboCop::Cop::Lint::ReturnInVoidContext < ::RuboCop::Cop::Base private - def method_name(context_node); end def non_void_context(return_node); end - def setter_method?(method_name); end - def void_context_method?(method_name); end end RuboCop::Cop::Lint::ReturnInVoidContext::MSG = T.let(T.unsafe(nil), String) class RuboCop::Cop::Lint::SafeNavigationChain < ::RuboCop::Cop::Base include ::RuboCop::Cop::AllowedMethods include ::RuboCop::Cop::NilMethods + extend ::RuboCop::Cop::TargetRubyVersion def bad_method?(param0 = T.unsafe(nil)); end def on_send(node); end @@ -5805,7 +5870,7 @@ end RuboCop::Cop::Lint::UnreachableCode::MSG = T.let(T.unsafe(nil), String) class RuboCop::Cop::Lint::UnreachableLoop < ::RuboCop::Cop::Base - include ::RuboCop::Cop::IgnoredPattern + include ::RuboCop::Cop::AllowedPattern def break_command?(param0 = T.unsafe(nil)); end def on_block(node); end @@ -5956,12 +6021,6 @@ end RuboCop::Cop::Lint::UselessAssignment::MSG = T.let(T.unsafe(nil), String) -class RuboCop::Cop::Lint::UselessElseWithoutRescue < ::RuboCop::Cop::Base - def on_new_investigation; end -end - -RuboCop::Cop::Lint::UselessElseWithoutRescue::MSG = T.let(T.unsafe(nil), String) - class RuboCop::Cop::Lint::UselessMethodDefinition < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector @@ -6311,6 +6370,7 @@ class RuboCop::Cop::Metrics::Utils::CodeLengthCalculator private + def another_args?(node); end def build_foldable_checks(types); end def classlike_code_length(node); end def classlike_node?(node); end @@ -6325,6 +6385,8 @@ class RuboCop::Cop::Metrics::Utils::CodeLengthCalculator def line_numbers_of_inner_nodes(node, *types); end def namespace_module?(node); end def normalize_foldable_types(types); end + def omit_length(descendant); end + def parenthesized?(node); end end RuboCop::Cop::Metrics::Utils::CodeLengthCalculator::CLASSLIKE_TYPES = T.let(T.unsafe(nil), Array) @@ -6734,7 +6796,7 @@ class RuboCop::Cop::Naming::MethodName < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::ConfigurableFormatting include ::RuboCop::Cop::ConfigurableNaming - include ::RuboCop::Cop::IgnoredPattern + include ::RuboCop::Cop::AllowedPattern include ::RuboCop::Cop::RangeHelp def on_def(node); end @@ -6801,6 +6863,7 @@ class RuboCop::Cop::Naming::VariableName < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::ConfigurableFormatting include ::RuboCop::Cop::ConfigurableNaming + include ::RuboCop::Cop::AllowedPattern def on_arg(node); end def on_blockarg(node); end @@ -6813,6 +6876,7 @@ class RuboCop::Cop::Naming::VariableName < ::RuboCop::Cop::Base def on_lvasgn(node); end def on_optarg(node); end def on_restarg(node); end + def valid_name?(node, name, given_style = T.unsafe(nil)); end private @@ -6826,14 +6890,17 @@ class RuboCop::Cop::Naming::VariableNumber < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::ConfigurableFormatting include ::RuboCop::Cop::ConfigurableNumbering + include ::RuboCop::Cop::AllowedPattern def on_arg(node); end def on_cvasgn(node); end def on_def(node); end def on_defs(node); end + def on_gvasgn(node); end def on_ivasgn(node); end def on_lvasgn(node); end def on_sym(node); end + def valid_name?(node, name, given_style = T.unsafe(nil)); end private @@ -7196,6 +7263,23 @@ end module RuboCop::Cop::Security; end +class RuboCop::Cop::Security::CompoundHash < ::RuboCop::Cop::Base + def bad_hash_combinator?(param0 = T.unsafe(nil)); end + def contained_in_hash_method?(node, &block); end + def dynamic_hash_method_definition?(param0 = T.unsafe(nil)); end + def hash_method_definition?(param0 = T.unsafe(nil)); end + def monuple_hash?(param0 = T.unsafe(nil)); end + def on_op_asgn(node); end + def on_send(node); end + def outer_bad_hash_combinator?(node); end + def redundant_hash?(param0 = T.unsafe(nil)); end + def static_hash_method_definition?(param0 = T.unsafe(nil)); end +end + +RuboCop::Cop::Security::CompoundHash::COMBINATOR_IN_HASH_MSG = T.let(T.unsafe(nil), String) +RuboCop::Cop::Security::CompoundHash::MONUPLE_HASH_MSG = T.let(T.unsafe(nil), String) +RuboCop::Cop::Security::CompoundHash::REDUNDANT_HASH_MSG = T.let(T.unsafe(nil), String) + class RuboCop::Cop::Security::Eval < ::RuboCop::Cop::Base def eval?(param0 = T.unsafe(nil)); end def on_send(node); end @@ -7691,6 +7775,7 @@ class RuboCop::Cop::Style::BlockDelimiters < ::RuboCop::Cop::Base def special_method_proper_block_style?(node); end def whitespace_after?(range, length = T.unsafe(nil)); end def whitespace_before?(range); end + def with_block?(node); end end RuboCop::Cop::Style::BlockDelimiters::ALWAYS_BRACES_MESSAGE = T.let(T.unsafe(nil), String) @@ -7891,7 +7976,7 @@ class RuboCop::Cop::Style::CollectionCompact < ::RuboCop::Cop::Base private - def good_method_name(method_name); end + def good_method_name(node); end def offense_range(node); end def range(begin_pos_node, end_pos_node); end end @@ -8172,6 +8257,7 @@ RuboCop::Cop::Style::DefWithParentheses::MSG = T.let(T.unsafe(nil), String) class RuboCop::Cop::Style::Dir < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector + extend ::RuboCop::Cop::TargetRubyVersion def dir_replacement?(param0 = T.unsafe(nil)); end def on_send(node); end @@ -8283,6 +8369,7 @@ class RuboCop::Cop::Style::DoubleNegation < ::RuboCop::Cop::Base private def allowed_in_returns?(node); end + def define_mehod?(node); end def double_negative_condition_return_value?(node, last_child, conditional_node); end def end_of_method_definition?(node); end def find_conditional_node_from_ascendant(node); end @@ -8491,6 +8578,16 @@ RuboCop::Cop::Style::EndlessMethod::CORRECTION_STYLES = T.let(T.unsafe(nil), Arr RuboCop::Cop::Style::EndlessMethod::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Style::EndlessMethod::MSG_MULTI_LINE = T.let(T.unsafe(nil), String) +class RuboCop::Cop::Style::EnvHome < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + def env_home?(param0 = T.unsafe(nil)); end + def on_send(node); end +end + +RuboCop::Cop::Style::EnvHome::MSG = T.let(T.unsafe(nil), String) +RuboCop::Cop::Style::EnvHome::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + class RuboCop::Cop::Style::EvalWithLocation < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector @@ -8606,6 +8703,51 @@ end RuboCop::Cop::Style::ExponentialNotation::MESSAGES = T.let(T.unsafe(nil), Hash) +class RuboCop::Cop::Style::FetchEnvVar < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + def block_control?(param0 = T.unsafe(nil)); end + def env_with_bracket?(param0 = T.unsafe(nil)); end + def offensive_nodes(param0); end + def on_send(node); end + def operand_of_or?(param0 = T.unsafe(nil)); end + + private + + def allowable_use?(node); end + def allowed_var?(node); end + def assigned?(node); end + def configured_indentation; end + def conterpart_rhs_of(node); end + def default_nil(node, name_node); end + def default_rhs(node, name_node); end + def default_rhs_in_outer_or(node, name_node); end + def default_rhs_in_same_or(node, name_node); end + def default_to_rhs?(node); end + def first_line_of(source); end + def left_end_of_or_chains?(node); end + def message_chained_with_dot?(node); end + def message_template_for(rhs); end + def new_code_default_nil(name_node); end + def new_code_default_rhs(node, name_node); end + def new_code_default_rhs_multiline(node, name_node); end + def new_code_default_rhs_single_line(node, name_node); end + def offensive?(node); end + def or_chain_root(node); end + def partial_matched?(node, condition); end + def rhs_can_be_default_value?(node); end + def rhs_is_block_control?(node); end + def right_end_of_or_chains?(node); end + def used_as_flag?(node); end + def used_if_condition_in_body(node); end + def used_in_condition?(node, condition); end +end + +RuboCop::Cop::Style::FetchEnvVar::MSG_DEFAULT_NIL = T.let(T.unsafe(nil), String) +RuboCop::Cop::Style::FetchEnvVar::MSG_DEFAULT_RHS_MULTILINE_BLOCK = T.let(T.unsafe(nil), String) +RuboCop::Cop::Style::FetchEnvVar::MSG_DEFAULT_RHS_SECOND_ARG_OF_FETCH = T.let(T.unsafe(nil), String) +RuboCop::Cop::Style::FetchEnvVar::MSG_DEFAULT_RHS_SINGLE_LINE_BLOCK = T.let(T.unsafe(nil), String) + class RuboCop::Cop::Style::FileRead < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector @@ -8739,6 +8881,7 @@ class RuboCop::Cop::Style::FrozenStringLiteralComment < ::RuboCop::Cop::Base include ::RuboCop::Cop::FrozenStringLiteral include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector + extend ::RuboCop::Cop::TargetRubyVersion def on_new_investigation; end @@ -8806,7 +8949,9 @@ class RuboCop::Cop::Style::GuardClause < ::RuboCop::Cop::Base def accepted_form?(node, ending: T.unsafe(nil)); end def accepted_if?(node, ending); end + def allowed_consecutive_conditionals?; end def check_ending_if(node); end + def consecutive_conditionals?(parent, node); end def guard_clause_source(guard_clause); end def opposite_keyword(node); end def register_offense(node, scope_exiting_keyword, conditional_keyword); end @@ -8945,6 +9090,7 @@ RuboCop::Cop::Style::HashSyntax::MSG_NO_MIXED_KEYS = T.let(T.unsafe(nil), String class RuboCop::Cop::Style::HashTransformKeys < ::RuboCop::Cop::Base include ::RuboCop::Cop::HashTransformMethod extend ::RuboCop::Cop::AutoCorrector + extend ::RuboCop::Cop::TargetRubyVersion def on_bad_each_with_object(param0 = T.unsafe(nil)); end def on_bad_hash_brackets_map(param0 = T.unsafe(nil)); end @@ -8960,6 +9106,7 @@ end class RuboCop::Cop::Style::HashTransformValues < ::RuboCop::Cop::Base include ::RuboCop::Cop::HashTransformMethod extend ::RuboCop::Cop::AutoCorrector + extend ::RuboCop::Cop::TargetRubyVersion def on_bad_each_with_object(param0 = T.unsafe(nil)); end def on_bad_hash_brackets_map(param0 = T.unsafe(nil)); end @@ -9031,18 +9178,18 @@ RuboCop::Cop::Style::IfInsideElse::MSG = T.let(T.unsafe(nil), String) class RuboCop::Cop::Style::IfUnlessModifier < ::RuboCop::Cop::Base include ::RuboCop::Cop::LineLengthHelp include ::RuboCop::Cop::StatementModifier - include ::RuboCop::Cop::IgnoredPattern + include ::RuboCop::Cop::AllowedPattern include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector def on_if(node); end private + def allowed_patterns; end def another_statement_on_same_line?(node); end def autocorrect(corrector, node); end def extract_heredoc_from(last_argument); end - def ignored_patterns; end def line_length_enabled_at_line?(line); end def named_capture_in_condition?(node); end def non_eligible_node?(node); end @@ -9306,6 +9453,23 @@ RuboCop::Cop::Style::LineEndConcatenation::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Style::LineEndConcatenation::QUOTE_DELIMITERS = T.let(T.unsafe(nil), Array) RuboCop::Cop::Style::LineEndConcatenation::SIMPLE_STRING_TOKEN_TYPE = T.let(T.unsafe(nil), Symbol) +class RuboCop::Cop::Style::MapCompactWithConditionalBlock < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + def map_and_compact?(param0 = T.unsafe(nil)); end + def on_send(node); end + + private + + def range(node); end + def returns_block_argument?(block_argument_node, return_value_node); end + def truthy_branch?(node); end + def truthy_branch_for_guard?(node); end + def truthy_branch_for_if?(node); end +end + +RuboCop::Cop::Style::MapCompactWithConditionalBlock::MSG = T.let(T.unsafe(nil), String) + class RuboCop::Cop::Style::MapToHash < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector @@ -9325,7 +9489,7 @@ RuboCop::Cop::Style::MapToHash::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) class RuboCop::Cop::Style::MethodCallWithArgsParentheses < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::IgnoredMethods - include ::RuboCop::Cop::IgnoredPattern + include ::RuboCop::Cop::AllowedPattern include ::RuboCop::Cop::Style::MethodCallWithArgsParentheses::RequireParentheses include ::RuboCop::Cop::Style::MethodCallWithArgsParentheses::OmitParentheses extend ::RuboCop::Cop::IgnoredMethods::Config @@ -9657,10 +9821,15 @@ class RuboCop::Cop::Style::MultilineTernaryOperator < ::RuboCop::Cop::Base private + def enforce_single_line_ternary_operator?(node); end def offense?(node); end + def replacement(node); end + def use_assignment_method?(node); end end -RuboCop::Cop::Style::MultilineTernaryOperator::MSG = T.let(T.unsafe(nil), String) +RuboCop::Cop::Style::MultilineTernaryOperator::MSG_IF = T.let(T.unsafe(nil), String) +RuboCop::Cop::Style::MultilineTernaryOperator::MSG_SINGLE_LINE = T.let(T.unsafe(nil), String) +RuboCop::Cop::Style::MultilineTernaryOperator::SINGLE_LINE_TYPES = T.let(T.unsafe(nil), Array) class RuboCop::Cop::Style::MultilineWhenThen < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp @@ -10093,13 +10262,30 @@ class RuboCop::Cop::Style::NumericPredicate < ::RuboCop::Cop::Base def invert; end def parenthesized_source(node); end def replacement(numeric, operation); end + def replacement_supported?(operator); end def require_parentheses?(node); end end RuboCop::Cop::Style::NumericPredicate::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Style::NumericPredicate::REPLACEMENTS = T.let(T.unsafe(nil), Hash) RuboCop::Cop::Style::NumericPredicate::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) +class RuboCop::Cop::Style::ObjectThen < ::RuboCop::Cop::Base + include ::RuboCop::Cop::ConfigurableEnforcedStyle + extend ::RuboCop::Cop::AutoCorrector + + def on_block(node); end + def on_send(node); end + + private + + def check_method_node(node); end + def message(node); end + def preferred_method(node); end +end + +RuboCop::Cop::Style::ObjectThen::MSG = T.let(T.unsafe(nil), String) + class RuboCop::Cop::Style::OneLineConditional < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::OnNormalIfUnless @@ -10485,13 +10671,15 @@ class RuboCop::Cop::Style::RedundantBegin < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector + def offensive_kwbegins(param0); end def on_block(node); end def on_def(node); end def on_defs(node); end def on_kwbegin(node); end private + def allowable_kwbegin?(node); end def begin_block_has_multiline_statements?(node); end def condition_range(node); end def contain_rescue_or_ensure?(node); end @@ -10530,13 +10718,24 @@ class RuboCop::Cop::Style::RedundantCondition < ::RuboCop::Cop::Base private + def asgn_type?(node); end + def branches_have_assignment?(node); end + def branches_have_method?(node); end def correct_ternary(corrector, node); end def else_source(else_branch); end + def else_source_if_has_assignment(else_branch); end + def else_source_if_has_method(else_branch); end + def if_source(if_branch); end def make_ternary_form(node); end def message(node); end def offense?(node); end def range_of_offense(node); end + def redundant_condition?(node); end + def require_braces?(node); end def require_parentheses?(node); end + def same_method?(if_branch, else_branch); end + def synonymous_condition_and_branch?(node); end + def use_hash_key_access?(node); end def use_hash_key_assignment?(else_branch); end def use_if_branch?(else_branch); end def without_argument_parentheses_method?(node); end @@ -10635,12 +10834,19 @@ RuboCop::Cop::Style::RedundantFreeze::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Style::RedundantFreeze::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) class RuboCop::Cop::Style::RedundantInitialize < ::RuboCop::Cop::Base + include ::RuboCop::Cop::CommentsHelp + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + def initialize_forwards?(param0 = T.unsafe(nil)); end def on_def(node); end private + def acceptable?(node); end + def allow_comments?(node); end def forwards?(node); end + def register_offense(node, message); end def same_args?(super_node, args); end end @@ -10757,6 +10963,7 @@ class RuboCop::Cop::Style::RedundantRegexpCharacterClass < ::RuboCop::Cop::Base def backslash_b?(elem); end def each_redundant_character_class(node); end def each_single_element_character_class(node); end + def multiple_codepoins?(expression); end def redundant_single_element_character_class?(node, char_class); end def requires_escape_outside_char_class?(elem); end def whitespace_in_free_space_mode?(node, elem); end @@ -10999,7 +11206,7 @@ class RuboCop::Cop::Style::RescueStandardError < ::RuboCop::Cop::Base private - def offense_for_exlicit_enforced_style(node); end + def offense_for_explicit_enforced_style(node); end def offense_for_implicit_enforced_style(node, error); end end @@ -11031,6 +11238,7 @@ class RuboCop::Cop::Style::SafeNavigation < ::RuboCop::Cop::Base include ::RuboCop::Cop::NilMethods include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector + extend ::RuboCop::Cop::TargetRubyVersion def check_node(node); end def modifier_if_safe_navigation_candidate(param0 = T.unsafe(nil)); end @@ -11276,14 +11484,16 @@ class RuboCop::Cop::Style::SoleNestedConditional < ::RuboCop::Cop::Base def autocorrect_outer_condition_modify_form(corrector, node, if_branch); end def correct_for_basic_condition_style(corrector, node, if_branch, and_operator); end def correct_for_comment(corrector, node, if_branch); end - def correct_for_guard_condition_style(corrector, node, if_branch, and_operator); end + def correct_for_guard_condition_style(corrector, outer_condition, if_branch, and_operator); end def correct_for_outer_condition_modify_form_style(corrector, node, if_branch); end def correct_from_unless_to_if(corrector, node, is_modify_form: T.unsafe(nil)); end def correct_outer_condition(corrector, condition); end + def insert_bang(corrector, node, is_modify_form); end + def insert_bang_for_and(corrector, node); end def offending_branch?(node, branch); end def outer_condition_modify_form?(node, if_branch); end def replace_condition(condition); end - def requrie_parentheses?(condition); end + def require_parentheses?(condition); end def use_variable_assignment_in_condition?(condition, if_branch); end def wrap_condition?(node); end @@ -11303,6 +11513,7 @@ class RuboCop::Cop::Style::SpecialGlobalVars < ::RuboCop::Cop::Base def autocorrect(corrector, node, global_var); end def message(global_var); end def on_gvar(node); end + def on_new_investigation; end private @@ -11311,18 +11522,21 @@ class RuboCop::Cop::Style::SpecialGlobalVars < ::RuboCop::Cop::Base def format_english_message(global_var); end def format_list(items); end def format_message(english, regular, global); end + def matching_styles(global); end def preferred_names(global); end def replacement(node, global_var); end def should_require_english?(global_var); end end +RuboCop::Cop::Style::SpecialGlobalVars::BUILTIN_VARS = T.let(T.unsafe(nil), Hash) RuboCop::Cop::Style::SpecialGlobalVars::ENGLISH_VARS = T.let(T.unsafe(nil), Hash) RuboCop::Cop::Style::SpecialGlobalVars::LIBRARY_NAME = T.let(T.unsafe(nil), String) RuboCop::Cop::Style::SpecialGlobalVars::MSG_BOTH = T.let(T.unsafe(nil), String) RuboCop::Cop::Style::SpecialGlobalVars::MSG_ENGLISH = T.let(T.unsafe(nil), String) RuboCop::Cop::Style::SpecialGlobalVars::MSG_REGULAR = T.let(T.unsafe(nil), String) RuboCop::Cop::Style::SpecialGlobalVars::NON_ENGLISH_VARS = T.let(T.unsafe(nil), Set) RuboCop::Cop::Style::SpecialGlobalVars::PERL_VARS = T.let(T.unsafe(nil), Hash) +RuboCop::Cop::Style::SpecialGlobalVars::STYLE_VARS_MAP = T.let(T.unsafe(nil), Hash) class RuboCop::Cop::Style::StabbyLambdaParentheses < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle @@ -11403,7 +11617,7 @@ class RuboCop::Cop::Style::StringConcatenation < ::RuboCop::Cop::Base def handle_quotes(parts); end def heredoc?(node); end def line_end_concatenation?(node); end - def offensive_for_mode?(receiver_node); end + def mode; end def plus_node?(node); end def register_offense(topmost_plus_node, parts); end def replacement(parts); end @@ -11531,6 +11745,7 @@ class RuboCop::Cop::Style::SymbolArray < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::PercentArray extend ::RuboCop::Cop::AutoCorrector + extend ::RuboCop::Cop::TargetRubyVersion def on_array(node); end @@ -11559,6 +11774,7 @@ end RuboCop::Cop::Style::SymbolLiteral::MSG = T.let(T.unsafe(nil), String) class RuboCop::Cop::Style::SymbolProc < ::RuboCop::Cop::Base + include ::RuboCop::Cop::CommentsHelp include ::RuboCop::Cop::RangeHelp include ::RuboCop::Cop::IgnoredMethods extend ::RuboCop::Cop::IgnoredMethods::Config @@ -11573,7 +11789,8 @@ class RuboCop::Cop::Style::SymbolProc < ::RuboCop::Cop::Base private - def allow_if_method_has_argument?(node); end + def allow_comments?; end + def allow_if_method_has_argument?(send_node); end def autocorrect(corrector, node); end def autocorrect_with_args(corrector, node, args, method_name); end def autocorrect_without_args(corrector, node); end @@ -11791,11 +12008,11 @@ class RuboCop::Cop::Style::TrivialAccessors < ::RuboCop::Cop::Base def allowed_method_name?(node); end def allowed_method_names; end def allowed_reader?(node); end - def allowed_writer?(method_name); end + def allowed_writer?(node); end def autocorrect(corrector, node); end def autocorrect_class(corrector, node); end def autocorrect_instance(corrector, node); end - def dsl_writer?(method_name); end + def dsl_writer?(node); end def exact_name_match?; end def ignore_class_methods?; end def in_module_or_instance_eval?(node); end @@ -11841,6 +12058,7 @@ RuboCop::Cop::Style::UnlessLogicalOperators::FORBID_MIXED_LOGICAL_OPERATORS = T. class RuboCop::Cop::Style::UnpackFirst < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector + extend ::RuboCop::Cop::TargetRubyVersion def on_send(node); end def unpack_and_first_element?(param0 = T.unsafe(nil)); end @@ -12763,10 +12981,11 @@ class RuboCop::Formatter::DisabledConfigFormatter < ::RuboCop::Formatter::BaseFo def output_exclude_path(output_buffer, exclude_path, parent); end def output_offending_files(output_buffer, cfg, cop_name); end def output_offenses; end + def safe_autocorrect?(config); end def set_max(cfg, cop_name); end def show_offense_counts?; end def show_timestamp?; end - def supports_safe_auto_correct?(cop_class, default_cfg); end + def supports_safe_autocorrect?(cop_class, default_cfg); end def supports_unsafe_autocorrect?(cop_class, default_cfg); end def timestamp; end @@ -12955,6 +13174,28 @@ class RuboCop::Formatter::JUnitFormatter < ::RuboCop::Formatter::BaseFormatter def reset_count; end end +class RuboCop::Formatter::MarkdownFormatter < ::RuboCop::Formatter::BaseFormatter + include ::RuboCop::Formatter::TextUtil + include ::RuboCop::PathUtil + + def initialize(output, options = T.unsafe(nil)); end + + def file_finished(file, offenses); end + def files; end + def finished(inspected_files); end + def started(target_files); end + def summary; end + + private + + def possible_ellipses(location); end + def render_markdown; end + def write_code(offense); end + def write_context(offense); end + def write_file_messages; end + def write_heading(file); end +end + class RuboCop::Formatter::OffenseCountFormatter < ::RuboCop::Formatter::BaseFormatter def file_finished(_file, offenses); end def finished(_inspected_files); end @@ -12984,8 +13225,8 @@ end RuboCop::Formatter::PacmanFormatter::FALLBACK_TERMINAL_WIDTH = T.let(T.unsafe(nil), Integer) RuboCop::Formatter::PacmanFormatter::GHOST = T.let(T.unsafe(nil), String) -RuboCop::Formatter::PacmanFormatter::PACDOT = T.let(T.unsafe(nil), Rainbow::Presenter) -RuboCop::Formatter::PacmanFormatter::PACMAN = T.let(T.unsafe(nil), Rainbow::Presenter) +RuboCop::Formatter::PacmanFormatter::PACDOT = T.let(T.unsafe(nil), Rainbow::NullPresenter) +RuboCop::Formatter::PacmanFormatter::PACMAN = T.let(T.unsafe(nil), Rainbow::NullPresenter) class RuboCop::Formatter::ProgressFormatter < ::RuboCop::Formatter::ClangStyleFormatter include ::RuboCop::Formatter::TextUtil @@ -13096,6 +13337,8 @@ class RuboCop::MagicComment def frozen_string_literal_specified?; end def shareable_constant_value; end def shareable_constant_value_specified?; end + def typed; end + def typed_specified?; end def valid?; end def valid_literal_value?; end def valid_shareable_constant_value?; end @@ -13125,6 +13368,7 @@ class RuboCop::MagicComment::EmacsComment < ::RuboCop::MagicComment::EditorComme def extract_frozen_string_literal; end def extract_shareable_constant_value; end + def extract_typed; end end RuboCop::MagicComment::EmacsComment::FORMAT = T.let(T.unsafe(nil), String) @@ -13141,12 +13385,14 @@ class RuboCop::MagicComment::SimpleComment < ::RuboCop::MagicComment def extract_frozen_string_literal; end def extract_shareable_constant_value; end + def extract_typed; end end RuboCop::MagicComment::TOKEN = T.let(T.unsafe(nil), Regexp) class RuboCop::MagicComment::VimComment < ::RuboCop::MagicComment::EditorComment def encoding; end + def extract_typed; end def frozen_string_literal; end def shareable_constant_value; end end @@ -13191,6 +13437,7 @@ class RuboCop::Options def args_from_env; end def args_from_file; end def define_options; end + def handle_deprecated_option(old_option, new_option); end def long_opt_symbol(args); end def option(opts, *args); end def rainbow; end @@ -13214,13 +13461,16 @@ class RuboCop::OptionsValidator def display_only_fail_level_offenses_with_autocorrect?; end def except_syntax?; end def incompatible_options; end + def invalid_arguments_for_parallel; end def only_includes_redundant_disable?; end - def validate_auto_correct; end def validate_auto_gen_config; end + def validate_autocorrect; end def validate_cache_enabled_for_cache_root; end def validate_compatibility; end def validate_cop_options; end + def validate_display_only_correctable_and_autocorrect; end def validate_display_only_failed; end + def validate_display_only_failed_and_display_only_correctable; end def validate_exclude_limit_option; end class << self @@ -13343,6 +13593,7 @@ class RuboCop::Runner def check_for_infinite_loop(processed_source, offenses_by_iteration); end def check_for_redundant_disables?(source); end def considered_failure?(offense); end + def default_config(cop_name); end def do_inspection_loop(file); end def each_inspected_file(files); end def file_finished(file, offenses); end @@ -13358,15 +13609,18 @@ class RuboCop::Runner def inspect_files(files); end def iterate_until_no_changes(source, offenses_by_iteration); end def list_files(paths); end + def mark_as_safe_by_config?(config); end def minimum_severity_to_fail; end def mobilize_team(processed_source); end def mobilized_cop_classes(config); end + def offenses_to_report(offenses); end def process_file(file); end def qualify_option_cop_names; end def redundant_cop_disable_directive(file); end def save_in_cache(cache, offenses); end def standby_team(config); end def style_guide_cops_only?(config); end + def supports_safe_autocorrect?(offense); end def team_for_redundant_disables(file, offenses, source); end def warm_cache(target_files); end end @@ -13469,7 +13723,7 @@ class RuboCop::TargetRuby::GemspecFile < ::RuboCop::TargetRuby::Source private - def find_minimal_known_ruby(right_hand_side); end + def find_default_minimal_known_ruby(right_hand_side); end def find_version; end def gemspec_filename; end def gemspec_filepath; end
true
Other
Homebrew
brew
ad5391830283973b20522b1d2616a7310727ecbc.json
Update RBI files for rubocop.
Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi
@@ -4942,6 +4942,8 @@ module RuboCop::AST::NodePattern::Sets SET_INCLUDE_WITH_WITHOUT = ::T.let(nil, ::T.untyped) SET_SYSTEM_SHELL_OUTPUT_PIPE_OUTPUT = ::T.let(nil, ::T.untyped) SET_WITH_WITHOUT = ::T.let(nil, ::T.untyped) + SET__FETCH = ::T.let(nil, ::T.untyped) + SET_____2 = ::T.let(nil, ::T.untyped) end class RuboCop::Cask::AST::CaskHeader
true
Other
Homebrew
brew
502769bb85bdc63dcca144ba63e4c50f8f1eec7a.json
Update RBI files for rubocop-sorbet.
Library/Homebrew/sorbet/rbi/gems/rubocop-sorbet@0.6.10.rbi
@@ -166,6 +166,11 @@ class RuboCop::Cop::Sorbet::ForbidTUnsafe < ::RuboCop::Cop::Cop def t_unsafe?(param0 = T.unsafe(nil)); end end +class RuboCop::Cop::Sorbet::ForbidTUntyped < ::RuboCop::Cop::Cop + def on_send(node); end + def t_untyped?(param0 = T.unsafe(nil)); end +end + class RuboCop::Cop::Sorbet::ForbidUntypedStructProps < ::RuboCop::Cop::Cop def on_class(node); end def subclass_of_t_struct?(param0 = T.unsafe(nil)); end
false
Other
Homebrew
brew
15cf890ed747babbcc32a1ac9283ea2f56e3a019.json
Fix caveats when loading from the API
Library/Homebrew/formulary.rb
@@ -203,7 +203,7 @@ def install @caveats_string = json_formula["caveats"] def caveats - @caveats_string + self.class.instance_variable_get(:@caveats_string) end end
true
Other
Homebrew
brew
15cf890ed747babbcc32a1ac9283ea2f56e3a019.json
Fix caveats when loading from the API
Library/Homebrew/test/formulary_spec.rb
@@ -241,7 +241,7 @@ def formula_json_contents(extra_items = {}) "recommended_dependencies" => ["recommended_dep"], "optional_dependencies" => ["optional_dep"], "uses_from_macos" => ["uses_from_macos_dep"], - "caveats" => "", + "caveats" => "example caveat string", }.merge(extra_items), } end @@ -276,6 +276,7 @@ def formula_json_contents(extra_items = {}) expect(formula.deps.count).to eq 5 end expect(formula.uses_from_macos_elements).to eq ["uses_from_macos_dep"] + expect(formula.caveats).to eq "example caveat string" expect { formula.install }.to raise_error("Cannot build from source from abstract formula.")
true
Other
Homebrew
brew
37306fb044e7876bb513d078202ac41339d89f24.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
@@ -2391,6 +2391,12 @@ module Hardware extend ::T::Private::Methods::SingletonMethodHooks end +class Hash + def deep_transform_values(&block); end + + def deep_transform_values!(&block); end +end + module Homebrew MAX_PORT = ::T.let(nil, ::T.untyped) MIN_PORT = ::T.let(nil, ::T.untyped) @@ -2400,10 +2406,6 @@ module Homebrew::API::Analytics extend ::T::Private::Methods::SingletonMethodHooks end -module Homebrew::API::Bottle - extend ::T::Private::Methods::SingletonMethodHooks -end - module Homebrew::API::Cask extend ::T::Private::Methods::SingletonMethodHooks end @@ -2512,6 +2514,8 @@ module Homebrew::EnvConfig def self.git_name(); end + def self.git_path(); end + def self.github_api_token(); end def self.github_packages_token(); end
false
Other
Homebrew
brew
547d3c9e0fb3970f83925ee0aa237c0d2cfa8714.json
.rubocop.yml: enable some new cops from rubocop-rails 2.15.0
Library/.rubocop.yml
@@ -237,6 +237,10 @@ Rails/SafeNavigation: Enabled: true Rails/SafeNavigationWithBlank: Enabled: true +Rails/StripHeredoc: + Enabled: true +Rails/ToFormattedS: + Enabled: true # Don't allow cops to be disabled in casks and formulae. Style/DisableCopsWithinSourceCodeDirective:
false
Other
Homebrew
brew
0ea9f5ec808c2ee843bf0cd84e061d9aaed8df8e.json
Add tests for convert_to_string_or_symbol
Library/Homebrew/test/formulary_spec.rb
@@ -345,6 +345,16 @@ def formula_json_contents(extra_items = {}) end end + describe "::convert_to_string_or_symbol" do + it "returns the original string if it doesn't start with a colon" do + expect(described_class.convert_to_string_or_symbol("foo")).to eq "foo" + end + + it "returns a symbol if the original string starts with a colon" do + expect(described_class.convert_to_string_or_symbol(":foo")).to eq :foo + end + end + describe "::convert_to_deprecate_disable_reason_string_or_symbol" do it "returns the original string if it isn't a preset reason" do expect(described_class.convert_to_deprecate_disable_reason_string_or_symbol("foo")).to eq "foo"
false
Other
Homebrew
brew
98f8a86af3b09f52a2a1e1dc924e569a2fde3bfe.json
Clarify TODO in `brew update` Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
Library/Homebrew/cmd/update.sh
@@ -748,7 +748,7 @@ EOS if [[ -n "${HOMEBREW_INSTALL_FROM_API}" ]] then mkdir -p "${HOMEBREW_CACHE}/api" - # TODO: etags? +# TODO: use --header If-Modified-Since curl \ "${CURL_DISABLE_CURLRC_ARGS[@]}" \ --fail --compressed --silent --max-time 5 \
false
Other
Homebrew
brew
8c8c6964c8371988b8d7831b2c2141596b67c814.json
Add more API test coverage
Library/Homebrew/test/formulary_spec.rb
@@ -236,11 +236,11 @@ def formula_json_contents(extra_items = {}) "reason" => ":provided_by_macos", "explanation" => "", }, - "build_dependencies" => [], - "dependencies" => [], - "recommended_dependencies" => [], - "optional_dependencies" => [], - "uses_from_macos" => [], + "build_dependencies" => ["build_dep"], + "dependencies" => ["dep"], + "recommended_dependencies" => ["recommended_dep"], + "optional_dependencies" => ["optional_dep"], + "uses_from_macos" => ["uses_from_macos_dep"], "caveats" => "", }.merge(extra_items), } @@ -270,6 +270,8 @@ def formula_json_contents(extra_items = {}) formula = described_class.factory(formula_name) expect(formula).to be_kind_of(Formula) expect(formula.keg_only_reason.reason).to eq :provided_by_macos + expect(formula.deps.count).to eq 4 + expect(formula.uses_from_macos_elements).to eq ["uses_from_macos_dep"] expect { formula.install }.to raise_error("Cannot build from source from abstract formula.")
false
Other
Homebrew
brew
dd516e4355f6a22f21cc8cc15546162c3df57473.json
Expand `Formulary` test coverage
Library/Homebrew/test/formulary_spec.rb
@@ -26,44 +26,6 @@ def install end RUBY end - let(:formula_json_contents) do - { - formula_name => { - "desc" => "testball", - "homepage" => "https://example.com", - "license" => "MIT", - "revision" => 0, - "version_scheme" => 0, - "versions" => { "stable" => "0.1" }, - "urls" => { - "stable" => { - "url" => "file://#{TEST_FIXTURE_DIR}/tarballs/testball-0.1.tbz", - "tag" => nil, - "revision" => nil, - }, - }, - "bottle" => { - "stable" => { - "rebuild" => 0, - "root_url" => "file://#{bottle_dir}", - "files" => { - Utils::Bottles.tag.to_s => { - "cellar" => ":any", - "url" => "file://#{bottle_dir}/#{formula_name}", - "sha256" => "8f9aecd233463da6a4ea55f5f88fc5841718c013f3e2a7941350d6130f1dc149", - }, - }, - }, - }, - "build_dependencies" => [], - "dependencies" => [], - "recommended_dependencies" => [], - "optional_dependencies" => [], - "uses_from_macos" => [], - "caveats" => "", - }, - } - end let(:bottle_dir) { Pathname.new("#{TEST_FIXTURE_DIR}/bottles") } let(:bottle) { bottle_dir/"testball_bottle-0.1.#{Utils::Bottles.tag}.bottle.tar.gz" } @@ -241,14 +203,95 @@ class Wrong#{described_class.class_s(formula_name)} < Formula end context "when loading from the API" do + def formula_json_contents(extra_items = {}) + { + formula_name => { + "desc" => "testball", + "homepage" => "https://example.com", + "license" => "MIT", + "revision" => 0, + "version_scheme" => 0, + "versions" => { "stable" => "0.1" }, + "urls" => { + "stable" => { + "url" => "file://#{TEST_FIXTURE_DIR}/tarballs/testball-0.1.tbz", + "tag" => nil, + "revision" => nil, + }, + }, + "bottle" => { + "stable" => { + "rebuild" => 0, + "root_url" => "file://#{bottle_dir}", + "files" => { + Utils::Bottles.tag.to_s => { + "cellar" => ":any", + "url" => "file://#{bottle_dir}/#{formula_name}", + "sha256" => "8f9aecd233463da6a4ea55f5f88fc5841718c013f3e2a7941350d6130f1dc149", + }, + }, + }, + }, + "keg_only_reason" => { + "reason" => ":provided_by_macos", + "explanation" => "", + }, + "build_dependencies" => [], + "dependencies" => [], + "recommended_dependencies" => [], + "optional_dependencies" => [], + "uses_from_macos" => [], + "caveats" => "", + }.merge(extra_items), + } + end + + let(:deprecate_json) do + { + "deprecation_date" => "2022-06-15", + "deprecation_reason" => "repo_archived", + } + end + + let(:disable_json) do + { + "disable_date" => "2022-06-15", + "disable_reason" => "repo_archived", + } + end + before do allow(described_class).to receive(:loader_for).and_return(described_class::FormulaAPILoader.new(formula_name)) - allow(Homebrew::API::Formula).to receive(:all_formulae).and_return formula_json_contents end it "returns a Formula when given a name" do + allow(Homebrew::API::Formula).to receive(:all_formulae).and_return formula_json_contents + + formula = described_class.factory(formula_name) + expect(formula).to be_kind_of(Formula) + expect(formula.keg_only_reason.reason).to eq :provided_by_macos + expect { + formula.install + }.to raise_error("Cannot build from source from abstract formula.") + end + + it "returns a deprecated Formula when given a name" do + allow(Homebrew::API::Formula).to receive(:all_formulae).and_return formula_json_contents(deprecate_json) + + formula = described_class.factory(formula_name) + expect(formula).to be_kind_of(Formula) + expect(formula.deprecated?).to be true + expect { + formula.install + }.to raise_error("Cannot build from source from abstract formula.") + end + + it "returns a disabled Formula when given a name" do + allow(Homebrew::API::Formula).to receive(:all_formulae).and_return formula_json_contents(disable_json) + formula = described_class.factory(formula_name) expect(formula).to be_kind_of(Formula) + expect(formula.disabled?).to be true expect { formula.install }.to raise_error("Cannot build from source from abstract formula.")
false
Other
Homebrew
brew
1e536217b2cb4395f1ebe5c0ba5c8bf1db4e7926.json
Streamline loading casks from API
Library/Homebrew/cask/cask.rb
@@ -6,7 +6,6 @@ require "cask/dsl" require "cask/metadata" require "searchable" -require "api" module Cask # An instance of a cask. @@ -166,14 +165,7 @@ def outdated_versions(greedy: false, greedy_latest: false, greedy_auto_updates: # special case: tap version is not available return [] if version.nil? - latest_version = if Homebrew::EnvConfig.install_from_api? && - (latest_cask_version = Homebrew::API::Versions.latest_cask_version(token)) - DSL::Version.new latest_cask_version.to_s - else - version - end - - if latest_version.latest? + if version.latest? return versions if (greedy || greedy_latest) && outdated_download_sha? return [] @@ -185,10 +177,10 @@ def outdated_versions(greedy: false, greedy_latest: false, greedy_auto_updates: current = installed.last # not outdated unless there is a different version on tap - return [] if current == latest_version + return [] if current == version # collect all installed versions that are different than tap version and return them - installed.reject { |v| v == latest_version } + installed.reject { |v| v == version } end def outdated_info(greedy, verbose, json, greedy_latest, greedy_auto_updates)
true
Other
Homebrew
brew
1e536217b2cb4395f1ebe5c0ba5c8bf1db4e7926.json
Streamline loading casks from API
Library/Homebrew/cask/cask_loader.rb
@@ -214,7 +214,15 @@ def self.for(ref) FromTapPathLoader, FromPathLoader, ].each do |loader_class| - return loader_class.new(ref) if loader_class.can_load?(ref) + next unless loader_class.can_load?(ref) + + if loader_class == FromTapLoader && Homebrew::EnvConfig.install_from_api? && + ref.start_with?("homebrew/cask/") && !Tap.fetch("homebrew/cask").installed? && + Homebrew::API::CaskSource.available?(ref) + return FromContentLoader.new(Homebrew::API::CaskSource.fetch(ref)) + end + + return loader_class.new(ref) end return FromTapPathLoader.new(default_path(ref)) if FromTapPathLoader.can_load?(default_path(ref)) @@ -231,6 +239,10 @@ def self.for(ref) EOS end + if Homebrew::EnvConfig.install_from_api? && Homebrew::API::CaskSource.available?(ref) + return FromContentLoader.new(Homebrew::API::CaskSource.fetch(ref)) + end + possible_installed_cask = Cask.new(ref) return FromPathLoader.new(possible_installed_cask.installed_caskfile) if possible_installed_cask.installed?
true
Other
Homebrew
brew
1e536217b2cb4395f1ebe5c0ba5c8bf1db4e7926.json
Streamline loading casks from API
Library/Homebrew/cask/caskroom.rb
@@ -49,7 +49,8 @@ def self.casks(config: nil) begin if (tap_path = CaskLoader.tap_paths(token).first) CaskLoader::FromTapPathLoader.new(tap_path).load(config: config) - elsif (caskroom_path = Pathname.glob(path.join(".metadata/*/*/*/*.rb")).first) + elsif (caskroom_path = Pathname.glob(path.join(".metadata/*/*/*/*.rb")).first) && + (!Homebrew::EnvConfig.install_from_api? || !Homebrew::API::CaskSource.available?(token)) CaskLoader::FromPathLoader.new(caskroom_path).load(config: config) else CaskLoader.load(token, config: config)
true
Other
Homebrew
brew
1e536217b2cb4395f1ebe5c0ba5c8bf1db4e7926.json
Streamline loading casks from API
Library/Homebrew/cli/named_args.rb
@@ -45,18 +45,16 @@ def to_formulae # the formula and prints a warning unless `only` is specified. sig { params( - only: T.nilable(Symbol), - ignore_unavailable: T.nilable(T::Boolean), - method: T.nilable(Symbol), - uniq: T::Boolean, - prefer_loading_from_api: T::Boolean, + only: T.nilable(Symbol), + ignore_unavailable: T.nilable(T::Boolean), + method: T.nilable(Symbol), + uniq: T::Boolean, ).returns(T::Array[T.any(Formula, Keg, Cask::Cask)]) } - def to_formulae_and_casks(only: parent&.only_formula_or_cask, ignore_unavailable: nil, method: nil, uniq: true, - prefer_loading_from_api: false) + def to_formulae_and_casks(only: parent&.only_formula_or_cask, ignore_unavailable: nil, method: nil, uniq: true) @to_formulae_and_casks ||= {} @to_formulae_and_casks[only] ||= downcased_unique_named.flat_map do |name| - load_formula_or_cask(name, only: only, method: method, prefer_loading_from_api: prefer_loading_from_api) + load_formula_or_cask(name, only: only, method: method) rescue FormulaUnreadableError, FormulaClassUnavailableError, TapFormulaUnreadableError, TapFormulaClassUnavailableError, Cask::CaskUnreadableError @@ -90,7 +88,7 @@ def to_formulae_and_casks_and_unavailable(only: parent&.only_formula_or_cask, me end.uniq.freeze end - def load_formula_or_cask(name, only: nil, method: nil, prefer_loading_from_api: false) + def load_formula_or_cask(name, only: nil, method: nil) unreadable_error = nil if only != :cask @@ -124,16 +122,11 @@ def load_formula_or_cask(name, only: nil, method: nil, prefer_loading_from_api: end if only != :formula - if prefer_loading_from_api && Homebrew::EnvConfig.install_from_api? && - Homebrew::API::CaskSource.available?(name) - contents = Homebrew::API::CaskSource.fetch(name) - end - want_keg_like_cask = [:latest_kegs, :default_kegs, :kegs].include?(method) begin config = Cask::Config.from_args(@parent) if @cask_options - cask = Cask::CaskLoader.load(contents || name, config: config) + cask = Cask::CaskLoader.load(name, config: config) if unreadable_error.present? onoe <<~EOS
true
Other
Homebrew
brew
1e536217b2cb4395f1ebe5c0ba5c8bf1db4e7926.json
Streamline loading casks from API
Library/Homebrew/cmd/install.rb
@@ -167,7 +167,7 @@ def install end begin - formulae, casks = args.named.to_formulae_and_casks(prefer_loading_from_api: true) + formulae, casks = args.named.to_formulae_and_casks .partition { |formula_or_cask| formula_or_cask.is_a?(Formula) } rescue FormulaOrCaskUnavailableError, Cask::CaskUnavailableError => e retry if Tap.install_default_cask_tap_if_necessary(force: args.cask?)
true
Other
Homebrew
brew
1e536217b2cb4395f1ebe5c0ba5c8bf1db4e7926.json
Streamline loading casks from API
Library/Homebrew/cmd/upgrade.rb
@@ -213,15 +213,6 @@ def upgrade_outdated_formulae(formulae, args:) def upgrade_outdated_casks(casks, args:) return false if args.formula? - if Homebrew::EnvConfig.install_from_api? - casks = casks.map do |cask| - next cask if cask.tap.present? && cask.tap != "homebrew/cask" - next cask unless Homebrew::API::CaskSource.available?(cask.token) - - Cask::CaskLoader.load Homebrew::API::CaskSource.fetch(cask.token) - end - end - Cask::Cmd::Upgrade.upgrade_casks( *casks, force: args.force?,
true
Other
Homebrew
brew
64768f9c2a19b7b8812c19bb06ef76ead506e09e.json
Update RBI files for minitest.
Library/Homebrew/sorbet/rbi/gems/minitest@5.16.0.rbi
@@ -11,6 +11,7 @@ module Minitest def autorun; end def backtrace_filter; end def backtrace_filter=(_arg0); end + def cattr_accessor(name); end def clock_time; end def extensions; end def extensions=(_arg0); end @@ -26,6 +27,8 @@ module Minitest def reporter=(_arg0); end def run(args = T.unsafe(nil)); end def run_one_method(klass, method_name); end + def seed; end + def seed=(_arg0); end end end @@ -132,8 +135,6 @@ class Minitest::CompositeReporter < ::Minitest::AbstractReporter def start; end end -Minitest::ENCS = T.let(T.unsafe(nil), TrueClass) - module Minitest::Guard def jruby?(platform = T.unsafe(nil)); end def maglev?(platform = T.unsafe(nil)); end @@ -291,6 +292,8 @@ class Minitest::Test < ::Minitest::Runnable def capture_exceptions; end def class_name; end + def neuter_exception(e); end + def new_exception(klass, msg, bt); end def run; end def sanitize_exception(e); end def with_info_handler(&block); end
true
Other
Homebrew
brew
64768f9c2a19b7b8812c19bb06ef76ead506e09e.json
Update RBI files for minitest.
Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi
@@ -3174,35 +3174,35 @@ module Minitest::Expectations end class Minitest::Mock - def ===(*args, &b); end + def ===(*args, **kwargs, &b); end def __call(name, data); end def __respond_to?(*arg); end - def class(*args, &b); end + def class(*args, **kwargs, &b); end - def expect(name, retval, args=T.unsafe(nil), &blk); end + def expect(name, retval, args=T.unsafe(nil), **kwargs, &blk); end def initialize(delegator=T.unsafe(nil)); end - def inspect(*args, &b); end + def inspect(*args, **kwargs, &b); end - def instance_eval(*args, &b); end + def instance_eval(*args, **kwargs, &b); end - def instance_variables(*args, &b); end + def instance_variables(*args, **kwargs, &b); end - def method_missing(sym, *args, &block); end + def method_missing(sym, *args, **kwargs, &block); end - def object_id(*args, &b); end + def object_id(*args, **kwargs, &b); end - def public_send(*args, &b); end + def public_send(*args, **kwargs, &b); end def respond_to?(sym, include_private=T.unsafe(nil)); end - def send(*args, &b); end + def send(*args, **kwargs, &b); end - def to_s(*args, &b); end + def to_s(*args, **kwargs, &b); end def verify(); end end @@ -3522,7 +3522,7 @@ class Object def __send!(*arg); end - def stub(name, val_or_callable, *block_args); end + def stub(name, val_or_callable, *block_args, **block_kwargs); end def to_yaml(options=T.unsafe(nil)); end ARGF = ::T.let(nil, ::T.untyped)
true
Other
Homebrew
brew
43f7fa4162e19eb88016a0f16fdd011384d20c41.json
Update cached formula json file when needed
Library/Homebrew/api/formula.rb
@@ -16,6 +16,11 @@ def formula_api_path end alias generic_formula_api_path formula_api_path + sig { returns(String) } + def cached_formula_json_file + HOMEBREW_CACHE_API/"#{formula_api_path}.json" + end + sig { params(name: String).returns(Hash) } def fetch(name) Homebrew::API.fetch "#{formula_api_path}/#{name}.json" @@ -24,13 +29,29 @@ def fetch(name) sig { returns(Array) } def all_formulae @all_formulae ||= begin - json_formulae = JSON.parse((HOMEBREW_CACHE_API/"#{formula_api_path}.json").read) + download_formulae_if_needed + + json_formulae = JSON.parse(cached_formula_json_file.read) json_formulae.to_h do |json_formula| [json_formula["name"], json_formula.except("name")] end end end + + private + + sig { void } + def download_formulae_if_needed + curl_args = %w[--compressed --silent https://formulae.brew.sh/api/formula.json] + if cached_formula_json_file.exist? + last_modified = cached_formula_json_file.mtime.utc + last_modified = last_modified.strftime("%a, %d %b %Y %H:%M:%S GMT") + curl_args = ["--header", "If-Modified-Since: #{last_modified}", *curl_args] + end + + curl_download(*curl_args, to: HOMEBREW_CACHE_API/"#{formula_api_path}.json", max_time: 5) + end end end end
true
Other
Homebrew
brew
43f7fa4162e19eb88016a0f16fdd011384d20c41.json
Update cached formula json file when needed
Library/Homebrew/cmd/update.sh
@@ -752,7 +752,7 @@ EOS curl \ "${CURL_DISABLE_CURLRC_ARGS[@]}" \ --fail --compressed --silent --max-time 5 \ - --location --output "${HOMEBREW_CACHE}/api/formula.json" \ + --location --remote-time --output "${HOMEBREW_CACHE}/api/formula.json" \ --user-agent "${HOMEBREW_USER_AGENT_CURL}" \ "https://formulae.brew.sh/api/formula.json" # TODO: we probably want to print an error if this fails.
true
Other
Homebrew
brew
89483abda9199d6c6ded1dd1f1163a41d4d8c2cd.json
Remove Bottle API
Library/Homebrew/api.rb
@@ -2,7 +2,6 @@ # frozen_string_literal: true require "api/analytics" -require "api/bottle" require "api/cask" require "api/cask-source" require "api/formula"
true
Other
Homebrew
brew
89483abda9199d6c6ded1dd1f1163a41d4d8c2cd.json
Remove Bottle API
Library/Homebrew/api/bottle.rb
@@ -1,96 +0,0 @@ -# typed: false -# frozen_string_literal: true - -require "github_packages" - -module Homebrew - module API - # Helper functions for using the bottle JSON API. - # - # @api private - module Bottle - class << self - extend T::Sig - - sig { returns(String) } - def bottle_api_path - "bottle" - end - alias generic_bottle_api_path bottle_api_path - - GITHUB_PACKAGES_SHA256_REGEX = %r{#{GitHubPackages::URL_REGEX}.*/blobs/sha256:(?<sha256>\h{64})$}.freeze - - sig { params(name: String).returns(Hash) } - def fetch(name) - name = name.sub(%r{^homebrew/core/}, "") - Homebrew::API.fetch "#{bottle_api_path}/#{name}.json" - end - - sig { params(name: String).returns(T::Boolean) } - def available?(name) - fetch name - true - rescue ArgumentError - false - end - - sig { params(name: String).void } - def fetch_bottles(name) - hash = fetch(name) - bottle_tag = Utils::Bottles.tag.to_s - - if !hash["bottles"].key?(bottle_tag) && !hash["bottles"].key?("all") - odie "No bottle available for #{name} on the current OS" - end - - download_bottle(hash, bottle_tag) - - hash["dependencies"].each do |dep_hash| - existing_formula = begin - Formulary.factory dep_hash["name"] - rescue FormulaUnavailableError - # The formula might not exist if it's not installed and homebrew/core isn't tapped - nil - end - - next if existing_formula.present? && existing_formula.latest_version_installed? - - download_bottle(dep_hash, bottle_tag) - end - end - - sig { params(url: String).returns(T.nilable(String)) } - def checksum_from_url(url) - match = url.match GITHUB_PACKAGES_SHA256_REGEX - return if match.blank? - - match[:sha256] - end - - sig { params(hash: Hash, tag: String).void } - def download_bottle(hash, tag) - bottle = hash["bottles"][tag] - bottle ||= hash["bottles"]["all"] - return if bottle.blank? - - sha256 = bottle["sha256"] || checksum_from_url(bottle["url"]) - bottle_filename = ::Bottle::Filename.new(hash["name"], hash["pkg_version"], tag, hash["rebuild"]) - - resource = Resource.new hash["name"] - resource.url bottle["url"] - resource.sha256 sha256 - resource.version hash["pkg_version"] - resource.downloader.resolved_basename = bottle_filename - - resource.fetch - - # Map the name of this formula to the local bottle path to allow the - # formula to be loaded by passing just the name to `Formulary::factory`. - [hash["name"], "homebrew/core/#{hash["name"]}"].each do |name| - Formulary.map_formula_name_to_local_bottle_path name, resource.downloader.cached_location - end - end - end - end - end -end
true
Other
Homebrew
brew
89483abda9199d6c6ded1dd1f1163a41d4d8c2cd.json
Remove Bottle API
Library/Homebrew/diagnostic.rb
@@ -890,7 +890,7 @@ def check_deleted_formula # Formulae installed with HOMEBREW_INSTALL_FROM_API should not count as deleted formulae # but may not have a tap listed in their tab tap = Tab.for_keg(keg).tap - next if (tap.blank? || tap.core_tap?) && Homebrew::API::Bottle.available?(keg.name) + next if (tap.blank? || tap.core_tap?) && Homebrew::API::Formula.all_formulae.key?(keg.name) end keg.name
true
Other
Homebrew
brew
89483abda9199d6c6ded1dd1f1163a41d4d8c2cd.json
Remove Bottle API
Library/Homebrew/test/api/bottle_spec.rb
@@ -1,95 +0,0 @@ -# typed: false -# frozen_string_literal: true - -require "api" - -describe Homebrew::API::Bottle do - let(:bottle_json) { - <<~EOS - { - "name": "hello", - "pkg_version": "2.10", - "rebuild": 0, - "bottles": { - "arm64_big_sur": { - "url": "https://ghcr.io/v2/homebrew/core/hello/blobs/sha256:b3b083db0807ff92c6e289a298f378198354b7727fb9ba9f4d550b8e08f90a60" - }, - "big_sur": { - "url": "https://ghcr.io/v2/homebrew/core/hello/blobs/sha256:69489ae397e4645127aa7773211310f81ebb6c99e1f8e3e22c5cdb55333f5408" - }, - "x86_64_linux": { - "url": "https://ghcr.io/v2/homebrew/core/hello/blobs/sha256:e6980196298e0a9cfe4fa4e328a71a1869a4d5e1d31c38442150ed784cfc0e29" - } - }, - "dependencies": [] - } - EOS - } - let(:bottle_hash) { JSON.parse(bottle_json) } - - def mock_curl_output(stdout: "", success: true) - curl_output = OpenStruct.new(stdout: stdout, success?: success) - allow(Utils::Curl).to receive(:curl_output).and_return curl_output - end - - describe "::fetch" do - it "fetches the bottle JSON for a formula that exists" do - mock_curl_output stdout: bottle_json - fetched_hash = described_class.fetch("foo") - expect(fetched_hash).to eq bottle_hash - end - - it "raises an error if the formula does not exist" do - mock_curl_output success: false - expect { described_class.fetch("bar") }.to raise_error(ArgumentError, /No file found/) - end - - it "raises an error if the bottle JSON is invalid" do - mock_curl_output stdout: "foo" - expect { described_class.fetch("baz") }.to raise_error(ArgumentError, /Invalid JSON file/) - end - end - - describe "::available?" do - it "returns `true` if `fetch` succeeds" do - allow(described_class).to receive(:fetch) - expect(described_class.available?("foo")).to be true - end - - it "returns `false` if `fetch` fails" do - allow(described_class).to receive(:fetch).and_raise ArgumentError - expect(described_class.available?("foo")).to be false - end - end - - describe "::fetch_bottles" do - before do - ENV["HOMEBREW_INSTALL_FROM_API"] = "1" - allow(described_class).to receive(:fetch).and_return bottle_hash - end - - it "fetches bottles if a bottle is available" do - allow(Utils::Bottles).to receive(:tag).and_return :arm64_big_sur - expect { described_class.fetch_bottles("hello") }.not_to raise_error - end - - it "raises an error if no bottle is available" do - allow(Utils::Bottles).to receive(:tag).and_return :catalina - expect { described_class.fetch_bottles("hello") }.to raise_error(SystemExit) - end - end - - describe "::checksum_from_url" do - let(:sha256) { "b3b083db0807ff92c6e289a298f378198354b7727fb9ba9f4d550b8e08f90a60" } - let(:url) { "https://ghcr.io/v2/homebrew/core/hello/blobs/sha256:#{sha256}" } - let(:non_ghp_url) { "https://formulae.brew.sh/api/formula/hello.json" } - - it "returns the `sha256` for a GitHub packages URL" do - expect(described_class.checksum_from_url(url)).to eq sha256 - end - - it "returns `nil` for a non-GitHub packages URL" do - expect(described_class.checksum_from_url(non_ghp_url)).to be_nil - end - end -end
true
Other
Homebrew
brew
e53ccbc3cde32c38e584eb1a285cc09319d81653.json
Remove unnecessary code
Library/Homebrew/cask_dependent.rb
@@ -45,8 +45,8 @@ def requirements end end - def recursive_dependencies(ignore_missing: false, &block) - Dependency.expand(self, ignore_missing: ignore_missing, &block) + def recursive_dependencies(&block) + Dependency.expand(self, &block) end def recursive_requirements(&block)
true
Other
Homebrew
brew
e53ccbc3cde32c38e584eb1a285cc09319d81653.json
Remove unnecessary code
Library/Homebrew/cmd/reinstall.rb
@@ -88,22 +88,6 @@ def reinstall_args def reinstall args = reinstall_args.parse - # We need to use the bottle API instead of just using the formula file - # from an installed keg because it will not contain bottle information. - # As a consequence, `brew reinstall` will also upgrade outdated formulae - if Homebrew::EnvConfig.install_from_api? - args.named.each do |name| - formula = Formulary.factory(name) - next unless formula.any_version_installed? - next if formula.tap.present? && !formula.core_formula? - next unless Homebrew::API::Bottle.available?(name) - - Homebrew::API::Bottle.fetch_bottles(name) - rescue FormulaUnavailableError - next - end - end - formulae, casks = args.named.to_formulae_and_casks(method: :resolve) .partition { |o| o.is_a?(Formula) }
true
Other
Homebrew
brew
e53ccbc3cde32c38e584eb1a285cc09319d81653.json
Remove unnecessary code
Library/Homebrew/dependency.rb
@@ -46,15 +46,6 @@ def to_formula formula end - def unavailable_core_formula? - to_formula - false - rescue CoreTapFormulaUnavailableError - true - rescue - false - end - def installed? to_formula.latest_version_installed? end @@ -98,7 +89,7 @@ class << self # the list. # The default filter, which is applied when a block is not given, omits # optionals and recommendeds based on what the dependent has asked for - def expand(dependent, deps = dependent.deps, cache_key: nil, ignore_missing: false, &block) + def expand(dependent, deps = dependent.deps, cache_key: nil, &block) # Keep track dependencies to avoid infinite cyclic dependency recursion. @expand_stack ||= [] @expand_stack.push dependent.name @@ -115,19 +106,19 @@ def expand(dependent, deps = dependent.deps, cache_key: nil, ignore_missing: fal # avoid downloading build dependency bottles next if dep.build? && dependent.pour_bottle? && Homebrew::EnvConfig.install_from_api? - case action(dependent, dep, ignore_missing: ignore_missing, &block) + case action(dependent, dep, &block) when :prune next when :skip next if @expand_stack.include? dep.name - expanded_deps.concat(expand(dep.to_formula, cache_key: cache_key, ignore_missing: ignore_missing, &block)) + expanded_deps.concat(expand(dep.to_formula, cache_key: cache_key, &block)) when :keep_but_prune_recursive_deps expanded_deps << dep else next if @expand_stack.include? dep.name - expanded_deps.concat(expand(dep.to_formula, cache_key: cache_key, ignore_missing: ignore_missing, &block)) + expanded_deps.concat(expand(dep.to_formula, cache_key: cache_key, &block)) expanded_deps << dep end end @@ -139,10 +130,8 @@ def expand(dependent, deps = dependent.deps, cache_key: nil, ignore_missing: fal @expand_stack.pop end - def action(dependent, dep, ignore_missing: false, &block) + def action(dependent, dep, &block) catch(:action) do - prune if ignore_missing && dep.unavailable_core_formula? - if block yield dependent, dep elsif dep.optional? || dep.recommended?
true
Other
Homebrew
brew
e53ccbc3cde32c38e584eb1a285cc09319d81653.json
Remove unnecessary code
Library/Homebrew/exceptions.rb
@@ -234,13 +234,6 @@ def to_s end end -# Raised when a formula in a the core tap is unavailable. -class CoreTapFormulaUnavailableError < TapFormulaUnavailableError - def initialize(name) - super CoreTap.instance, name - end -end - # Raised when a formula in a specific tap does not contain a formula class. class TapFormulaClassUnavailableError < TapFormulaUnavailableError include FormulaClassUnavailableErrorModule
true
Other
Homebrew
brew
e53ccbc3cde32c38e584eb1a285cc09319d81653.json
Remove unnecessary code
Library/Homebrew/formula_installer.rb
@@ -218,11 +218,6 @@ def prelude def verify_deps_exist begin compute_dependencies - rescue CoreTapFormulaUnavailableError => e - raise unless Homebrew::API::Bottle.available? e.name - - Homebrew::API::Bottle.fetch_bottles(e.name) - retry rescue TapFormulaUnavailableError => e raise if e.tap.installed?
true
Other
Homebrew
brew
e53ccbc3cde32c38e584eb1a285cc09319d81653.json
Remove unnecessary code
Library/Homebrew/formulary.rb
@@ -447,10 +447,6 @@ def get_formula(spec, alias_path: nil, force_bottle: false, flags: [], ignore_er rescue FormulaClassUnavailableError => e raise TapFormulaClassUnavailableError.new(tap, name, e.path, e.class_name, e.class_list), "", e.backtrace rescue FormulaUnavailableError => e - if tap.core_tap? && Homebrew::EnvConfig.install_from_api? - raise CoreTapFormulaUnavailableError.new(name), "", e.backtrace - end - raise TapFormulaUnavailableError.new(tap, name), "", e.backtrace end @@ -469,10 +465,6 @@ def initialize(name) end def get_formula(*) - if !CoreTap.instance.installed? && Homebrew::EnvConfig.install_from_api? - raise CoreTapFormulaUnavailableError, name - end - raise FormulaUnavailableError, name end end
true
Other
Homebrew
brew
944d7eebf0bbb869616d081ffcc12112a71624e6.json
Add bottle rebuild when loading from API
Library/Homebrew/formulary.rb
@@ -435,6 +435,7 @@ def klass(flags:, ignore_errors:) if (bottles_stable = json_formula["bottle"]["stable"]).present? bottle do root_url bottles_stable["root_url"] + rebuild bottles_stable["rebuild"] bottles_stable["files"].each do |tag, bottle_spec| cellar = bottle_spec["cellar"] cellar = cellar[1..].to_sym if cellar.start_with?(":")
false
Other
Homebrew
brew
6bfe7022ad0a0050c83efb43c933f244a2168287.json
Update RBI files for rubocop-rails.
Library/Homebrew/sorbet/rbi/gems/rubocop-rails@2.15.0.rbi
@@ -539,7 +539,11 @@ RuboCop::Cop::Rails::DelegateAllowBlank::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Rails::DelegateAllowBlank::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) class RuboCop::Cop::Rails::DeprecatedActiveModelErrorsMethods < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + def any_manipulation?(param0 = T.unsafe(nil)); end + def errors_keys?(param0 = T.unsafe(nil)); end def messages_details_assignment?(param0 = T.unsafe(nil)); end def messages_details_manipulation?(param0 = T.unsafe(nil)); end def on_send(node); end @@ -550,13 +554,34 @@ class RuboCop::Cop::Rails::DeprecatedActiveModelErrorsMethods < ::RuboCop::Cop:: private + def autocorrect(corrector, node); end def model_file?; end + def offense_range(node, receiver); end def receiver_matcher(node); end + def replacement(node, receiver); end end +RuboCop::Cop::Rails::DeprecatedActiveModelErrorsMethods::AUTOCORECTABLE_METHODS = T.let(T.unsafe(nil), Array) RuboCop::Cop::Rails::DeprecatedActiveModelErrorsMethods::MANIPULATIVE_METHODS = T.let(T.unsafe(nil), Set) RuboCop::Cop::Rails::DeprecatedActiveModelErrorsMethods::MSG = T.let(T.unsafe(nil), String) +class RuboCop::Cop::Rails::DotSeparatedKeys < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + + def on_send(node); end + def translate_with_scope?(param0 = T.unsafe(nil)); end + + private + + def new_key(key_node, scope_node); end + def scopes(scope_node); end + def should_convert_scope?(scope_node); end +end + +RuboCop::Cop::Rails::DotSeparatedKeys::MSG = T.let(T.unsafe(nil), String) +RuboCop::Cop::Rails::DotSeparatedKeys::TRANSLATE_METHODS = T.let(T.unsafe(nil), Array) + class RuboCop::Cop::Rails::DuplicateAssociation < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp include ::RuboCop::Cop::ClassSendNodeHelper @@ -844,6 +869,7 @@ class RuboCop::Cop::Rails::HasManyOrHasOneDependent < ::RuboCop::Cop::Base def active_resource?(node); end def contain_valid_options_in_with_options_block?(node); end + def extract_option_if_kwsplat(options); end def readonly_model?(node); end def valid_options?(options); end def valid_options_in_with_options_block?(node); end @@ -1641,9 +1667,25 @@ end RuboCop::Cop::Rails::RootJoinChain::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Rails::RootJoinChain::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Set) +class RuboCop::Cop::Rails::RootPublicPath < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + + def on_send(node); end + def rails_root_public(param0 = T.unsafe(nil)); end + + private + + def public_path?(string); end +end + +RuboCop::Cop::Rails::RootPublicPath::MSG = T.let(T.unsafe(nil), String) +RuboCop::Cop::Rails::RootPublicPath::PATTERN = T.let(T.unsafe(nil), Regexp) +RuboCop::Cop::Rails::RootPublicPath::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Set) + class RuboCop::Cop::Rails::SafeNavigation < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector + extend ::RuboCop::Cop::TargetRubyVersion def on_send(node); end def try_call(param0 = T.unsafe(nil)); end @@ -1799,6 +1841,20 @@ RuboCop::Cop::Rails::SquishedSQLHeredocs::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Rails::SquishedSQLHeredocs::SQL = T.let(T.unsafe(nil), String) RuboCop::Cop::Rails::SquishedSQLHeredocs::SQUISH = T.let(T.unsafe(nil), String) +class RuboCop::Cop::Rails::StripHeredoc < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + extend ::RuboCop::Cop::TargetRubyVersion + + def on_send(node); end + + private + + def register_offense(node, heredoc); end +end + +RuboCop::Cop::Rails::StripHeredoc::MSG = T.let(T.unsafe(nil), String) +RuboCop::Cop::Rails::StripHeredoc::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + class RuboCop::Cop::Rails::TableNameAssignment < ::RuboCop::Cop::Base include ::RuboCop::Cop::ActiveRecordHelper @@ -1852,13 +1908,24 @@ end RuboCop::Cop::Rails::TimeZoneAssignment::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Rails::TimeZoneAssignment::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) +class RuboCop::Cop::Rails::ToFormattedS < ::RuboCop::Cop::Base + include ::RuboCop::Cop::ConfigurableEnforcedStyle + extend ::RuboCop::Cop::AutoCorrector + extend ::RuboCop::Cop::TargetRailsVersion + + def on_send(node); end +end + +RuboCop::Cop::Rails::ToFormattedS::MSG = T.let(T.unsafe(nil), String) +RuboCop::Cop::Rails::ToFormattedS::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + class RuboCop::Cop::Rails::TransactionExitStatement < ::RuboCop::Cop::Base def exit_statements(param0); end def on_send(node); end + def rescue_body_return_node?(param0 = T.unsafe(nil)); end private - def in_rescue?(statement_node); end def nested_block?(statement_node); end def statement(statement_node); end end
false
Other
Homebrew
brew
7a95219d2b60253103f04424e743501e35fe18cb.json
remove new method and reset without TODO
Library/Homebrew/formula_cellar_checks.rb
@@ -292,8 +292,7 @@ def check_cpuid_instruction(formula) dot_brew_formula = formula.prefix/".brew/#{formula.name}.rb" return unless dot_brew_formula.exist? - require "utils/ast" - return unless Utils::AST::FormulaAST.new(dot_brew_formula.read).include_runtime_cpu_detection? + return unless dot_brew_formula.read.include? "ENV.runtime_cpu_detection" # macOS `objdump` is a bit slow, so we prioritise llvm's `llvm-objdump` (~5.7x faster) # or binutils' `objdump` (~1.8x faster) if they are installed.
true
Other
Homebrew
brew
7a95219d2b60253103f04424e743501e35fe18cb.json
remove new method and reset without TODO
Library/Homebrew/utils/ast.rb
@@ -190,19 +190,6 @@ def add_stanza(name, value, type: nil) tree_rewriter.insert_after(preceding_expr, "\n#{stanza_text(name, value, indent: 2)}") end - sig { returns(T::Boolean) } - def include_runtime_cpu_detection? - install_node = children.find do |child| - (child.is_a? RuboCop::AST::DefNode) && child.method_name == :install - end - - return false if install_node.blank? - - install_node.each_node.any? do |node| - node.send_type? && node.receiver&.const_name == "ENV" && node.method_name == :runtime_cpu_detection - end - end - private sig { returns(String) }
true
Other
Homebrew
brew
7e31574c3f23fdb2c27ab5d7d552e49792d0bddb.json
avoid nil error
Library/Homebrew/utils/ast.rb
@@ -199,7 +199,7 @@ def include_runtime_cpu_detection? return false if install_node.blank? install_node.each_node.any? do |node| - node.send_type? && node.receiver.const_name == "ENV" && node.method_name == :runtime_cpu_detection + node.send_type? && node.receiver&.const_name == "ENV" && node.method_name == :runtime_cpu_detection end end
false
Other
Homebrew
brew
8b14738a88da598558346ec7de557401622f4ef5.json
remove safe navigation operator
Library/Homebrew/utils/ast.rb
@@ -199,7 +199,7 @@ def include_runtime_cpu_detection? return false if install_node.blank? install_node.each_node.any? do |node| - node&.receiver&.const_name == "ENV" && node&.method_name == :runtime_cpu_detection + node.send_type? && node.receiver.const_name == "ENV" && node.method_name == :runtime_cpu_detection end end
false
Other
Homebrew
brew
f2fe1b59a19c4a80e6c0ff14d4f81720e6d1c1b9.json
move check ENV.runtime_cpu_detection to utils/ast
Library/Homebrew/formula_cellar_checks.rb
@@ -291,8 +291,9 @@ def check_cpuid_instruction(formula) dot_brew_formula = formula.prefix/".brew/#{formula.name}.rb" return unless dot_brew_formula.exist? - # TODO: add methods to `utils/ast` to allow checking for method use - return unless dot_brew_formula.read.include? "ENV.runtime_cpu_detection" + + require "utils/ast" + return unless Utils::AST::FormulaAST.new(dot_brew_formula.read).include_runtime_cpu_detection? # macOS `objdump` is a bit slow, so we prioritise llvm's `llvm-objdump` (~5.7x faster) # or binutils' `objdump` (~1.8x faster) if they are installed.
true
Other
Homebrew
brew
f2fe1b59a19c4a80e6c0ff14d4f81720e6d1c1b9.json
move check ENV.runtime_cpu_detection to utils/ast
Library/Homebrew/utils/ast.rb
@@ -190,6 +190,19 @@ def add_stanza(name, value, type: nil) tree_rewriter.insert_after(preceding_expr, "\n#{stanza_text(name, value, indent: 2)}") end + sig { returns(T::Boolean) } + def include_runtime_cpu_detection? + install_node = children.find do |child| + (child.is_a? RuboCop::AST::DefNode) && child.method_name == :install + end + + return false if install_node.blank? + + install_node.each_node.any? do |node| + node&.receiver&.const_name == "ENV" && node&.method_name == :runtime_cpu_detection + end + end + private sig { returns(String) }
true
Other
Homebrew
brew
bd54b161100591b94735c97cef1895f57d092808.json
Update RBI files for zeitwerk.
Library/Homebrew/sorbet/rbi/gems/zeitwerk@2.6.0.rbi
@@ -47,6 +47,20 @@ class Zeitwerk::GemInflector < ::Zeitwerk::Inflector def camelize(basename, abspath); end end +class Zeitwerk::GemLoader < ::Zeitwerk::Loader + def initialize(root_file, warn_on_extra_files:); end + + def setup; end + + private + + def warn_on_extra_files; end + + class << self + def _new(root_file, warn_on_extra_files:); end + end +end + class Zeitwerk::Inflector def camelize(basename, _abspath); end def inflect(inflections); end @@ -97,9 +111,7 @@ class Zeitwerk::Loader def default_logger; end def default_logger=(_arg0); end def eager_load_all; end - def for_gem; end - def mutex; end - def mutex=(_arg0); end + def for_gem(warn_on_extra_files: T.unsafe(nil)); end end end @@ -165,13 +177,15 @@ module Zeitwerk::Loader::Helpers def cget(parent, cname); end def cpath(parent, cname); end def dir?(path); end + def has_at_least_one_ruby_file?(dir); end def hidden?(basename); end def log(message); end def ls(dir); end def ruby?(path); end def strict_autoload_path(parent, cname); end end +Zeitwerk::Loader::MUTEX = T.let(T.unsafe(nil), Thread::Mutex) class Zeitwerk::NameError < ::NameError; end module Zeitwerk::RealModName @@ -183,12 +197,12 @@ Zeitwerk::RealModName::UNBOUND_METHOD_MODULE_NAME = T.let(T.unsafe(nil), Unbound module Zeitwerk::Registry class << self def autoloads; end + def gem_loaders_by_root_file; end def inception?(cpath); end def inceptions; end def loader_for(path); end - def loader_for_gem(root_file); end + def loader_for_gem(root_file, warn_on_extra_files:); end def loaders; end - def loaders_managing_gems; end def on_unload(loader); end def register_autoload(loader, abspath); end def register_inception(cpath, abspath, loader); end @@ -198,5 +212,8 @@ module Zeitwerk::Registry end end -class Zeitwerk::ReloadingDisabledError < ::Zeitwerk::Error; end +class Zeitwerk::ReloadingDisabledError < ::Zeitwerk::Error + def initialize; end +end + Zeitwerk::VERSION = T.let(T.unsafe(nil), String)
false
Other
Homebrew
brew
d600b662e255291232efa10c38d973697eea2dde.json
Expand documentation comments
Library/Homebrew/livecheck/strategy/electron_builder.rb
@@ -4,8 +4,8 @@ module Homebrew module Livecheck module Strategy - # The {ElectronBuilder} strategy fetches content at a URL and parses - # it as an electron-builder appcast in YAML format. + # The {ElectronBuilder} strategy fetches content at a URL and parses it + # as an electron-builder appcast in YAML format. # # This strategy is not applied automatically and it's necessary to use # `strategy :electron_builder` in a `livecheck` block to apply it. @@ -35,6 +35,7 @@ def self.match?(url) # Parses YAML text and identifies versions in it. # # @param content [String] the YAML text to parse and check + # @param regex [Regexp, nil] a regex for use in a strategy block # @return [Array] sig { params(
true
Other
Homebrew
brew
d600b662e255291232efa10c38d973697eea2dde.json
Expand documentation comments
Library/Homebrew/livecheck/strategy/extract_plist.rb
@@ -58,6 +58,7 @@ def self.match?(url) # {UnversionedCaskChecker} version information. # # @param items [Hash] a hash of `Item`s containing version information + # @param regex [Regexp, nil] a regex for use in a strategy block # @return [Array] sig { params( @@ -81,6 +82,7 @@ def self.versions_from_items(items, regex = nil, &block) # versions from `plist` files. # # @param cask [Cask::Cask] the cask to check for version information + # @param regex [Regexp, nil] a regex for use in a strategy block # @return [Hash] sig { params(
true
Other
Homebrew
brew
d600b662e255291232efa10c38d973697eea2dde.json
Expand documentation comments
Library/Homebrew/livecheck/strategy/sparkle.rb
@@ -6,8 +6,8 @@ module Homebrew module Livecheck module Strategy - # The {Sparkle} strategy fetches content at a URL and parses - # it as a Sparkle appcast in XML format. + # The {Sparkle} strategy fetches content at a URL and parses it as a + # Sparkle appcast in XML format. # # This strategy is not applied automatically and it's necessary to use # `strategy :sparkle` in a `livecheck` block to apply it. @@ -60,7 +60,7 @@ def self.match?(url) delegate nice_version: :bundle_version end - # Identify version information from a Sparkle appcast. + # Identifies version information from a Sparkle appcast. # # @param content [String] the text of the Sparkle appcast # @return [Item, nil] @@ -152,9 +152,12 @@ def self.items_from_content(content) end.compact end - # Identify versions from content + # Uses `#items_from_content` to identify versions from the Sparkle + # appcast content or, if a block is provided, passes the content to + # the block to handle matching. # - # @param content [String] the content to pull version information from + # @param content [String] the content to check + # @param regex [Regexp, nil] a regex for use in a strategy block # @return [Array] sig { params( @@ -186,6 +189,10 @@ def self.versions_from_content(content, regex = nil, &block) end # Checks the content at the URL for new versions. + # + # @param url [String] the URL of the content to check + # @param regex [Regexp, nil] a regex for use in a strategy block + # @return [Hash] sig { params( url: String,
true
Other
Homebrew
brew
590aabe9d7d8d383c2be013e16e5fdf83942d584.json
livecheck: update default match_data This updates these strategies to better align with the default `match_data` value in other strategies.
Library/Homebrew/livecheck/strategy/electron_builder.rb
@@ -75,7 +75,7 @@ def self.find_versions(url:, regex: nil, **_unused, &block) raise ArgumentError, "#{T.must(name).demodulize} only supports a regex when using a `strategy` block" end - match_data = { matches: {}, url: url } + match_data = { matches: {}, regex: regex, url: url } match_data.merge!(Strategy.page_content(url)) content = match_data.delete(:content)
true
Other
Homebrew
brew
590aabe9d7d8d383c2be013e16e5fdf83942d584.json
livecheck: update default match_data This updates these strategies to better align with the default `match_data` value in other strategies.
Library/Homebrew/livecheck/strategy/extract_plist.rb
@@ -96,7 +96,7 @@ def self.find_versions(cask:, regex: nil, **_unused, &block) end raise ArgumentError, "The #{T.must(name).demodulize} strategy only supports casks." unless T.unsafe(cask) - match_data = { matches: {} } + match_data = { matches: {}, regex: regex } unversioned_cask_checker = UnversionedCaskChecker.new(cask) items = unversioned_cask_checker.all_versions.transform_values { |v| Item.new(bundle_version: v) }
true
Other
Homebrew
brew
590aabe9d7d8d383c2be013e16e5fdf83942d584.json
livecheck: update default match_data This updates these strategies to better align with the default `match_data` value in other strategies.
Library/Homebrew/livecheck/strategy/sparkle.rb
@@ -199,7 +199,7 @@ def self.find_versions(url:, regex: nil, **_unused, &block) raise ArgumentError, "#{T.must(name).demodulize} only supports a regex when using a `strategy` block" end - match_data = { matches: {}, url: url } + match_data = { matches: {}, regex: regex, url: url } match_data.merge!(Strategy.page_content(url)) content = match_data.delete(:content)
true
Other
Homebrew
brew
16d1679ad19b8877045389c808129ff3060db7ba.json
Update RBI files for mechanize.
Library/Homebrew/sorbet/rbi/gems/mechanize@2.8.5.rbi
@@ -689,6 +689,7 @@ class Mechanize::HTTP::Agent def webrobots; end end +Mechanize::HTTP::Agent::COOKIE_HEADERS = T.let(T.unsafe(nil), Array) Mechanize::HTTP::Agent::CREDENTIAL_HEADERS = T.let(T.unsafe(nil), Array) Mechanize::HTTP::Agent::POST_HEADERS = T.let(T.unsafe(nil), Array) Mechanize::HTTP::Agent::RobotsKey = T.let(T.unsafe(nil), Symbol)
false
Other
Homebrew
brew
1d5c668110b81e417382ccb78dc09e19c2863cc5.json
Remove unused parser option required_for
Library/Homebrew/cli/parser.rb
@@ -148,7 +148,7 @@ def initialize(&block) generate_banner end - def switch(*names, description: nil, replacement: nil, env: nil, required_for: nil, depends_on: nil, + def switch(*names, description: nil, replacement: nil, env: nil, depends_on: nil, method: :on, hidden: false) global_switch = names.first.is_a?(Symbol) return if global_switch @@ -167,7 +167,7 @@ def switch(*names, description: nil, replacement: nil, env: nil, required_for: n end names.each do |name| - set_constraints(name, required_for: required_for, depends_on: depends_on) + set_constraints(name, depends_on: depends_on) end env_value = env?(env) @@ -204,8 +204,7 @@ def comma_array(name, description: nil, hidden: false) end end - def flag(*names, description: nil, replacement: nil, required_for: nil, - depends_on: nil, hidden: false) + def flag(*names, description: nil, replacement: nil, depends_on: nil, hidden: false) required, flag_type = if names.any? { |name| name.end_with? "=" } [OptionParser::REQUIRED_ARGUMENT, :required_flag] else @@ -226,7 +225,7 @@ def flag(*names, description: nil, replacement: nil, required_for: nil, end names.each do |name| - set_constraints(name, required_for: required_for, depends_on: depends_on) + set_constraints(name, depends_on: depends_on) end end @@ -506,31 +505,25 @@ def wrap_option_desc(desc) Formatter.format_help_text(desc, width: OPTION_DESC_WIDTH).split("\n") end - def set_constraints(name, depends_on:, required_for:) - secondary = option_to_name(name) - unless required_for.nil? - primary = option_to_name(required_for) - @constraints << [primary, secondary, :mandatory] - end - + def set_constraints(name, depends_on:) return if depends_on.nil? primary = option_to_name(depends_on) - @constraints << [primary, secondary, :optional] + secondary = option_to_name(name) + @constraints << [primary, secondary] end def check_constraints - @constraints.each do |primary, secondary, constraint_type| + @constraints.each do |primary, secondary| primary_passed = option_passed?(primary) secondary_passed = option_passed?(secondary) + next if !secondary_passed || (primary_passed && secondary_passed) + primary = name_to_option(primary) secondary = name_to_option(secondary) - if :mandatory.equal?(constraint_type) && primary_passed && !secondary_passed - raise OptionConstraintError.new(primary, secondary) - end - raise OptionConstraintError.new(primary, secondary, missing: true) if secondary_passed && !primary_passed + raise OptionConstraintError.new(primary, secondary, missing: true) end end
true
Other
Homebrew
brew
1d5c668110b81e417382ccb78dc09e19c2863cc5.json
Remove unused parser option required_for
Library/Homebrew/test/cli/parser_spec.rb
@@ -164,21 +164,15 @@ subject(:parser) { described_class.new do flag "--flag1=" + flag "--flag2=", depends_on: "--flag1=" flag "--flag3=" - flag "--flag2=", required_for: "--flag1=" - flag "--flag4=", depends_on: "--flag3=" conflicts "--flag1=", "--flag3=" end } - it "raises exception on required_for constraint violation" do - expect { parser.parse(["--flag1=flag1"]) }.to raise_error(Homebrew::CLI::OptionConstraintError) - end - it "raises exception on depends_on constraint violation" do expect { parser.parse(["--flag2=flag2"]) }.to raise_error(Homebrew::CLI::OptionConstraintError) - expect { parser.parse(["--flag4=flag4"]) }.to raise_error(Homebrew::CLI::OptionConstraintError) end it "raises exception for conflict violation" do @@ -216,20 +210,14 @@ described_class.new do switch "-a", "--switch-a", env: "switch_a" switch "-b", "--switch-b", env: "switch_b" - switch "--switch-c", required_for: "--switch-a" - switch "--switch-d", depends_on: "--switch-b" + switch "--switch-c", depends_on: "--switch-a" conflicts "--switch-a", "--switch-b" end } - it "raises exception on required_for constraint violation" do - expect { parser.parse(["--switch-a"]) }.to raise_error(Homebrew::CLI::OptionConstraintError) - end - it "raises exception on depends_on constraint violation" do expect { parser.parse(["--switch-c"]) }.to raise_error(Homebrew::CLI::OptionConstraintError) - expect { parser.parse(["--switch-d"]) }.to raise_error(Homebrew::CLI::OptionConstraintError) end it "raises exception for conflict violation" do
true
Other
Homebrew
brew
2a662e8683cd16d61885702236dd343984f5d3ac.json
Update RBI files for rubocop-performance.
Library/Homebrew/sorbet/rbi/gems/rubocop-performance@1.14.2.rbi
@@ -599,6 +599,7 @@ RuboCop::Cop::Performance::RedundantStringChars::RESTRICT_ON_SEND = T.let(T.unsa class RuboCop::Cop::Performance::RegexpMatch < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector + extend ::RuboCop::Cop::TargetRubyVersion def last_matches(param0); end def match_method?(param0 = T.unsafe(nil)); end
false
Other
Homebrew
brew
64a7c1f8213558f9aeaaa751492297e75463f656.json
Git: Remove tags_only_debian logic The `tags_only_debian` code in livecheck's `Git` strategy was originally introduced in Homebrew/homebrew-livecheck#131 when livecheck was in a less mature state and relied more on internal special-casing like this (i.e., while we worked to add appropriate `livecheck` blocks). This logic only has the potential to be beneficial when a formula/cask doesn't contain a `livecheck` block but I would argue that we shouldn't be making assumptions in the strategy around whether tags with a `debian/` prefix should be matched or omitted. The answer depends upon the context of a given formula/cask and should be handled with a `livecheck` block, as we do with other situations like this.
Library/Homebrew/livecheck/strategy/git.rb
@@ -101,13 +101,7 @@ def self.versions_from_tags(tags, regex = nil, &block) return Strategy.handle_block_return(block_return_value) end - tags_only_debian = tags.all? { |tag| tag.start_with?("debian/") } - tags.map do |tag| - # Skip tag if it has a 'debian/' prefix and upstream does not do - # only 'debian/' prefixed tags - next if tag =~ %r{^debian/} && !tags_only_debian - if regex # Use the first capture group (the version) tag.scan(regex).first&.first
false
Other
Homebrew
brew
a4ed8f0e2d54953b5a78786ccf097240eb75f6f8.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
@@ -2452,6 +2452,8 @@ module Homebrew::EnvConfig def self.bat_config_path(); end + def self.bat_theme(); end + def self.bootsnap?(); end def self.bottle_domain(); end
false
Other
Homebrew
brew
1263ad99a4d21f375d24fcc2595a952f4d1d97e6.json
Update RBI files for sorbet-static-and-runtime.
Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi
@@ -2452,6 +2452,8 @@ module Homebrew::EnvConfig def self.bat_config_path(); end + def self.bat_theme(); end + def self.bootsnap?(); end def self.bottle_domain(); end
false
Other
Homebrew
brew
608757bc90f6c04d623b0f70b3e9ba8b804675fc.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
@@ -2574,8 +2574,6 @@ module Homebrew::EnvConfig def self.update_report_all_formulae?(); end - def self.update_report_version_changed_formulae?(); end - def self.update_to_tag?(); end def self.verbose?(); end
false
Other
Homebrew
brew
04c8e02418cb083f8c2b6f9e8b5ae83a23c1bdce.json
cmd/update-report: use better wording where appropriate. From reading https://github.com/orgs/Homebrew/discussions/3328: I initially thought we should just change "Updated" to "Modified" when appropriate. After conversation with Bo98, though, I thought more and saw that we're already checking for outdated formulae here so, rather than ever traverse through the formula history, look at the outdated formula and list them unless we've set `HOMEBREW_UPDATE_REPORT_ALL_FORMULAE` in which case we show the modifications. While we're here, also do a bit of reformatting and renaming to better clarify intent.
Library/Homebrew/cmd/update-report.rb
@@ -1,7 +1,6 @@ # typed: false # frozen_string_literal: true -require "formula_versions" require "migrator" require "formulary" require "descriptions" @@ -204,6 +203,7 @@ def output_update_report hub.dump(updated_formula_report: !args.auto_update?) unless args.quiet? hub.reporters.each(&:migrate_tap_migration) hub.reporters.each { |r| r.migrate_formula_rename(force: args.force?, verbose: args.verbose?) } + CacheStoreDatabase.use(:descriptions) do |db| DescriptionCacheStore.new(db) .update_from_report!(hub) @@ -212,32 +212,6 @@ def output_update_report CaskDescriptionCacheStore.new(db) .update_from_report!(hub) end - - if !args.auto_update? && !args.quiet? - outdated_formulae = Formula.installed.count(&:outdated?) - outdated_casks = Cask::Caskroom.casks.count(&:outdated?) - update_pronoun = if (outdated_formulae + outdated_casks) == 1 - "it" - else - "them" - end - 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 - puts <<~EOS - You have #{msg} installed. - You can upgrade #{update_pronoun} with #{Tty.bold}brew upgrade#{Tty.reset} - or list #{update_pronoun} with #{Tty.bold}brew outdated#{Tty.reset}. - EOS - end - end end puts if args.auto_update? elsif !args.auto_update? && !ENV["HOMEBREW_UPDATE_FAILED"] && !ENV["HOMEBREW_MIGRATE_LINUXBREW_FORMULAE"] @@ -369,24 +343,6 @@ def report(auto_update: false) when "M" name = tap.formula_file_to_name(src) - # Skip filtering unchanged formulae versions by default (as it's slow). - unless Homebrew::EnvConfig.update_report_version_changed_formulae? - @report[:M] << name - next - end - - begin - formula = Formulary.factory(tap.path/src) - new_version = formula.pkg_version - old_version = FormulaVersions.new(formula).formula_at_revision(@initial_revision, &:pkg_version) - next if new_version == old_version - rescue FormulaUnavailableError - # Don't care if the formula isn't available right now. - nil - rescue Exception => e # rubocop:disable Lint/RescueException - onoe "#{e.message}\n#{e.backtrace.join "\n"}" if Homebrew::EnvConfig.developer? - end - @report[:M] << name when /^R\d{0,3}/ src_full_name = tap.formula_file_to_name(src) @@ -571,7 +527,7 @@ def initialize @reporters = [] end - def select_formula(key) + def select_formula_or_cask(key) @hash.fetch(key, []) end @@ -586,70 +542,155 @@ def add(reporter, auto_update: false) def dump(updated_formula_report: true) # Key Legend: Added (A), Copied (C), Deleted (D), Modified (M), Renamed (R) - dump_formula_report :A, "New Formulae" - if updated_formula_report - dump_formula_report :M, "Updated Formulae" + unless Homebrew::EnvConfig.update_report_all_formulae? + dump_formula_or_cask_report :A, "New Formulae" + dump_formula_or_cask_report :AC, "New Casks" + dump_formula_or_cask_report :R, "Renamed Formulae" + end + + dump_formula_or_cask_report :D, "Deleted Formulae" + dump_formula_or_cask_report :DC, "Deleted Casks" + + outdated_formulae = nil + outdated_casks = nil + + if updated_formula_report && Homebrew::EnvConfig.update_report_all_formulae? + dump_formula_or_cask_report :M, "Modified Formulae" + dump_formula_or_cask_report :MC, "Modified Casks" + elsif updated_formula_report + outdated_formulae = Formula.installed.select(&:outdated?).map(&:name) + output_dump_formula_or_cask_report "Outdated Formulae", outdated_formulae + + outdated_casks = Cask::Caskroom.casks.select(&:outdated?).map(&:token) + output_dump_formula_or_cask_report "Outdated Casks", outdated_casks + elsif Homebrew::EnvConfig.update_report_all_formulae? + if (changed_formulae = select_formula_or_cask(:M).count) && changed_formulae.positive? + ohai "Modified Formulae", "Modified #{changed_formulae} #{"formula".pluralize(changed_formulae)}." + end + + if (changed_casks = select_formula_or_cask(:MC).count) && changed_casks.positive? + ohai "Modified Casks", "Modified #{changed_casks} #{"cask".pluralize(changed_casks)}." + end else - updated = select_formula(:M).count - ohai "Updated Formulae", "Updated #{updated} #{"formula".pluralize(updated)}." if updated.positive? + outdated_formulae = Formula.installed.select(&:outdated?).map(&:name) + outdated_casks = Cask::Caskroom.casks.select(&:outdated?).map(&:token) end - dump_formula_report :R, "Renamed Formulae" - dump_formula_report :D, "Deleted Formulae" - dump_formula_report :AC, "New Casks" - if updated_formula_report - dump_formula_report :MC, "Updated Casks" + + return if outdated_formulae.blank? && outdated_casks.blank? + + outdated_formulae = outdated_formulae.count + outdated_casks = outdated_casks.count + + update_pronoun = if (outdated_formulae + outdated_casks) == 1 + "it" else - updated = select_formula(:MC).count - ohai "Updated Casks", "Updated #{updated} #{"cask".pluralize(updated)}." if updated.positive? + "them" + end + + 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 - dump_formula_report :DC, "Deleted Casks" + + return if msg.blank? + + puts + puts <<~EOS + You have #{msg} installed. + You can upgrade #{update_pronoun} with #{Tty.bold}brew upgrade#{Tty.reset} + or list #{update_pronoun} with #{Tty.bold}brew outdated#{Tty.reset}. + EOS end private - def dump_formula_report(key, title) - only_installed = !Homebrew::EnvConfig.update_report_all_formulae? + def dump_formula_or_cask_report(key, title) + report_all = Homebrew::EnvConfig.update_report_all_formulae? - formulae = select_formula(key).sort.map do |name, new_name| - # Format list items of renamed formulae + formulae_or_casks = select_formula_or_cask(key).sort.map do |name, new_name| + # Format list items of formulae case key when :R - unless only_installed + if report_all name = pretty_installed(name) if installed?(name) new_name = pretty_installed(new_name) if installed?(new_name) "#{name} -> #{new_name}" end when :A - name if !only_installed && !installed?(name) + name if report_all && !installed?(name) when :AC - name.split("/").last if !only_installed && !cask_installed?(name) - when :MC, :DC + name.split("/").last if report_all && !cask_installed?(name) + when :MC name = name.split("/").last if cask_installed?(name) - pretty_installed(name) - elsif !only_installed + if cask_outdated?(name) + pretty_outdated(name) + else + pretty_installed(name) + end + elsif report_all name end - else + when :DC + name = name.split("/").last + if cask_installed?(name) + pretty_uninstalled(name) + elsif report_all + name + end + when :M if installed?(name) - pretty_installed(name) - elsif !only_installed + if outdated?(name) + pretty_outdated(name) + else + pretty_installed(name) + end + elsif report_all name end + when :D + if installed?(name) + pretty_uninstalled(name) + elsif report_all + name + end + else + raise ArgumentError, ":#{key} passed to dump_formula_or_cask_report!" end end.compact - return if formulae.empty? + output_dump_formula_or_cask_report title, formulae_or_casks + end + + def output_dump_formula_or_cask_report(title, formulae_or_casks) + return if formulae_or_casks.blank? - # Dump formula list. - ohai title, Formatter.columns(formulae.sort) + ohai title, Formatter.columns(formulae_or_casks.sort) end def installed?(formula) (HOMEBREW_CELLAR/formula.split("/").last).directory? end + def outdated?(formula) + Formula[formula].outdated? + rescue FormulaUnavailableError + false + end + def cask_installed?(cask) (Cask::Caskroom.path/cask).directory? end + + def cask_outdated?(cask) + Cask::CaskLoader.load(cask).outdated? + rescue Cask::CaskError + false + end end
true
Other
Homebrew
brew
04c8e02418cb083f8c2b6f9e8b5ae83a23c1bdce.json
cmd/update-report: use better wording where appropriate. From reading https://github.com/orgs/Homebrew/discussions/3328: I initially thought we should just change "Updated" to "Modified" when appropriate. After conversation with Bo98, though, I thought more and saw that we're already checking for outdated formulae here so, rather than ever traverse through the formula history, look at the outdated formula and list them unless we've set `HOMEBREW_UPDATE_REPORT_ALL_FORMULAE` in which case we show the modifications. While we're here, also do a bit of reformatting and renaming to better clarify intent.
Library/Homebrew/description_cache_store.rb
@@ -48,13 +48,13 @@ def update_from_report!(report) return populate_if_empty! if database.empty? return if report.empty? - renamings = report.select_formula(:R) - alterations = report.select_formula(:A) + - report.select_formula(:M) + + renamings = report.select_formula_or_cask(:R) + alterations = report.select_formula_or_cask(:A) + + report.select_formula_or_cask(:M) + renamings.map(&:last) update_from_formula_names!(alterations) - delete_from_formula_names!(report.select_formula(:D) + + delete_from_formula_names!(report.select_formula_or_cask(:D) + renamings.map(&:first)) end @@ -114,11 +114,11 @@ def update_from_report!(report) return populate_if_empty! if database.empty? return if report.empty? - alterations = report.select_formula(:AC) + - report.select_formula(:MC) + alterations = report.select_formula_or_cask(:AC) + + report.select_formula_or_cask(:MC) update_from_cask_tokens!(alterations) - delete_from_cask_tokens!(report.select_formula(:DC)) + delete_from_cask_tokens!(report.select_formula_or_cask(:DC)) end # Use an array of cask tokens to update the {CaskDescriptionCacheStore}.
true
Other
Homebrew
brew
04c8e02418cb083f8c2b6f9e8b5ae83a23c1bdce.json
cmd/update-report: use better wording where appropriate. From reading https://github.com/orgs/Homebrew/discussions/3328: I initially thought we should just change "Updated" to "Modified" when appropriate. After conversation with Bo98, though, I thought more and saw that we're already checking for outdated formulae here so, rather than ever traverse through the formula history, look at the outdated formula and list them unless we've set `HOMEBREW_UPDATE_REPORT_ALL_FORMULAE` in which case we show the modifications. While we're here, also do a bit of reformatting and renaming to better clarify intent.
Library/Homebrew/env_config.rb
@@ -11,15 +11,15 @@ module EnvConfig module_function ENVS = { - HOMEBREW_ADDITIONAL_GOOGLE_ANALYTICS_ID: { + HOMEBREW_ADDITIONAL_GOOGLE_ANALYTICS_ID: { description: "Additional Google Analytics tracking ID to emit user behaviour analytics to. " \ "For more information, see: <https://docs.brew.sh/Analytics>", }, - HOMEBREW_ARCH: { + HOMEBREW_ARCH: { description: "Linux only: Pass this value to a type name representing the compiler's `-march` option.", default: "native", }, - HOMEBREW_ARTIFACT_DOMAIN: { + HOMEBREW_ARTIFACT_DOMAIN: { description: "Prefix all download URLs, including those for bottles, with this value. " \ "For example, `HOMEBREW_ARTIFACT_DOMAIN=http://localhost:8080` will cause a " \ "formula with the URL `https://example.com/foo.tar.gz` to instead download from " \ @@ -30,26 +30,26 @@ module EnvConfig "to instead be downloaded from " \ "`http://localhost:8080/v2/homebrew/core/gettext/manifests/0.21`", }, - HOMEBREW_AUTO_UPDATE_SECS: { + HOMEBREW_AUTO_UPDATE_SECS: { description: "Run `brew update` once every `HOMEBREW_AUTO_UPDATE_SECS` seconds before some commands, " \ "e.g. `brew install`, `brew upgrade` and `brew tap`. Alternatively, " \ "disable auto-update entirely with HOMEBREW_NO_AUTO_UPDATE.", default: 300, }, - HOMEBREW_BAT: { + HOMEBREW_BAT: { description: "If set, use `bat` for the `brew cat` command.", boolean: true, }, - HOMEBREW_BAT_CONFIG_PATH: { + HOMEBREW_BAT_CONFIG_PATH: { description: "Use this as the `bat` configuration file.", default_text: "`$HOME/.config/bat/config`.", }, - HOMEBREW_BOOTSNAP: { + HOMEBREW_BOOTSNAP: { 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: { + HOMEBREW_BOTTLE_DOMAIN: { description: "Use this URL as the download mirror for bottles. " \ "If bottles at that URL are temporarily unavailable, " \ "the default bottle domain will be used as a fallback mirror. " \ @@ -60,166 +60,166 @@ module EnvConfig default_text: "`https://ghcr.io/v2/homebrew/core`.", default: HOMEBREW_BOTTLE_DEFAULT_DOMAIN, }, - HOMEBREW_BREW_GIT_REMOTE: { + HOMEBREW_BREW_GIT_REMOTE: { description: "Use this URL as the Homebrew/brew `git`(1) remote.", default: HOMEBREW_BREW_DEFAULT_GIT_REMOTE, }, - HOMEBREW_BROWSER: { + HOMEBREW_BROWSER: { description: "Use this as the browser when opening project homepages.", default_text: "`$BROWSER` or the OS's default browser.", }, - HOMEBREW_CACHE: { + HOMEBREW_CACHE: { description: "Use this directory as the download cache.", default_text: "macOS: `$HOME/Library/Caches/Homebrew`, " \ "Linux: `$XDG_CACHE_HOME/Homebrew` or `$HOME/.cache/Homebrew`.", default: HOMEBREW_DEFAULT_CACHE, }, - HOMEBREW_CASK_OPTS: { + HOMEBREW_CASK_OPTS: { description: "Append these options to all `cask` commands. All `--*dir` options, " \ "`--language`, `--require-sha`, `--no-quarantine` and `--no-binaries` are supported. " \ "For example, you might add something like the following to your " \ "`~/.profile`, `~/.bash_profile`, or `~/.zshenv`:\n\n" \ ' `export HOMEBREW_CASK_OPTS="--appdir=~/Applications --fontdir=/Library/Fonts"`', }, - HOMEBREW_CLEANUP_PERIODIC_FULL_DAYS: { + HOMEBREW_CLEANUP_PERIODIC_FULL_DAYS: { description: "If set, `brew install`, `brew upgrade` and `brew reinstall` will cleanup all formulae " \ "when this number of days has passed.", default: 30, }, - HOMEBREW_CLEANUP_MAX_AGE_DAYS: { + HOMEBREW_CLEANUP_MAX_AGE_DAYS: { description: "Cleanup all cached files older than this many days.", default: 120, }, - HOMEBREW_COLOR: { + HOMEBREW_COLOR: { description: "If set, force colour output on non-TTY outputs.", boolean: true, }, - HOMEBREW_CORE_GIT_REMOTE: { + HOMEBREW_CORE_GIT_REMOTE: { description: "Use this URL as the Homebrew/homebrew-core `git`(1) remote.", default_text: "`https://github.com/Homebrew/homebrew-core`.", default: HOMEBREW_CORE_DEFAULT_GIT_REMOTE, }, - HOMEBREW_CURLRC: { + HOMEBREW_CURLRC: { description: "If set, do not pass `--disable` when invoking `curl`(1), which disables the " \ "use of `curlrc`.", boolean: true, }, - HOMEBREW_CURL_RETRIES: { + HOMEBREW_CURL_RETRIES: { description: "Pass the given retry count to `--retry` when invoking `curl`(1).", default: 3, }, - HOMEBREW_CURL_VERBOSE: { + HOMEBREW_CURL_VERBOSE: { description: "If set, pass `--verbose` when invoking `curl`(1).", boolean: true, }, - HOMEBREW_DEVELOPER: { + HOMEBREW_DEVELOPER: { description: "If set, tweak behaviour to be more relevant for Homebrew developers (active or " \ "budding) by e.g. turning warnings into errors.", boolean: true, }, - HOMEBREW_DISABLE_LOAD_FORMULA: { + HOMEBREW_DISABLE_LOAD_FORMULA: { description: "If set, refuse to load formulae. This is useful when formulae are not trusted (such " \ "as in pull requests).", boolean: true, }, - HOMEBREW_DISPLAY: { + HOMEBREW_DISPLAY: { description: "Use this X11 display when opening a page in a browser, for example with " \ "`brew home`. Primarily useful on Linux.", default_text: "`$DISPLAY`.", }, - HOMEBREW_DISPLAY_INSTALL_TIMES: { + HOMEBREW_DISPLAY_INSTALL_TIMES: { description: "If set, print install times for each formula at the end of the run.", boolean: true, }, - HOMEBREW_EDITOR: { + HOMEBREW_EDITOR: { description: "Use this editor when editing a single formula, or several formulae in the " \ "same directory." \ "\n\n *Note:* `brew edit` will open all of Homebrew as discontinuous files " \ "and directories. Visual Studio Code can handle this correctly in project mode, but many " \ "editors will do strange things in this case.", default_text: "`$EDITOR` or `$VISUAL`.", }, - HOMEBREW_FAIL_LOG_LINES: { + HOMEBREW_FAIL_LOG_LINES: { description: "Output this many lines of output on formula `system` failures.", default: 15, }, - HOMEBREW_FORBIDDEN_LICENSES: { + HOMEBREW_FORBIDDEN_LICENSES: { description: "A space-separated list of licenses. Homebrew will refuse to install a " \ "formula if it or any of its dependencies has a license on this list.", }, - HOMEBREW_FORCE_BREWED_CA_CERTIFICATES: { + HOMEBREW_FORCE_BREWED_CA_CERTIFICATES: { description: "If set, always use a Homebrew-installed `ca-certificates` rather than the system version. " \ "Automatically set if the system version is too old.", boolean: true, }, - HOMEBREW_FORCE_BREWED_CURL: { + HOMEBREW_FORCE_BREWED_CURL: { description: "If set, always use a Homebrew-installed `curl`(1) rather than the system version. " \ "Automatically set if the system version of `curl` is too old.", boolean: true, }, - HOMEBREW_FORCE_BREWED_GIT: { + HOMEBREW_FORCE_BREWED_GIT: { description: "If set, always use a Homebrew-installed `git`(1) rather than the system version. " \ "Automatically set if the system version of `git` is too old.", boolean: true, }, - HOMEBREW_FORCE_VENDOR_RUBY: { + HOMEBREW_FORCE_VENDOR_RUBY: { description: "If set, always use Homebrew's vendored, relocatable Ruby version even if the system version " \ "of Ruby is new enough.", boolean: true, }, - HOMEBREW_GITHUB_API_TOKEN: { + HOMEBREW_GITHUB_API_TOKEN: { description: "Use this personal access token for the GitHub API, for features such as " \ "`brew search`. You can create one at <https://github.com/settings/tokens>. If set, " \ "GitHub will allow you a greater number of API requests. For more information, see: " \ "<https://docs.github.com/en/rest/overview/resources-in-the-rest-api#rate-limiting>" \ "\n\n *Note:* Homebrew doesn't require permissions for any of the scopes, but some " \ "developer commands may require additional permissions.", }, - HOMEBREW_GITHUB_PACKAGES_TOKEN: { + HOMEBREW_GITHUB_PACKAGES_TOKEN: { description: "Use this GitHub personal access token when accessing the GitHub Packages Registry "\ "(where bottles may be stored).", }, - HOMEBREW_DOCKER_REGISTRY_BASIC_AUTH_TOKEN: { + HOMEBREW_DOCKER_REGISTRY_BASIC_AUTH_TOKEN: { description: "Use this base64 encoded username and password for authenticating with a Docker registry " \ "proxying GitHub Packages. If HOMEBREW_DOCKER_REGISTRY_TOKEN is set, it will be used instead.", }, - HOMEBREW_DOCKER_REGISTRY_TOKEN: { + HOMEBREW_DOCKER_REGISTRY_TOKEN: { description: "Use this bearer token for authenticating with a Docker registry proxying GitHub Packages. " \ "Preferred over HOMEBREW_DOCKER_REGISTRY_TOKEN_BASIC.", }, - HOMEBREW_GITHUB_PACKAGES_USER: { + HOMEBREW_GITHUB_PACKAGES_USER: { description: "Use this username when accessing the GitHub Packages Registry (where bottles may be stored).", }, - HOMEBREW_GIT_EMAIL: { + HOMEBREW_GIT_EMAIL: { description: "Set the Git author and committer email to this value.", }, - HOMEBREW_GIT_NAME: { + HOMEBREW_GIT_NAME: { description: "Set the Git author and committer name to this value.", }, - HOMEBREW_INSTALL_BADGE: { + HOMEBREW_INSTALL_BADGE: { description: "Print this text before the installation summary of each successful build.", default_text: 'The "Beer Mug" emoji.', default: "🍺", }, - HOMEBREW_INSTALL_FROM_API: { + HOMEBREW_INSTALL_FROM_API: { description: "If set, install formulae and casks in homebrew/core and homebrew/cask taps using Homebrew's " \ "API instead of needing (large, slow) local checkouts of these repositories." \ "\n\n *Note:* Setting HOMEBREW_INSTALL_FROM_API is not compatible with Homebrew's " \ "developer mode so will error (as Homebrew development needs a full clone).", boolean: true, }, - HOMEBREW_LIVECHECK_WATCHLIST: { + HOMEBREW_LIVECHECK_WATCHLIST: { description: "Consult this file for the list of formulae to check by default when no formula argument " \ "is passed to `brew livecheck`.", default: "$HOME/.brew_livecheck_watchlist", }, - HOMEBREW_LOGS: { + HOMEBREW_LOGS: { description: "Use this directory to store log files.", default_text: "macOS: `$HOME/Library/Logs/Homebrew`, " \ "Linux: `$XDG_CACHE_HOME/Homebrew/Logs` or `$HOME/.cache/Homebrew/Logs`.", default: HOMEBREW_DEFAULT_LOGS, }, - HOMEBREW_MAKE_JOBS: { + HOMEBREW_MAKE_JOBS: { description: "Use this value as the number of parallel jobs to run when building with `make`(1).", default_text: "The number of available CPU cores.", default: lambda { @@ -228,100 +228,100 @@ module EnvConfig Hardware::CPU.cores }, }, - HOMEBREW_NO_ANALYTICS: { + HOMEBREW_NO_ANALYTICS: { description: "If set, do not send analytics. For more information, see: <https://docs.brew.sh/Analytics>", boolean: true, }, - HOMEBREW_NO_AUTO_UPDATE: { + HOMEBREW_NO_AUTO_UPDATE: { description: "If set, do not automatically update before running some commands, e.g. " \ "`brew install`, `brew upgrade` and `brew tap`. Alternatively, " \ "run this less often by setting HOMEBREW_AUTO_UPDATE_SECS to a value higher than the default.", boolean: true, }, - HOMEBREW_NO_BOOTSNAP: { + HOMEBREW_NO_BOOTSNAP: { description: "If set, do not use Bootsnap to speed up repeated `brew` calls.", boolean: true, }, - HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: { + HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: { description: "If set, do not check for broken linkage of dependents or outdated dependents after " \ "installing, upgrading or reinstalling formulae. This will result in fewer dependents " \ " (and their dependencies) being upgraded or reinstalled but may result in more breakage " \ "from running `brew install <formula>` or `brew upgrade <formula>`.", boolean: true, }, - HOMEBREW_NO_CLEANUP_FORMULAE: { + HOMEBREW_NO_CLEANUP_FORMULAE: { description: "A comma-separated list of formulae. Homebrew will refuse to clean up a " \ "formula if it appears on this list.", }, - HOMEBREW_NO_COLOR: { + HOMEBREW_NO_COLOR: { description: "If set, do not print text with colour added.", default_text: "`$NO_COLOR`.", boolean: true, }, - HOMEBREW_NO_COMPAT: { + HOMEBREW_NO_COMPAT: { description: "If set, disable all use of legacy compatibility code.", boolean: true, }, - HOMEBREW_NO_EMOJI: { + HOMEBREW_NO_EMOJI: { description: "If set, do not print `HOMEBREW_INSTALL_BADGE` on a successful build." \ "\n\n *Note:* Will only try to print emoji on OS X Lion or newer.", boolean: true, }, - HOMEBREW_NO_ENV_HINTS: { + HOMEBREW_NO_ENV_HINTS: { description: "If set, do not print any hints about changing Homebrew's behaviour with environment variables.", boolean: true, }, - HOMEBREW_NO_GITHUB_API: { + HOMEBREW_NO_GITHUB_API: { description: "If set, do not use the GitHub API, e.g. for searches or fetching relevant issues " \ "after a failed install.", boolean: true, }, - HOMEBREW_NO_INSECURE_REDIRECT: { + HOMEBREW_NO_INSECURE_REDIRECT: { description: "If set, forbid redirects from secure HTTPS to insecure HTTP." \ "\n\n *Note:* While ensuring your downloads are fully secure, this is likely to cause " \ "from-source SourceForge, some GNU & GNOME-hosted formulae to fail to download.", boolean: true, }, - HOMEBREW_NO_INSTALL_CLEANUP: { + HOMEBREW_NO_INSTALL_CLEANUP: { description: "If set, `brew install`, `brew upgrade` and `brew reinstall` will never automatically " \ "cleanup installed/upgraded/reinstalled formulae or all formulae every " \ "`HOMEBREW_CLEANUP_PERIODIC_FULL_DAYS` days. Alternatively, HOMEBREW_NO_CLEANUP_FORMULAE " \ "allows specifying specific formulae to not clean up.", boolean: true, }, - HOMEBREW_NO_INSTALL_UPGRADE: { + HOMEBREW_NO_INSTALL_UPGRADE: { description: "If set, `brew install <formula>` will not upgrade `<formula>` if it is installed but " \ "outdated.", boolean: true, }, - HOMEBREW_PRY: { + HOMEBREW_PRY: { description: "If set, use Pry for the `brew irb` command.", boolean: true, }, - HOMEBREW_SIMULATE_MACOS_ON_LINUX: { + HOMEBREW_SIMULATE_MACOS_ON_LINUX: { description: "If set, running Homebrew on Linux will simulate certain macOS code paths. This is useful " \ "when auditing macOS formulae while on Linux.", boolean: true, }, - HOMEBREW_SSH_CONFIG_PATH: { + HOMEBREW_SSH_CONFIG_PATH: { description: "If set, Homebrew will use the given config file instead of `~/.ssh/config` when fetching " \ "`git` repos over `ssh`.", default_text: "`$HOME/.ssh/config`", }, - HOMEBREW_SKIP_OR_LATER_BOTTLES: { + HOMEBREW_SKIP_OR_LATER_BOTTLES: { description: "If set along with `HOMEBREW_DEVELOPER`, do not use bottles from older versions " \ "of macOS. This is useful in development on new macOS versions.", boolean: true, }, - HOMEBREW_SORBET_RUNTIME: { + HOMEBREW_SORBET_RUNTIME: { description: "If set, enable runtime typechecking using Sorbet.", boolean: true, }, - HOMEBREW_SVN: { + HOMEBREW_SVN: { description: "Use this as the `svn`(1) binary.", default_text: "A Homebrew-built Subversion (if installed), or the system-provided binary.", }, - HOMEBREW_TEMP: { + HOMEBREW_TEMP: { description: "Use this path as the temporary directory for building packages. Changing " \ "this may be needed if your system temporary directory and Homebrew prefix are on " \ "different volumes, as macOS has trouble moving symlinks across volumes when the target " \ @@ -330,50 +330,46 @@ module EnvConfig default_text: "macOS: `/private/tmp`, Linux: `/tmp`.", default: HOMEBREW_DEFAULT_TEMP, }, - HOMEBREW_UPDATE_REPORT_ALL_FORMULAE: { - description: "If set, `brew update` lists updates to all software.", + HOMEBREW_UPDATE_REPORT_ALL_FORMULAE: { + description: "If set, `brew update` lists changes to all formulae and cask files rather than only showing " \ + "when they are installed or outdated.", boolean: true, }, - HOMEBREW_UPDATE_REPORT_VERSION_CHANGED_FORMULAE: { - description: "If set, `brew update` only lists updates to formulae with differing versions. " \ - "Note this is slower than the default behaviour.", - boolean: true, - }, - HOMEBREW_UPDATE_TO_TAG: { + HOMEBREW_UPDATE_TO_TAG: { description: "If set, always use the latest stable tag (even if developer commands " \ "have been run).", boolean: true, }, - HOMEBREW_VERBOSE: { + HOMEBREW_VERBOSE: { description: "If set, always assume `--verbose` when running commands.", boolean: true, }, - HOMEBREW_DEBUG: { + HOMEBREW_DEBUG: { description: "If set, always assume `--debug` when running commands.", boolean: true, }, - HOMEBREW_VERBOSE_USING_DOTS: { + HOMEBREW_VERBOSE_USING_DOTS: { description: "If set, verbose output will print a `.` no more than once a minute. This can be " \ "useful to avoid long-running Homebrew commands being killed due to no output.", boolean: true, }, - all_proxy: { + all_proxy: { description: "Use this SOCKS5 proxy for `curl`(1), `git`(1) and `svn`(1) when downloading through Homebrew.", }, - ftp_proxy: { + ftp_proxy: { description: "Use this FTP proxy for `curl`(1), `git`(1) and `svn`(1) when downloading through Homebrew.", }, - http_proxy: { + http_proxy: { description: "Use this HTTP proxy for `curl`(1), `git`(1) and `svn`(1) when downloading through Homebrew.", }, - https_proxy: { + https_proxy: { description: "Use this HTTPS proxy for `curl`(1), `git`(1) and `svn`(1) when downloading through Homebrew.", }, - no_proxy: { + no_proxy: { description: "A comma-separated list of hostnames and domain names excluded " \ "from proxying by `curl`(1), `git`(1) and `svn`(1) when downloading through Homebrew.", }, - SUDO_ASKPASS: { + SUDO_ASKPASS: { description: "If set, pass the `-A` option when calling `sudo`(8).", }, }.freeze
true
Other
Homebrew
brew
04c8e02418cb083f8c2b6f9e8b5ae83a23c1bdce.json
cmd/update-report: use better wording where appropriate. From reading https://github.com/orgs/Homebrew/discussions/3328: I initially thought we should just change "Updated" to "Modified" when appropriate. After conversation with Bo98, though, I thought more and saw that we're already checking for outdated formulae here so, rather than ever traverse through the formula history, look at the outdated formula and list them unless we've set `HOMEBREW_UPDATE_REPORT_ALL_FORMULAE` in which case we show the modifications. While we're here, also do a bit of reformatting and renaming to better clarify intent.
Library/Homebrew/test/cmd/update-report_spec.rb
@@ -52,39 +52,39 @@ def perform_update(fixture_name = "") specify "without Formula changes" do perform_update("update_git_diff_output_without_formulae_changes") - expect(hub.select_formula(:M)).to be_empty - expect(hub.select_formula(:A)).to be_empty - expect(hub.select_formula(:D)).to be_empty + expect(hub.select_formula_or_cask(:M)).to be_empty + expect(hub.select_formula_or_cask(:A)).to be_empty + expect(hub.select_formula_or_cask(:D)).to be_empty end specify "with Formula changes" do perform_update("update_git_diff_output_with_formulae_changes") - expect(hub.select_formula(:M)).to eq(%w[xar yajl]) - expect(hub.select_formula(:A)).to eq(%w[antiword bash-completion ddrescue dict lua]) + expect(hub.select_formula_or_cask(:M)).to eq(%w[xar yajl]) + expect(hub.select_formula_or_cask(:A)).to eq(%w[antiword bash-completion ddrescue dict lua]) end specify "with removed Formulae" do perform_update("update_git_diff_output_with_removed_formulae") - expect(hub.select_formula(:D)).to eq(%w[libgsasl]) + expect(hub.select_formula_or_cask(:D)).to eq(%w[libgsasl]) end specify "with changed file type" do perform_update("update_git_diff_output_with_changed_filetype") - expect(hub.select_formula(:M)).to eq(%w[elixir]) - expect(hub.select_formula(:A)).to eq(%w[libbson]) - expect(hub.select_formula(:D)).to eq(%w[libgsasl]) + expect(hub.select_formula_or_cask(:M)).to eq(%w[elixir]) + expect(hub.select_formula_or_cask(:A)).to eq(%w[libbson]) + expect(hub.select_formula_or_cask(:D)).to eq(%w[libgsasl]) end specify "with renamed Formula" do allow(tap).to receive(:formula_renames).and_return("cv" => "progress") perform_update("update_git_diff_output_with_formula_rename") - expect(hub.select_formula(:A)).to be_empty - expect(hub.select_formula(:D)).to be_empty - expect(hub.select_formula(:R)).to eq([["cv", "progress"]]) + expect(hub.select_formula_or_cask(:A)).to be_empty + expect(hub.select_formula_or_cask(:D)).to be_empty + expect(hub.select_formula_or_cask(:R)).to eq([["cv", "progress"]]) end context "when updating a Tap other than the core Tap" do @@ -101,34 +101,34 @@ def perform_update(fixture_name = "") specify "with restructured Tap" do perform_update("update_git_diff_output_with_restructured_tap") - expect(hub.select_formula(:A)).to be_empty - expect(hub.select_formula(:D)).to be_empty - expect(hub.select_formula(:R)).to be_empty + expect(hub.select_formula_or_cask(:A)).to be_empty + expect(hub.select_formula_or_cask(:D)).to be_empty + expect(hub.select_formula_or_cask(:R)).to be_empty end specify "with renamed Formula and restructured Tap" do allow(tap).to receive(:formula_renames).and_return("xchat" => "xchat2") perform_update("update_git_diff_output_with_formula_rename_and_restructuring") - expect(hub.select_formula(:A)).to be_empty - expect(hub.select_formula(:D)).to be_empty - expect(hub.select_formula(:R)).to eq([%w[foo/bar/xchat foo/bar/xchat2]]) + expect(hub.select_formula_or_cask(:A)).to be_empty + expect(hub.select_formula_or_cask(:D)).to be_empty + expect(hub.select_formula_or_cask(:R)).to eq([%w[foo/bar/xchat foo/bar/xchat2]]) end specify "with simulated 'homebrew/php' restructuring" do perform_update("update_git_diff_simulate_homebrew_php_restructuring") - expect(hub.select_formula(:A)).to be_empty - expect(hub.select_formula(:D)).to be_empty - expect(hub.select_formula(:R)).to be_empty + expect(hub.select_formula_or_cask(:A)).to be_empty + expect(hub.select_formula_or_cask(:D)).to be_empty + expect(hub.select_formula_or_cask(:R)).to be_empty end specify "with Formula changes" do perform_update("update_git_diff_output_with_tap_formulae_changes") - expect(hub.select_formula(:A)).to eq(%w[foo/bar/lua]) - expect(hub.select_formula(:M)).to eq(%w[foo/bar/git]) - expect(hub.select_formula(:D)).to be_empty + expect(hub.select_formula_or_cask(:A)).to eq(%w[foo/bar/lua]) + expect(hub.select_formula_or_cask(:M)).to eq(%w[foo/bar/git]) + expect(hub.select_formula_or_cask(:D)).to be_empty end end end
true
Other
Homebrew
brew
04c8e02418cb083f8c2b6f9e8b5ae83a23c1bdce.json
cmd/update-report: use better wording where appropriate. From reading https://github.com/orgs/Homebrew/discussions/3328: I initially thought we should just change "Updated" to "Modified" when appropriate. After conversation with Bo98, though, I thought more and saw that we're already checking for outdated formulae here so, rather than ever traverse through the formula history, look at the outdated formula and list them unless we've set `HOMEBREW_UPDATE_REPORT_ALL_FORMULAE` in which case we show the modifications. While we're here, also do a bit of reformatting and renaming to better clarify intent.
Library/Homebrew/test/description_cache_store_spec.rb
@@ -25,7 +25,7 @@ end describe "#update_from_report!" do - let(:report) { double(select_formula: [], empty?: false) } + let(:report) { double(select_formula_or_cask: [], empty?: false) } it "reads from the report" do expect(database).to receive(:empty?).at_least(:once).and_return(false) @@ -60,7 +60,7 @@ let(:database) { double("database") } describe "#update_from_report!" do - let(:report) { double(select_formula: [], empty?: false) } + let(:report) { double(select_formula_or_cask: [], empty?: false) } it "reads from the report" do expect(database).to receive(:empty?).at_least(:once).and_return(false)
true
Other
Homebrew
brew
04c8e02418cb083f8c2b6f9e8b5ae83a23c1bdce.json
cmd/update-report: use better wording where appropriate. From reading https://github.com/orgs/Homebrew/discussions/3328: I initially thought we should just change "Updated" to "Modified" when appropriate. After conversation with Bo98, though, I thought more and saw that we're already checking for outdated formulae here so, rather than ever traverse through the formula history, look at the outdated formula and list them unless we've set `HOMEBREW_UPDATE_REPORT_ALL_FORMULAE` in which case we show the modifications. While we're here, also do a bit of reformatting and renaming to better clarify intent.
Library/Homebrew/utils.rb
@@ -248,6 +248,16 @@ def pretty_installed(f) end end + def pretty_outdated(f) + if !$stdout.tty? + f.to_s + elsif Homebrew::EnvConfig.no_emoji? + Formatter.error("#{Tty.bold}#{f} (outdated)#{Tty.reset}") + else + "#{Tty.bold}#{f} #{Formatter.warning("⚠")}#{Tty.reset}" + end + end + def pretty_uninstalled(f) if !$stdout.tty? f.to_s
true
Other
Homebrew
brew
04c8e02418cb083f8c2b6f9e8b5ae83a23c1bdce.json
cmd/update-report: use better wording where appropriate. From reading https://github.com/orgs/Homebrew/discussions/3328: I initially thought we should just change "Updated" to "Modified" when appropriate. After conversation with Bo98, though, I thought more and saw that we're already checking for outdated formulae here so, rather than ever traverse through the formula history, look at the outdated formula and list them unless we've set `HOMEBREW_UPDATE_REPORT_ALL_FORMULAE` in which case we show the modifications. While we're here, also do a bit of reformatting and renaming to better clarify intent.
docs/Manpage.md
@@ -2172,10 +2172,7 @@ example, run `export HOMEBREW_NO_INSECURE_REDIRECT=1` rather than just *Default:* macOS: `/private/tmp`, Linux: `/tmp`. - `HOMEBREW_UPDATE_REPORT_ALL_FORMULAE` - <br>If set, `brew update` lists updates to all software. - -- `HOMEBREW_UPDATE_REPORT_VERSION_CHANGED_FORMULAE` - <br>If set, `brew update` only lists updates to formulae with differing versions. Note this is slower than the default behaviour. + <br>If set, `brew update` lists changes to all formulae and cask files rather than only showing when they are installed or outdated. - `HOMEBREW_UPDATE_TO_TAG` <br>If set, always use the latest stable tag (even if developer commands have been run).
true
Other
Homebrew
brew
04c8e02418cb083f8c2b6f9e8b5ae83a23c1bdce.json
cmd/update-report: use better wording where appropriate. From reading https://github.com/orgs/Homebrew/discussions/3328: I initially thought we should just change "Updated" to "Modified" when appropriate. After conversation with Bo98, though, I thought more and saw that we're already checking for outdated formulae here so, rather than ever traverse through the formula history, look at the outdated formula and list them unless we've set `HOMEBREW_UPDATE_REPORT_ALL_FORMULAE` in which case we show the modifications. While we're here, also do a bit of reformatting and renaming to better clarify intent.
manpages/brew.1
@@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "BREW" "1" "May 2022" "Homebrew" "brew" +.TH "BREW" "1" "June 2022" "Homebrew" "brew" . .SH "NAME" \fBbrew\fR \- The Missing Package Manager for macOS (or Linux) @@ -3186,13 +3186,7 @@ Use this path as the temporary directory for building packages\. Changing this m \fBHOMEBREW_UPDATE_REPORT_ALL_FORMULAE\fR . .br -If set, \fBbrew update\fR lists updates to all software\. -. -.TP -\fBHOMEBREW_UPDATE_REPORT_VERSION_CHANGED_FORMULAE\fR -. -.br -If set, \fBbrew update\fR only lists updates to formulae with differing versions\. Note this is slower than the default behaviour\. +If set, \fBbrew update\fR lists changes to all formulae and cask files rather than only showing when they are installed or outdated\. . .TP \fBHOMEBREW_UPDATE_TO_TAG\fR
true
Other
Homebrew
brew
195e4d0f89ad53d72ac0ebd4823a41fdfb8d9e2a.json
software_spec: handle nil manifests_annotations. Fixes #13372
Library/Homebrew/software_spec.rb
@@ -384,7 +384,7 @@ def github_packages_manifest_resource_tab(github_packages_manifest_resource) manifests = json["manifests"] raise ArgumentError, "Missing 'manifests' section." if manifests.blank? - manifests_annotations = manifests.map { |m| m["annotations"] } + manifests_annotations = manifests.map { |m| m["annotations"] }.compact raise ArgumentError, "Missing 'annotations' section." if manifests_annotations.blank? bottle_digest = @resource.checksum.hexdigest
false
Other
Homebrew
brew
24def160b6e72c4d3387246b52160387a7f11fc9.json
Update RBI files for yard.
Library/Homebrew/sorbet/rbi/gems/yard@0.9.28.rbi
@@ -202,6 +202,7 @@ module YARD def ruby18?; end def ruby19?; end def ruby2?; end + def ruby31?; end def ruby3?; end def windows?; end end @@ -2408,6 +2409,7 @@ class YARD::Parser::Ruby::ModuleNode < ::YARD::Parser::Ruby::KeywordNode end class YARD::Parser::Ruby::ParameterNode < ::YARD::Parser::Ruby::AstNode + def args_forward; end def block_param; end def double_splat_param; end def named_params; end
false