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 | 6e2f194e0933c82246eb84aa0fd7283832bc435e.json | rubocops/shell_commands: add cop for shell metacharacters in `exec` | Library/Homebrew/rubocops/shell_commands.rb | @@ -7,6 +7,42 @@
module RuboCop
module Cop
module Style
+ # https://github.com/ruby/ruby/blob/v2_6_3/process.c#L2430-L2460
+ SHELL_BUILTINS = %w[
+ !
+ .
+ :
+ break
+ case
+ continue
+ do
+ done
+ elif
+ else
+ esac
+ eval
+ exec
+ exit
+ export
+ fi
+ for
+ if
+ in
+ readonly
+ return
+ set
+ shift
+ then
+ times
+ trap
+ unset
+ until
+ while
+ ].freeze
+
+ # https://github.com/ruby/ruby/blob/v2_6_3/process.c#L2495
+ SHELL_METACHARACTERS = %W[* ? { } [ ] < > ( ) ~ & | \\ $ ; ' ` " \n #].freeze
+
# This cop makes sure that shell command arguments are separated.
#
# @api private
@@ -27,8 +63,6 @@ class ShellCommands < Base
].freeze
RESTRICT_ON_SEND = TARGET_METHODS.map(&:second).uniq.freeze
- SHELL_METACHARACTERS = %w[> < < | ; : & * $ ? : ~ + @ ! ` ( ) [ ]].freeze
-
def on_send(node)
TARGET_METHODS.each do |target_class, target_method|
next unless node.method_name == target_method
@@ -49,13 +83,17 @@ def on_send(node)
next if first_arg.nil? || arg_count >= 2
first_arg_str = string_content(first_arg)
-
- # Only separate when no shell metacharacters are present
- next if SHELL_METACHARACTERS.any? { |meta| first_arg_str.include?(meta) }
+ stripped_first_arg_str = string_content(first_arg, strip_dynamic: true)
split_args = first_arg_str.shellsplit
next if split_args.count <= 1
+ # Only separate when no shell metacharacters are present
+ command = split_args.first
+ next if SHELL_BUILTINS.any?(command)
+ next if command&.include?("=")
+ next if SHELL_METACHARACTERS.any? { |meta| stripped_first_arg_str.include?(meta) }
+
good_args = split_args.map { |arg| "\"#{arg}\"" }.join(", ")
method_string = if target_class
"#{target_class}.#{target_method}"
@@ -68,6 +106,32 @@ def on_send(node)
end
end
end
+
+ # This cop disallows shell metacharacters in `exec` calls.
+ #
+ # @api private
+ class ExecShellMetacharacters < Base
+ include HelperFunctions
+
+ MSG = "Don't use shell metacharacters in `exec`. "\
+ "Implement the logic in Ruby instead, using methods like `$stdout.reopen`."
+
+ RESTRICT_ON_SEND = [:exec].freeze
+
+ def on_send(node)
+ return if node.receiver.present? && node.receiver != s(:const, nil, :Kernel)
+ return if node.arguments.count != 1
+
+ stripped_arg_str = string_content(node.arguments.first, strip_dynamic: true)
+ command = string_content(node.arguments.first).shellsplit.first
+
+ return if SHELL_BUILTINS.none?(command) &&
+ !command&.include?("=") &&
+ SHELL_METACHARACTERS.none? { |meta| stripped_arg_str.include?(meta) }
+
+ add_offense(node.arguments.first, message: MSG)
+ end
+ end
end
end
end | true |
Other | Homebrew | brew | 6e2f194e0933c82246eb84aa0fd7283832bc435e.json | rubocops/shell_commands: add cop for shell metacharacters in `exec` | Library/Homebrew/test/rubocops/shell_commands_spec.rb | @@ -3,210 +3,239 @@
require "rubocops/shell_commands"
-describe RuboCop::Cop::Style::ShellCommands do
- subject(:cop) { described_class.new }
-
- context "when auditing shell commands" do
- it "reports and corrects an offense when `system` arguments should be separated" do
- expect_offense(<<~RUBY)
- class Foo < Formula
- def install
- system "foo bar"
- ^^^^^^^^^ Separate `system` commands into `\"foo\", \"bar\"`
- end
- end
- RUBY
-
- expect_correction(<<~RUBY)
- class Foo < Formula
- def install
- system "foo", "bar"
- end
- end
- RUBY
- end
-
- it "reports and corrects an offense when `system` arguments with string interpolation should be separated" do
- expect_offense(<<~RUBY)
- class Foo < Formula
- def install
- system "\#{bin}/foo bar"
- ^^^^^^^^^^^^^^^^ Separate `system` commands into `\"\#{bin}/foo\", \"bar\"`
- end
- end
- RUBY
-
- expect_correction(<<~RUBY)
- class Foo < Formula
- def install
- system "\#{bin}/foo", "bar"
- end
- end
- RUBY
- end
-
- it "reports no offenses when `system` with metacharacter arguments are called" do
- expect_no_offenses(<<~RUBY)
- class Foo < Formula
- def install
- system "foo bar > baz"
- end
- end
- RUBY
- end
-
- it "reports no offenses when trailing arguments to `system` are unseparated" do
- expect_no_offenses(<<~RUBY)
- class Foo < Formula
- def install
- system "foo", "bar baz"
- end
- end
- RUBY
- end
-
- it "reports no offenses when `Utils.popen` arguments are unseparated" do
- expect_no_offenses(<<~RUBY)
- class Foo < Formula
- def install
- Utils.popen("foo bar")
- end
- end
- RUBY
- end
-
- it "reports and corrects an offense when `Utils.popen_read` arguments are unseparated" do
- expect_offense(<<~RUBY)
- class Foo < Formula
- def install
- Utils.popen_read("foo bar")
- ^^^^^^^^^ Separate `Utils.popen_read` commands into `\"foo\", \"bar\"`
- end
- end
- RUBY
-
- expect_correction(<<~RUBY)
- class Foo < Formula
- def install
- Utils.popen_read("foo", "bar")
- end
- end
- RUBY
- end
-
- it "reports and corrects an offense when `Utils.safe_popen_read` arguments are unseparated" do
- expect_offense(<<~RUBY)
- class Foo < Formula
- def install
- Utils.safe_popen_read("foo bar")
- ^^^^^^^^^ Separate `Utils.safe_popen_read` commands into `\"foo\", \"bar\"`
- end
- end
- RUBY
-
- expect_correction(<<~RUBY)
- class Foo < Formula
- def install
- Utils.safe_popen_read("foo", "bar")
- end
- end
- RUBY
- end
-
- it "reports and corrects an offense when `Utils.popen_write` arguments are unseparated" do
- expect_offense(<<~RUBY)
- class Foo < Formula
- def install
- Utils.popen_write("foo bar")
- ^^^^^^^^^ Separate `Utils.popen_write` commands into `\"foo\", \"bar\"`
- end
- end
- RUBY
-
- expect_correction(<<~RUBY)
- class Foo < Formula
- def install
- Utils.popen_write("foo", "bar")
- end
- end
- RUBY
- end
-
- it "reports and corrects an offense when `Utils.safe_popen_write` arguments are unseparated" do
- expect_offense(<<~RUBY)
- class Foo < Formula
- def install
- Utils.safe_popen_write("foo bar")
- ^^^^^^^^^ Separate `Utils.safe_popen_write` commands into `\"foo\", \"bar\"`
- end
- end
- RUBY
-
- expect_correction(<<~RUBY)
- class Foo < Formula
- def install
- Utils.safe_popen_write("foo", "bar")
- end
- end
- RUBY
- end
-
- it "reports and corrects an offense when `Utils.popen_read` arguments with interpolation are unseparated" do
- expect_offense(<<~RUBY)
- class Foo < Formula
- def install
- Utils.popen_read("\#{bin}/foo bar")
- ^^^^^^^^^^^^^^^^ Separate `Utils.popen_read` commands into `\"\#{bin}/foo\", \"bar\"`
- end
- end
- RUBY
-
- expect_correction(<<~RUBY)
- class Foo < Formula
- def install
- Utils.popen_read("\#{bin}/foo", "bar")
- end
- end
- RUBY
- end
-
- it "reports no offenses when `Utils.popen_read` arguments with metacharacters are unseparated" do
- expect_no_offenses(<<~RUBY)
- class Foo < Formula
- def install
- Utils.popen_read("foo bar > baz")
- end
- end
- RUBY
- end
-
- it "reports no offenses when trailing arguments to `Utils.popen_read` are unseparated" do
- expect_no_offenses(<<~RUBY)
- class Foo < Formula
- def install
- Utils.popen_read("foo", "bar baz")
- end
- end
- RUBY
- end
-
- it "reports and corrects an offense when `Utils.popen_read` arguments are unseparated after a shell variable" do
- expect_offense(<<~RUBY)
- class Foo < Formula
- def install
- Utils.popen_read({ "SHELL" => "bash"}, "foo bar")
- ^^^^^^^^^ Separate `Utils.popen_read` commands into `\"foo\", \"bar\"`
- end
- end
- RUBY
-
- expect_correction(<<~RUBY)
- class Foo < Formula
- def install
- Utils.popen_read({ "SHELL" => "bash"}, "foo", "bar")
- end
- end
- RUBY
+module RuboCop
+ module Cop
+ module Style
+ describe ShellCommands do
+ subject(:cop) { described_class.new }
+
+ context "when auditing shell commands" do
+ it "reports and corrects an offense when `system` arguments should be separated" do
+ expect_offense(<<~RUBY)
+ class Foo < Formula
+ def install
+ system "foo bar"
+ ^^^^^^^^^ Separate `system` commands into `\"foo\", \"bar\"`
+ end
+ end
+ RUBY
+
+ expect_correction(<<~RUBY)
+ class Foo < Formula
+ def install
+ system "foo", "bar"
+ end
+ end
+ RUBY
+ end
+
+ it "reports and corrects an offense when `system` arguments involving interpolation should be separated" do
+ expect_offense(<<~RUBY)
+ class Foo < Formula
+ def install
+ system "\#{bin}/foo bar"
+ ^^^^^^^^^^^^^^^^ Separate `system` commands into `\"\#{bin}/foo\", \"bar\"`
+ end
+ end
+ RUBY
+
+ expect_correction(<<~RUBY)
+ class Foo < Formula
+ def install
+ system "\#{bin}/foo", "bar"
+ end
+ end
+ RUBY
+ end
+
+ it "reports no offenses when `system` with metacharacter arguments are called" do
+ expect_no_offenses(<<~RUBY)
+ class Foo < Formula
+ def install
+ system "foo bar > baz"
+ end
+ end
+ RUBY
+ end
+
+ it "reports no offenses when trailing arguments to `system` are unseparated" do
+ expect_no_offenses(<<~RUBY)
+ class Foo < Formula
+ def install
+ system "foo", "bar baz"
+ end
+ end
+ RUBY
+ end
+
+ it "reports no offenses when `Utils.popen` arguments are unseparated" do
+ expect_no_offenses(<<~RUBY)
+ class Foo < Formula
+ def install
+ Utils.popen("foo bar")
+ end
+ end
+ RUBY
+ end
+
+ it "reports and corrects an offense when `Utils.popen_read` arguments are unseparated" do
+ expect_offense(<<~RUBY)
+ class Foo < Formula
+ def install
+ Utils.popen_read("foo bar")
+ ^^^^^^^^^ Separate `Utils.popen_read` commands into `\"foo\", \"bar\"`
+ end
+ end
+ RUBY
+
+ expect_correction(<<~RUBY)
+ class Foo < Formula
+ def install
+ Utils.popen_read("foo", "bar")
+ end
+ end
+ RUBY
+ end
+
+ it "reports and corrects an offense when `Utils.safe_popen_read` arguments are unseparated" do
+ expect_offense(<<~RUBY)
+ class Foo < Formula
+ def install
+ Utils.safe_popen_read("foo bar")
+ ^^^^^^^^^ Separate `Utils.safe_popen_read` commands into `\"foo\", \"bar\"`
+ end
+ end
+ RUBY
+
+ expect_correction(<<~RUBY)
+ class Foo < Formula
+ def install
+ Utils.safe_popen_read("foo", "bar")
+ end
+ end
+ RUBY
+ end
+
+ it "reports and corrects an offense when `Utils.popen_write` arguments are unseparated" do
+ expect_offense(<<~RUBY)
+ class Foo < Formula
+ def install
+ Utils.popen_write("foo bar")
+ ^^^^^^^^^ Separate `Utils.popen_write` commands into `\"foo\", \"bar\"`
+ end
+ end
+ RUBY
+
+ expect_correction(<<~RUBY)
+ class Foo < Formula
+ def install
+ Utils.popen_write("foo", "bar")
+ end
+ end
+ RUBY
+ end
+
+ it "reports and corrects an offense when `Utils.safe_popen_write` arguments are unseparated" do
+ expect_offense(<<~RUBY)
+ class Foo < Formula
+ def install
+ Utils.safe_popen_write("foo bar")
+ ^^^^^^^^^ Separate `Utils.safe_popen_write` commands into `\"foo\", \"bar\"`
+ end
+ end
+ RUBY
+
+ expect_correction(<<~RUBY)
+ class Foo < Formula
+ def install
+ Utils.safe_popen_write("foo", "bar")
+ end
+ end
+ RUBY
+ end
+
+ it "reports and corrects an offense when `Utils.popen_read` arguments with interpolation are unseparated" do
+ expect_offense(<<~RUBY)
+ class Foo < Formula
+ def install
+ Utils.popen_read("\#{bin}/foo bar")
+ ^^^^^^^^^^^^^^^^ Separate `Utils.popen_read` commands into `\"\#{bin}/foo\", \"bar\"`
+ end
+ end
+ RUBY
+
+ expect_correction(<<~RUBY)
+ class Foo < Formula
+ def install
+ Utils.popen_read("\#{bin}/foo", "bar")
+ end
+ end
+ RUBY
+ end
+
+ it "reports no offenses when `Utils.popen_read` arguments with metacharacters are unseparated" do
+ expect_no_offenses(<<~RUBY)
+ class Foo < Formula
+ def install
+ Utils.popen_read("foo bar > baz")
+ end
+ end
+ RUBY
+ end
+
+ it "reports no offenses when trailing arguments to `Utils.popen_read` are unseparated" do
+ expect_no_offenses(<<~RUBY)
+ class Foo < Formula
+ def install
+ Utils.popen_read("foo", "bar baz")
+ end
+ end
+ RUBY
+ end
+
+ it "reports and corrects an offense when `Utils.popen_read` arguments are unseparated after a shell env" do
+ expect_offense(<<~RUBY)
+ class Foo < Formula
+ def install
+ Utils.popen_read({ "SHELL" => "bash"}, "foo bar")
+ ^^^^^^^^^ Separate `Utils.popen_read` commands into `\"foo\", \"bar\"`
+ end
+ end
+ RUBY
+
+ expect_correction(<<~RUBY)
+ class Foo < Formula
+ def install
+ Utils.popen_read({ "SHELL" => "bash"}, "foo", "bar")
+ end
+ end
+ RUBY
+ end
+ end
+ end
+
+ describe ExecShellMetacharacters do
+ subject(:cop) { described_class.new }
+
+ context "when auditing exec calls" do
+ it "reports aan offense when output piping is used" do
+ expect_offense(<<~RUBY)
+ fork do
+ exec "foo bar > output"
+ ^^^^^^^^^^^^^^^^^^ Don\'t use shell metacharacters in `exec`. Implement the logic in Ruby instead, using methods like `$stdout.reopen`.
+ end
+ RUBY
+ end
+
+ it "reports no offenses when no metacharacters are used" do
+ expect_no_offenses(<<~RUBY)
+ fork do
+ exec "foo bar"
+ end
+ RUBY
+ end
+ end
+ end
end
end
end | true |
Other | Homebrew | brew | ae49b0660052e88e53ebffc6e33dd48052d7cc2f.json | keg_relocate: replace Perl shebangs | Library/Homebrew/extend/os/linux/keg_relocate.rb | @@ -11,9 +11,11 @@ def relocate_dynamic_linkage(relocation)
# Patching patchelf using itself fails with "Text file busy" or SIGBUS.
return if name == "patchelf"
+ old_prefix, new_prefix = relocation.replacement_pair_for(:prefix)
+
elf_files.each do |file|
file.ensure_writable do
- change_rpath(file, relocation.old_prefix, relocation.new_prefix)
+ change_rpath(file, old_prefix, new_prefix)
end
end
end | true |
Other | Homebrew | brew | ae49b0660052e88e53ebffc6e33dd48052d7cc2f.json | keg_relocate: replace Perl shebangs | Library/Homebrew/extend/os/mac/keg_relocate.rb | @@ -19,29 +19,32 @@ def file_linked_libraries(file, string)
undef relocate_dynamic_linkage
def relocate_dynamic_linkage(relocation)
+ old_prefix, new_prefix = relocation.replacement_pair_for(:prefix)
+ old_cellar, new_cellar = relocation.replacement_pair_for(:cellar)
+
mach_o_files.each do |file|
file.ensure_writable do
if file.dylib?
- id = dylib_id_for(file).sub(relocation.old_prefix, relocation.new_prefix)
+ id = dylib_id_for(file).sub(old_prefix, new_prefix)
change_dylib_id(id, file)
end
each_install_name_for(file) do |old_name|
- if old_name.start_with? relocation.old_cellar
- new_name = old_name.sub(relocation.old_cellar, relocation.new_cellar)
- elsif old_name.start_with? relocation.old_prefix
- new_name = old_name.sub(relocation.old_prefix, relocation.new_prefix)
+ if old_name.start_with? old_cellar
+ new_name = old_name.sub(old_cellar, new_cellar)
+ elsif old_name.start_with? old_prefix
+ new_name = old_name.sub(old_prefix, new_prefix)
end
change_install_name(old_name, new_name, file) if new_name
end
if ENV["HOMEBREW_RELOCATE_RPATHS"]
each_rpath_for(file) do |old_name|
- new_name = if old_name.start_with? relocation.old_cellar
- old_name.sub(relocation.old_cellar, relocation.new_cellar)
- elsif old_name.start_with? relocation.old_prefix
- old_name.sub(relocation.old_prefix, relocation.new_prefix)
+ new_name = if old_name.start_with? old_cellar
+ old_name.sub(old_cellar, new_cellar)
+ elsif old_name.start_with? old_prefix
+ old_name.sub(old_prefix, new_prefix)
end
change_rpath(old_name, new_name, file) if new_name
@@ -172,6 +175,25 @@ def mach_o_files
mach_o_files
end
+ def prepare_relocation_to_locations
+ relocation = generic_prepare_relocation_to_locations
+
+ brewed_perl = runtime_dependencies&.any? { |dep| dep["full_name"] == "perl" && dep["declared_directly"] }
+ perl_path = if brewed_perl
+ "#{HOMEBREW_PREFIX}/opt/perl/bin/perl"
+ else
+ perl_version = if tab["built_on"].present?
+ tab["built_on"]["preferred_perl"]
+ else
+ MacOS.preferred_perl_version
+ end
+ "/usr/bin/perl#{perl_version}"
+ end
+ relocation.add_replacement_pair(:perl, PERL_PLACEHOLDER, perl_path)
+
+ relocation
+ end
+
def recursive_fgrep_args
# Don't recurse into symlinks; the man page says this is the default, but
# it's wrong. -O is a BSD-grep-only option. | true |
Other | Homebrew | brew | ae49b0660052e88e53ebffc6e33dd48052d7cc2f.json | keg_relocate: replace Perl shebangs | Library/Homebrew/keg_relocate.rb | @@ -6,12 +6,44 @@ class Keg
CELLAR_PLACEHOLDER = "@@HOMEBREW_CELLAR@@"
REPOSITORY_PLACEHOLDER = "@@HOMEBREW_REPOSITORY@@"
LIBRARY_PLACEHOLDER = "@@HOMEBREW_LIBRARY@@"
+ PERL_PLACEHOLDER = "@@HOMEBREW_PERL@@"
- Relocation = Struct.new(:old_prefix, :old_cellar, :old_repository, :old_library,
- :new_prefix, :new_cellar, :new_repository, :new_library) do
- # Use keyword args instead of positional args for initialization.
- def initialize(**kwargs)
- super(*members.map { |k| kwargs[k] })
+ class Relocation
+ extend T::Sig
+
+ def initialize
+ @replacement_map = {}
+ end
+
+ def freeze
+ @replacement_map.freeze
+ super
+ end
+
+ sig { params(key: Symbol, old_value: T.any(String, Regexp), new_value: String).void }
+ def add_replacement_pair(key, old_value, new_value)
+ @replacement_map[key] = [old_value, new_value]
+ end
+
+ sig { params(key: Symbol).returns(T::Array[T.any(String, Regexp)]) }
+ def replacement_pair_for(key)
+ @replacement_map.fetch(key)
+ end
+
+ sig { params(text: String).void }
+ def replace_text(text)
+ replacements = @replacement_map.values.to_h
+
+ sorted_keys = replacements.keys.sort_by do |key|
+ key.is_a?(String) ? key.length : 999
+ end.reverse
+
+ any_changed = false
+ sorted_keys.each do |key|
+ changed = text.gsub!(key, replacements[key])
+ any_changed ||= changed
+ end
+ any_changed
end
end
@@ -36,32 +68,42 @@ def relocate_dynamic_linkage(_relocation)
[]
end
+ def prepare_relocation_to_placeholders
+ relocation = Relocation.new
+ relocation.add_replacement_pair(:prefix, HOMEBREW_PREFIX.to_s, PREFIX_PLACEHOLDER)
+ relocation.add_replacement_pair(:cellar, HOMEBREW_CELLAR.to_s, CELLAR_PLACEHOLDER)
+ # when HOMEBREW_PREFIX == HOMEBREW_REPOSITORY we should use HOMEBREW_PREFIX for all relocations to avoid
+ # being unable to differentiate between them.
+ if HOMEBREW_PREFIX != HOMEBREW_REPOSITORY
+ relocation.add_replacement_pair(:repository, HOMEBREW_REPOSITORY.to_s, REPOSITORY_PLACEHOLDER)
+ end
+ relocation.add_replacement_pair(:library, HOMEBREW_LIBRARY.to_s, LIBRARY_PLACEHOLDER)
+ relocation.add_replacement_pair(:perl,
+ %r{\A#!(/usr/bin/perl\d\.\d+|#{HOMEBREW_PREFIX}/opt/perl/bin/perl)$}o,
+ "#!#{PERL_PLACEHOLDER}")
+ relocation
+ end
+ alias generic_prepare_relocation_to_placeholders prepare_relocation_to_placeholders
+
def replace_locations_with_placeholders
- relocation = Relocation.new(
- old_prefix: HOMEBREW_PREFIX.to_s,
- old_cellar: HOMEBREW_CELLAR.to_s,
- new_prefix: PREFIX_PLACEHOLDER,
- new_cellar: CELLAR_PLACEHOLDER,
- old_repository: HOMEBREW_REPOSITORY.to_s,
- new_repository: REPOSITORY_PLACEHOLDER,
- old_library: HOMEBREW_LIBRARY.to_s,
- new_library: LIBRARY_PLACEHOLDER,
- )
+ relocation = prepare_relocation_to_placeholders.freeze
relocate_dynamic_linkage(relocation)
replace_text_in_files(relocation)
end
+ def prepare_relocation_to_locations
+ relocation = Relocation.new
+ relocation.add_replacement_pair(:prefix, PREFIX_PLACEHOLDER, HOMEBREW_PREFIX.to_s)
+ relocation.add_replacement_pair(:cellar, CELLAR_PLACEHOLDER, HOMEBREW_CELLAR.to_s)
+ relocation.add_replacement_pair(:repository, REPOSITORY_PLACEHOLDER, HOMEBREW_REPOSITORY.to_s)
+ relocation.add_replacement_pair(:library, LIBRARY_PLACEHOLDER, HOMEBREW_LIBRARY.to_s)
+ relocation.add_replacement_pair(:perl, PERL_PLACEHOLDER, "#{HOMEBREW_PREFIX}/opt/perl/bin/perl")
+ relocation
+ end
+ alias generic_prepare_relocation_to_locations prepare_relocation_to_locations
+
def replace_placeholders_with_locations(files, skip_linkage: false)
- relocation = Relocation.new(
- old_prefix: PREFIX_PLACEHOLDER,
- old_cellar: CELLAR_PLACEHOLDER,
- old_repository: REPOSITORY_PLACEHOLDER,
- old_library: LIBRARY_PLACEHOLDER,
- new_prefix: HOMEBREW_PREFIX.to_s,
- new_cellar: HOMEBREW_CELLAR.to_s,
- new_repository: HOMEBREW_REPOSITORY.to_s,
- new_library: HOMEBREW_LIBRARY.to_s,
- )
+ relocation = prepare_relocation_to_locations.freeze
relocate_dynamic_linkage(relocation) unless skip_linkage
replace_text_in_files(relocation, files: files)
end
@@ -73,16 +115,7 @@ def replace_text_in_files(relocation, files: nil)
files.map(&path.method(:join)).group_by { |f| f.stat.ino }.each_value do |first, *rest|
s = first.open("rb", &:read)
- replacements = {
- relocation.old_prefix => relocation.new_prefix,
- relocation.old_cellar => relocation.new_cellar,
- relocation.old_library => relocation.new_library,
- }.compact
- # when HOMEBREW_PREFIX == HOMEBREW_REPOSITORY we should use HOMEBREW_PREFIX for all relocations to avoid
- # being unable to differentiate between them.
- replacements[relocation.old_repository] = relocation.new_repository if HOMEBREW_PREFIX != HOMEBREW_REPOSITORY
- changed = s.gsub!(Regexp.union(replacements.keys.sort_by(&:length).reverse), replacements)
- next unless changed
+ next unless relocation.replace_text(s)
changed_files += [first, *rest].map { |file| file.relative_path_from(path) }
| true |
Other | Homebrew | brew | 91ab5fe0cec459978d9809b22e86095797df833d.json | extend/os/mac/development_tools: add preferred_perl to built_on | Library/Homebrew/extend/os/mac/development_tools.rb | @@ -64,8 +64,9 @@ def custom_installation_instructions
def build_system_info
build_info = {
- "xcode" => MacOS::Xcode.version.to_s.presence,
- "clt" => MacOS::CLT.version.to_s.presence,
+ "xcode" => MacOS::Xcode.version.to_s.presence,
+ "clt" => MacOS::CLT.version.to_s.presence,
+ "preferred_perl" => MacOS.preferred_perl_version,
}
generic_build_system_info.merge build_info
end | false |
Other | Homebrew | brew | a5cb621fb86cdb87761a8113ffb17d72a0f6d3ae.json | tab: add declared_directly field for runtime deps | Library/Homebrew/formula_installer.rb | @@ -805,7 +805,7 @@ def finish
tab = Tab.for_keg(keg)
Tab.clear_cache
f_runtime_deps = formula.runtime_dependencies(read_from_tab: false)
- tab.runtime_dependencies = Tab.runtime_deps_hash(f_runtime_deps)
+ tab.runtime_dependencies = Tab.runtime_deps_hash(formula, f_runtime_deps)
tab.write
# let's reset Utils::Git.available? if we just installed git | true |
Other | Homebrew | brew | a5cb621fb86cdb87761a8113ffb17d72a0f6d3ae.json | tab: add declared_directly field for runtime deps | Library/Homebrew/tab.rb | @@ -36,7 +36,7 @@ def self.create(formula, compiler, stdlib)
"compiler" => compiler,
"stdlib" => stdlib,
"aliases" => formula.aliases,
- "runtime_dependencies" => Tab.runtime_deps_hash(runtime_deps),
+ "runtime_dependencies" => Tab.runtime_deps_hash(formula, runtime_deps),
"arch" => Hardware::CPU.arch,
"source" => {
"path" => formula.specified_path.to_s,
@@ -210,10 +210,14 @@ def self.empty
new(attributes)
end
- def self.runtime_deps_hash(deps)
+ def self.runtime_deps_hash(formula, deps)
deps.map do |dep|
f = dep.to_formula
- { "full_name" => f.full_name, "version" => f.version.to_s }
+ {
+ "full_name" => f.full_name,
+ "version" => f.version.to_s,
+ "declared_directly" => formula.deps.include?(dep),
+ }
end
end
| true |
Other | Homebrew | brew | a5cb621fb86cdb87761a8113ffb17d72a0f6d3ae.json | tab: add declared_directly field for runtime deps | Library/Homebrew/test/tab_spec.rb | @@ -137,13 +137,14 @@
specify "::runtime_deps_hash" do
runtime_deps = [Dependency.new("foo")]
- stub_formula_loader formula("foo") { url "foo-1.0" }
- runtime_deps_hash = described_class.runtime_deps_hash(runtime_deps)
+ foo = formula("foo") { url "foo-1.0" }
+ stub_formula_loader foo
+ runtime_deps_hash = described_class.runtime_deps_hash(foo, runtime_deps)
tab = described_class.new
tab.homebrew_version = "1.1.6"
tab.runtime_dependencies = runtime_deps_hash
expect(tab.runtime_dependencies).to eql(
- [{ "full_name" => "foo", "version" => "1.0" }],
+ [{ "full_name" => "foo", "version" => "1.0", "declared_directly" => false }],
)
end
@@ -268,8 +269,8 @@
tab = described_class.create(f, compiler, stdlib)
runtime_dependencies = [
- { "full_name" => "bar", "version" => "2.0" },
- { "full_name" => "user/repo/from_tap", "version" => "1.0" },
+ { "full_name" => "bar", "version" => "2.0", "declared_directly" => true },
+ { "full_name" => "user/repo/from_tap", "version" => "1.0", "declared_directly" => true },
]
expect(tab.runtime_dependencies).to eq(runtime_dependencies)
| true |
Other | Homebrew | brew | 346621dd5b7ef93fb658f89b9427841cb17a2824.json | service: delegate more path methods | Library/Homebrew/service.rb | @@ -111,7 +111,7 @@ def environment_variables(variables = {})
end
end
- delegate [:bin, :var, :etc, :opt_bin, :opt_sbin, :opt_prefix] => :@formula
+ delegate [:bin, :etc, :libexec, :opt_bin, :opt_libexec, :opt_pkgshare, :opt_prefix, :opt_sbin, :var] => :@formula
sig { returns(String) }
def std_service_path_env | false |
Other | Homebrew | brew | e893f16727d167390dacd9b2ed5eb6d5df103d70.json | extend/ENV/super: allow bottles with custom architectures
Currently, Homebrew recognises only the architectures listed in
`hardware.rb`. [1] Attempting to pass an unrecognised architecture to
`--bottle-arch` while building a bottle returns an error.
Let's change that by passing unrecognised bottle arches to the compiler
instead of immediately failing with a `CannotInstallFormulaError`.
Partially resolves #5815.
[1] https://github.com/Homebrew/brew/blob/64b6846d6078525b8569834718f7b093a7dd05e1/Library/Homebrew/hardware.rb#L28-L42 | Library/Homebrew/extend/ENV/super.rb | @@ -261,6 +261,9 @@ def determine_make_jobs
sig { returns(String) }
def determine_optflags
Hardware::CPU.optimization_flags.fetch(effective_arch)
+ rescue KeyError
+ odebug "Building a bottle for custom architecture (#{effective_arch})..."
+ Hardware::CPU.arch_flag(effective_arch)
end
sig { returns(String) } | true |
Other | Homebrew | brew | e893f16727d167390dacd9b2ed5eb6d5df103d70.json | extend/ENV/super: allow bottles with custom architectures
Currently, Homebrew recognises only the architectures listed in
`hardware.rb`. [1] Attempting to pass an unrecognised architecture to
`--bottle-arch` while building a bottle returns an error.
Let's change that by passing unrecognised bottle arches to the compiler
instead of immediately failing with a `CannotInstallFormulaError`.
Partially resolves #5815.
[1] https://github.com/Homebrew/brew/blob/64b6846d6078525b8569834718f7b093a7dd05e1/Library/Homebrew/hardware.rb#L28-L42 | Library/Homebrew/formula_installer.rb | @@ -395,10 +395,6 @@ def install
return if only_deps?
- if build_bottle? && (arch = @bottle_arch) && Hardware::CPU.optimization_flags.exclude?(arch.to_sym)
- raise CannotInstallFormulaError, "Unrecognized architecture for --bottle-arch: #{arch}"
- end
-
formula.deprecated_flags.each do |deprecated_option|
old_flag = deprecated_option.old_flag
new_flag = deprecated_option.current_flag | true |
Other | Homebrew | brew | 0b5f440cfc479aea4e26600f7d83f3db26606c63.json | Remove reference to full_clone in CoreTap | Library/Homebrew/tap.rb | @@ -737,8 +737,6 @@ def self.ensure_installed!
# CoreTap never allows shallow clones (on request from GitHub).
def install(quiet: false, clone_target: nil, force_auto_update: nil)
- raise "Shallow clones are not supported for homebrew-core!" unless full_clone
-
remote = Homebrew::EnvConfig.core_git_remote
if remote != default_remote
$stderr.puts "HOMEBREW_CORE_GIT_REMOTE set: using #{remote} for Homebrew/core Git remote URL." | false |
Other | Homebrew | brew | 29d50f57b3d1799991d3d79a6f8932acf43c7878.json | Add tap --shallow deprecation TODO
Co-authored-by: Rylan Polster <rslpolster@gmail.com> | Library/Homebrew/cmd/tap.rb | @@ -64,6 +64,7 @@ def tap
if args.shallow?
opoo "`brew tap --shallow` is now a no-op!"
+ # TODO: (3.2) Uncomment the following line and remove the `opoo` above
# odeprecated "`brew tap --shallow`"
end
| false |
Other | Homebrew | brew | b5569ffd331c6ea95f492f0ac7f42a1dbf11ae29.json | Remove full_clone from CoreTap | Library/Homebrew/tap.rb | @@ -736,14 +736,14 @@ def self.ensure_installed!
end
# CoreTap never allows shallow clones (on request from GitHub).
- def install(full_clone: true, quiet: false, clone_target: nil, force_auto_update: nil)
+ def install(quiet: false, clone_target: nil, force_auto_update: nil)
raise "Shallow clones are not supported for homebrew-core!" unless full_clone
remote = Homebrew::EnvConfig.core_git_remote
if remote != default_remote
$stderr.puts "HOMEBREW_CORE_GIT_REMOTE set: using #{remote} for Homebrew/core Git remote URL."
end
- super(full_clone: full_clone, quiet: quiet, clone_target: remote, force_auto_update: force_auto_update)
+ super(quiet: quiet, clone_target: remote, force_auto_update: force_auto_update)
end
# @private | false |
Other | Homebrew | brew | 8f7621edb85ba73a7532b39869425a188bb6c77b.json | Remove trailing whitespace | Library/Homebrew/cmd/tap.rb | @@ -60,7 +60,7 @@ def tap
opoo "`brew tap --full` is now a no-op!"
# odeprecated "`brew tap --full`"
end
-
+
if args.shallow?
opoo "`brew tap --shallow` is now a no-op!"
# odeprecated "`brew tap --shallow`" | false |
Other | Homebrew | brew | 5b6b400c5837b3bc1777ed6ea6740496d6317f2e.json | Remove deprecation comment
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com> | Library/Homebrew/cmd/tap.rb | @@ -30,7 +30,6 @@ def tap_args
switch "--full",
description: "Convert a shallow clone to a full clone without untapping. Taps are only cloned as "\
"shallow clones if `--shallow` was originally passed."
- # odeprecated "brew tap --shallow"
switch "--shallow",
description: "Fetch tap as a shallow clone rather than a full clone. Useful for continuous integration."
switch "--force-auto-update", | false |
Other | Homebrew | brew | 18bb644ce72cc70ef0c2d9f1d354269a8982ad2d.json | Remove deprecation comment
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com> | Library/Homebrew/cmd/tap.rb | @@ -27,7 +27,6 @@ def tap_args
assumptions, so taps can be cloned from places other than GitHub and
using protocols other than HTTPS, e.g. SSH, git, HTTP, FTP(S), rsync.
EOS
- # odeprecated "brew tap --full"
switch "--full",
description: "Convert a shallow clone to a full clone without untapping. Taps are only cloned as "\
"shallow clones if `--shallow` was originally passed." | false |
Other | Homebrew | brew | 1e0551fca49b919077c47adbbac5f7a09cb57a49.json | Add no-op message
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com> | Library/Homebrew/cmd/tap.rb | @@ -58,6 +58,16 @@ def tap
elsif args.no_named?
puts Tap.names
else
+ if args.full?
+ opoo "`brew tap --full` is now a no-op!"
+ # odeprecated "`brew tap --full`"
+ end
+
+ if args.shallow?
+ opoo "`brew tap --shallow` is now a no-op!"
+ # odeprecated "`brew tap --shallow`"
+ end
+
tap = Tap.fetch(args.named.first)
begin
tap.install clone_target: args.named.second, | false |
Other | Homebrew | brew | 6156fadd65af088c74c184763d8d7fafabbcb839.json | extend/os/mac/keg_relocate: relocate rpaths on macOS | Library/Homebrew/extend/os/mac/keg_relocate.rb | @@ -35,6 +35,18 @@ def relocate_dynamic_linkage(relocation)
change_install_name(old_name, new_name, file) if new_name
end
+
+ if ENV["HOMEBREW_RELOCATE_RPATHS"]
+ each_rpath_for(file) do |old_name|
+ if old_name.start_with? relocation.old_cellar
+ new_name = old_name.sub(relocation.old_cellar, relocation.new_cellar)
+ elsif old_name.start_with? relocation.old_prefix
+ new_name = old_name.sub(relocation.old_prefix, relocation.new_prefix)
+ end
+
+ change_rpath(old_name, new_name, file) if new_name
+ end
+ end
end
end
end
@@ -111,6 +123,12 @@ def each_install_name_for(file, &block)
dylibs.each(&block)
end
+ def each_rpath_for(file, &block)
+ rpaths = file.rpaths
+ rpaths.reject! { |fn| fn =~ /^@(loader|executable)_path/ }
+ rpaths.each(&block)
+ end
+
def dylib_id_for(file)
# The new dylib ID should have the same basename as the old dylib ID, not
# the basename of the file itself. | false |
Other | Homebrew | brew | a8cbc14ca34c55a9dfc3de865bb0cb420deb3adb.json | os/mac/keg: add change_rpath method | Library/Homebrew/os/mac/keg.rb | @@ -34,6 +34,22 @@ def change_install_name(old, new, file)
raise
end
+ def change_rpath(old, new, file)
+ return if old == new
+
+ @require_relocation = true
+ odebug "Changing rpath in #{file}\n from #{old}\n to #{new}"
+ MachO::Tools.change_rpath(file, old, new, strict: false)
+ apply_ad_hoc_signature(file)
+ rescue MachO::MachOError
+ onoe <<~EOS
+ Failed changing rpath in #{file}
+ from #{old}
+ to #{new}
+ EOS
+ raise
+ end
+
def apply_ad_hoc_signature(file)
return if MacOS.version < :big_sur
return unless Hardware::CPU.arm? | false |
Other | Homebrew | brew | 52f905fa2a471ef37661fd40e246c84891ec6574.json | Update RBI files for rubocop. | Library/Homebrew/sorbet/rbi/gems/rubocop@1.14.0.rbi | @@ -825,8 +825,8 @@ RuboCop::Cop::Bundler::DuplicatedGem::MSG = T.let(T.unsafe(nil), String)
class RuboCop::Cop::Bundler::GemComment < ::RuboCop::Cop::Base
include(::RuboCop::Cop::DefNode)
+ include(::RuboCop::Cop::GemDeclaration)
- def gem_declaration?(param0 = T.unsafe(nil)); end
def on_send(node); end
private
@@ -856,6 +856,30 @@ RuboCop::Cop::Bundler::GemComment::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array
RuboCop::Cop::Bundler::GemComment::VERSION_SPECIFIERS_OPTION = T.let(T.unsafe(nil), String)
+class RuboCop::Cop::Bundler::GemVersion < ::RuboCop::Cop::Base
+ include(::RuboCop::Cop::ConfigurableEnforcedStyle)
+ include(::RuboCop::Cop::GemDeclaration)
+
+ def includes_version_specification?(param0 = T.unsafe(nil)); end
+ def on_send(node); end
+
+ private
+
+ def allowed_gem?(node); end
+ def allowed_gems; end
+ def forbidden_style?; end
+ def message(range); end
+ def offense?(node); end
+ def required_style?; end
+ def version_specification?(expression); end
+end
+
+RuboCop::Cop::Bundler::GemVersion::FORBIDDEN_MSG = T.let(T.unsafe(nil), String)
+
+RuboCop::Cop::Bundler::GemVersion::REQUIRED_MSG = T.let(T.unsafe(nil), String)
+
+RuboCop::Cop::Bundler::GemVersion::VERSION_SPECIFICATION_REGEX = T.let(T.unsafe(nil), Regexp)
+
class RuboCop::Cop::Bundler::InsecureProtocolSource < ::RuboCop::Cop::Base
include(::RuboCop::Cop::RangeHelp)
extend(::RuboCop::Cop::AutoCorrector)
@@ -1440,6 +1464,12 @@ RuboCop::Cop::FrozenStringLiteral::FROZEN_STRING_LITERAL_ENABLED = T.let(T.unsaf
RuboCop::Cop::FrozenStringLiteral::FROZEN_STRING_LITERAL_TYPES = T.let(T.unsafe(nil), Array)
+module RuboCop::Cop::GemDeclaration
+ extend(::RuboCop::AST::NodePattern::Macros)
+
+ def gem_declaration?(param0 = T.unsafe(nil)); end
+end
+
module RuboCop::Cop::Gemspec
end
@@ -3232,6 +3262,8 @@ class RuboCop::Cop::Layout::RedundantLineBreak < ::RuboCop::Cop::Cop
def convertible_block?(node); end
def max_line_length; end
def offense?(node); end
+ def other_cop_takes_precedence?(node); end
+ def single_line_block_chain_enabled?; end
def suitable_as_single_line?(node); end
def to_single_line(source); end
def too_long?(node); end
@@ -3276,6 +3308,19 @@ RuboCop::Cop::Layout::RescueEnsureAlignment::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Layout::RescueEnsureAlignment::RUBY_2_5_ANCESTOR_TYPES = T.let(T.unsafe(nil), Array)
+class RuboCop::Cop::Layout::SingleLineBlockChain < ::RuboCop::Cop::Base
+ include(::RuboCop::Cop::RangeHelp)
+ extend(::RuboCop::Cop::AutoCorrector)
+
+ def on_send(node); end
+
+ private
+
+ def offending_range(node); end
+end
+
+RuboCop::Cop::Layout::SingleLineBlockChain::MSG = T.let(T.unsafe(nil), String)
+
class RuboCop::Cop::Layout::SpaceAfterColon < ::RuboCop::Cop::Base
extend(::RuboCop::Cop::AutoCorrector)
@@ -4095,28 +4140,48 @@ class RuboCop::Cop::Lint::DeprecatedClassMethods < ::RuboCop::Cop::Base
private
def check(node); end
- def deprecated_method(data); end
- def method_call(class_constant, method); end
- def replacement_method(data); end
+ def replacement(deprecated); end
end
-RuboCop::Cop::Lint::DeprecatedClassMethods::DEPRECATED_METHODS_OBJECT = T.let(T.unsafe(nil), Array)
+RuboCop::Cop::Lint::DeprecatedClassMethods::CLASS_METHOD_DELIMETER = T.let(T.unsafe(nil), String)
+
+RuboCop::Cop::Lint::DeprecatedClassMethods::DEPRECATED_METHODS_OBJECT = T.let(T.unsafe(nil), Hash)
class RuboCop::Cop::Lint::DeprecatedClassMethods::DeprecatedClassMethod
include(::RuboCop::AST::Sexp)
- def initialize(deprecated:, replacement:, class_constant: T.unsafe(nil)); end
+ def initialize(method, class_constant: T.unsafe(nil), correctable: T.unsafe(nil)); end
def class_constant; end
def class_nodes; end
- def deprecated_method; end
- def replacement_method; end
+ def correctable?; end
+ def method; end
+ def to_s; end
+
+ private
+
+ def delimeter; end
end
+RuboCop::Cop::Lint::DeprecatedClassMethods::INSTANCE_METHOD_DELIMETER = T.let(T.unsafe(nil), String)
+
RuboCop::Cop::Lint::DeprecatedClassMethods::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Lint::DeprecatedClassMethods::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
+class RuboCop::Cop::Lint::DeprecatedClassMethods::Replacement
+ def initialize(method, class_constant: T.unsafe(nil), instance_method: T.unsafe(nil)); end
+
+ def class_constant; end
+ def method; end
+ def to_s; end
+
+ private
+
+ def delimeter; end
+ def instance_method?; end
+end
+
class RuboCop::Cop::Lint::DeprecatedConstants < ::RuboCop::Cop::Base
extend(::RuboCop::Cop::AutoCorrector)
@@ -5615,11 +5680,14 @@ class RuboCop::Cop::Lint::UnreachableLoop < ::RuboCop::Cop::Base
def check(node); end
def check_case(node); end
def check_if(node); end
+ def conditional_continue_keyword?(break_statement); end
def loop_method?(node); end
def preceded_by_continue_statement?(break_statement); end
def statements(node); end
end
+RuboCop::Cop::Lint::UnreachableLoop::CONTINUE_KEYWORDS = T.let(T.unsafe(nil), Array)
+
RuboCop::Cop::Lint::UnreachableLoop::MSG = T.let(T.unsafe(nil), String)
module RuboCop::Cop::Lint::UnusedArgument
@@ -5652,6 +5720,7 @@ class RuboCop::Cop::Lint::UnusedBlockArgument < ::RuboCop::Cop::Base
def message_for_lambda(variable, all_arguments); end
def message_for_normal_block(variable, all_arguments); end
def message_for_underscore_prefix(variable); end
+ def used_block_local?(variable); end
def variable_type(variable); end
class << self
@@ -7518,9 +7587,9 @@ class RuboCop::Cop::Style::ClassAndModuleChildren < ::RuboCop::Cop::Base
def compact_node_name?(node); end
def indent_width; end
def leading_spaces(node); end
+ def needs_compacting?(body); end
def nest_definition(corrector, node); end
def nest_or_compact(corrector, node); end
- def one_child?(body); end
def remove_end(corrector, body); end
def replace_namespace_keyword(corrector, node); end
def split_on_double_colon(corrector, node, padding); end
@@ -9439,8 +9508,6 @@ end
class RuboCop::Cop::Style::NegatedIfElseCondition < ::RuboCop::Cop::Base
include(::RuboCop::Cop::RangeHelp)
- include(::RuboCop::Cop::VisibilityHelp)
- include(::RuboCop::Cop::CommentsHelp)
extend(::RuboCop::Cop::AutoCorrector)
def double_negation?(param0 = T.unsafe(nil)); end
@@ -9451,9 +9518,10 @@ class RuboCop::Cop::Style::NegatedIfElseCondition < ::RuboCop::Cop::Base
def correct_negated_condition(corrector, node); end
def corrected_ancestor?(node); end
+ def else_range(node); end
def if_else?(node); end
+ def if_range(node); end
def negated_condition?(node); end
- def node_with_comments(node); end
def swap_branches(corrector, node); end
class << self
@@ -10820,6 +10888,7 @@ class RuboCop::Cop::Style::SingleLineMethods < ::RuboCop::Cop::Base
def each_part(body); end
def method_body_source(method_body); end
def move_comment(node, corrector); end
+ def require_parentheses?(method_body); end
end
RuboCop::Cop::Style::SingleLineMethods::MSG = T.let(T.unsafe(nil), String)
@@ -10851,6 +10920,7 @@ class RuboCop::Cop::Style::SoleNestedConditional < ::RuboCop::Cop::Base
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_from_unless_to_if(corrector, node); end
def correct_outer_condition(corrector, condition); end
def offending_branch?(branch); end
def replacement_condition(and_operator, condition); end
@@ -11939,6 +12009,13 @@ class RuboCop::Cop::VariableForce::Branch::Case < ::RuboCop::Cop::VariableForce:
def when_clause?; end
end
+class RuboCop::Cop::VariableForce::Branch::CaseMatch < ::RuboCop::Cop::VariableForce::Branch::Base
+ def always_run?; end
+ def else_body?; end
+ def in_pattern?; end
+ def target?; end
+end
+
class RuboCop::Cop::VariableForce::Branch::Ensure < ::RuboCop::Cop::VariableForce::Branch::Base
include(::RuboCop::Cop::VariableForce::Branch::ExceptionHandler)
@@ -12982,6 +13059,7 @@ class RuboCop::TargetFinder
def ruby_filenames; end
def ruby_interpreters(file); end
def stdin?; end
+ def symlink_excluded_or_infinite_loop?(base_dir, current_dir, exclude_pattern, flags); end
def target_files_in_dir(base_dir = T.unsafe(nil)); end
def to_inspect?(file, hidden_files, base_dir_config); end
def wanted_dir_patterns(base_dir, exclude_pattern, flags); end | false |
Other | Homebrew | brew | 1462f4760976742746ccc93c9ef23ff960ce7d9a.json | cask/cmd/uninstall_spec: delete more flaky tests.
https://github.com/Homebrew/brew/pull/11337/checks?check_run_id=2528253674 | Library/Homebrew/test/cask/cmd/uninstall_spec.rb | @@ -53,22 +53,6 @@
expect(transmission.config.appdir.join("Caffeine.app")).not_to exist
end
- it "calls `uninstall` before removing artifacts" do
- cask = Cask::CaskLoader.load(cask_path("with-uninstall-script-app"))
-
- Cask::Installer.new(cask).install
-
- expect(cask).to be_installed
- expect(cask.config.appdir.join("MyFancyApp.app")).to exist
-
- expect {
- described_class.run("with-uninstall-script-app")
- }.not_to raise_error
-
- expect(cask).not_to be_installed
- expect(cask.config.appdir.join("MyFancyApp.app")).not_to exist
- end
-
it "can uninstall Casks when the uninstall script is missing, but only when using `--force`" do
cask = Cask::CaskLoader.load(cask_path("with-uninstall-script-app"))
@@ -90,30 +74,6 @@
expect(cask).not_to be_installed
end
- context "when Casks use script path with `~` as `HOME`" do
- let(:home_dir) { mktmpdir }
- let(:app) { Pathname.new("#{home_dir}/MyFancyApp.app") }
- let(:cask) { Cask::CaskLoader.load(cask_path("with-uninstall-script-user-relative")) }
-
- before do
- ENV["HOME"] = home_dir
- end
-
- it "can still uninstall them" do
- Cask::Installer.new(cask).install
-
- expect(cask).to be_installed
- expect(app).to exist
-
- expect {
- described_class.run("with-uninstall-script-user-relative")
- }.not_to raise_error
-
- expect(cask).not_to be_installed
- expect(app).not_to exist
- end
- end
-
describe "when multiple versions of a cask are installed" do
let(:token) { "versioned-cask" }
let(:first_installed_version) { "1.2.3" } | false |
Other | Homebrew | brew | 6f6cbc592ac32a760aeb02772420732b9238db59.json | Remove reference to full_clone in CoreTap | Library/Homebrew/tap.rb | @@ -737,8 +737,6 @@ def self.ensure_installed!
# CoreTap never allows shallow clones (on request from GitHub).
def install(quiet: false, clone_target: nil, force_auto_update: nil)
- raise "Shallow clones are not supported for homebrew-core!" unless full_clone
-
remote = Homebrew::EnvConfig.core_git_remote
if remote != default_remote
$stderr.puts "HOMEBREW_CORE_GIT_REMOTE set: using #{remote} for Homebrew/core Git remote URL." | false |
Other | Homebrew | brew | e391381acc23b0cce7024a31255c7e9932b47db2.json | Add tap --shallow deprecation TODO
Co-authored-by: Rylan Polster <rslpolster@gmail.com> | Library/Homebrew/cmd/tap.rb | @@ -64,6 +64,7 @@ def tap
if args.shallow?
opoo "`brew tap --shallow` is now a no-op!"
+ # TODO: (3.2) Uncomment the following line and remove the `opoo` above
# odeprecated "`brew tap --shallow`"
end
| false |
Other | Homebrew | brew | 6aa1695df1421d26ae8c536ddac00feb762a6a5b.json | Remove full_clone from CoreTap | Library/Homebrew/tap.rb | @@ -736,14 +736,14 @@ def self.ensure_installed!
end
# CoreTap never allows shallow clones (on request from GitHub).
- def install(full_clone: true, quiet: false, clone_target: nil, force_auto_update: nil)
+ def install(quiet: false, clone_target: nil, force_auto_update: nil)
raise "Shallow clones are not supported for homebrew-core!" unless full_clone
remote = Homebrew::EnvConfig.core_git_remote
if remote != default_remote
$stderr.puts "HOMEBREW_CORE_GIT_REMOTE set: using #{remote} for Homebrew/core Git remote URL."
end
- super(full_clone: full_clone, quiet: quiet, clone_target: remote, force_auto_update: force_auto_update)
+ super(quiet: quiet, clone_target: remote, force_auto_update: force_auto_update)
end
# @private | false |
Other | Homebrew | brew | 69054b06b583da2bd13fc4b784c6802ee92d25be.json | Remove trailing whitespace | Library/Homebrew/cmd/tap.rb | @@ -60,7 +60,7 @@ def tap
opoo "`brew tap --full` is now a no-op!"
# odeprecated "`brew tap --full`"
end
-
+
if args.shallow?
opoo "`brew tap --shallow` is now a no-op!"
# odeprecated "`brew tap --shallow`" | false |
Other | Homebrew | brew | ea8a66f38570ce81f433f44ddc0c25c2abe5fb8f.json | Remove deprecation comment
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com> | Library/Homebrew/cmd/tap.rb | @@ -30,7 +30,6 @@ def tap_args
switch "--full",
description: "Convert a shallow clone to a full clone without untapping. Taps are only cloned as "\
"shallow clones if `--shallow` was originally passed."
- # odeprecated "brew tap --shallow"
switch "--shallow",
description: "Fetch tap as a shallow clone rather than a full clone. Useful for continuous integration."
switch "--force-auto-update", | false |
Other | Homebrew | brew | c7f8ce83d44f6f4b0133c35a1b7a64a91e133900.json | Remove deprecation comment
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com> | Library/Homebrew/cmd/tap.rb | @@ -27,7 +27,6 @@ def tap_args
assumptions, so taps can be cloned from places other than GitHub and
using protocols other than HTTPS, e.g. SSH, git, HTTP, FTP(S), rsync.
EOS
- # odeprecated "brew tap --full"
switch "--full",
description: "Convert a shallow clone to a full clone without untapping. Taps are only cloned as "\
"shallow clones if `--shallow` was originally passed." | false |
Other | Homebrew | brew | 033c11ff18f26f5c0083e1a747947ab39147c57a.json | Add no-op message
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com> | Library/Homebrew/cmd/tap.rb | @@ -58,6 +58,16 @@ def tap
elsif args.no_named?
puts Tap.names
else
+ if args.full?
+ opoo "`brew tap --full` is now a no-op!"
+ # odeprecated "`brew tap --full`"
+ end
+
+ if args.shallow?
+ opoo "`brew tap --shallow` is now a no-op!"
+ # odeprecated "`brew tap --shallow`"
+ end
+
tap = Tap.fetch(args.named.first)
begin
tap.install clone_target: args.named.second, | false |
Other | Homebrew | brew | b5a7337b059c33d0c3a4bd70788095fcb401add8.json | Add deprecation paths for tap --full/--shallow | Library/Homebrew/cmd/tap.rb | @@ -27,6 +27,13 @@ def tap_args
assumptions, so taps can be cloned from places other than GitHub and
using protocols other than HTTPS, e.g. SSH, git, HTTP, FTP(S), rsync.
EOS
+ # odeprecated "brew tap --full"
+ switch "--full",
+ description: "Convert a shallow clone to a full clone without untapping. Taps are only cloned as "\
+ "shallow clones if `--shallow` was originally passed."
+ # odeprecated "brew tap --shallow"
+ switch "--shallow",
+ description: "Fetch tap as a shallow clone rather than a full clone. Useful for continuous integration."
switch "--force-auto-update",
description: "Auto-update tap even if it is not hosted on GitHub. By default, only taps "\
"hosted on GitHub are auto-updated (for performance reasons)." | false |
Other | Homebrew | brew | d6811c517b8c17854692109c79e0c3dc617db1a8.json | Update RBI files for rubocop. | Library/Homebrew/sorbet/rbi/gems/rubocop@1.14.0.rbi | @@ -825,8 +825,8 @@ RuboCop::Cop::Bundler::DuplicatedGem::MSG = T.let(T.unsafe(nil), String)
class RuboCop::Cop::Bundler::GemComment < ::RuboCop::Cop::Base
include(::RuboCop::Cop::DefNode)
+ include(::RuboCop::Cop::GemDeclaration)
- def gem_declaration?(param0 = T.unsafe(nil)); end
def on_send(node); end
private
@@ -856,6 +856,30 @@ RuboCop::Cop::Bundler::GemComment::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array
RuboCop::Cop::Bundler::GemComment::VERSION_SPECIFIERS_OPTION = T.let(T.unsafe(nil), String)
+class RuboCop::Cop::Bundler::GemVersion < ::RuboCop::Cop::Base
+ include(::RuboCop::Cop::ConfigurableEnforcedStyle)
+ include(::RuboCop::Cop::GemDeclaration)
+
+ def includes_version_specification?(param0 = T.unsafe(nil)); end
+ def on_send(node); end
+
+ private
+
+ def allowed_gem?(node); end
+ def allowed_gems; end
+ def forbidden_style?; end
+ def message(range); end
+ def offense?(node); end
+ def required_style?; end
+ def version_specification?(expression); end
+end
+
+RuboCop::Cop::Bundler::GemVersion::FORBIDDEN_MSG = T.let(T.unsafe(nil), String)
+
+RuboCop::Cop::Bundler::GemVersion::REQUIRED_MSG = T.let(T.unsafe(nil), String)
+
+RuboCop::Cop::Bundler::GemVersion::VERSION_SPECIFICATION_REGEX = T.let(T.unsafe(nil), Regexp)
+
class RuboCop::Cop::Bundler::InsecureProtocolSource < ::RuboCop::Cop::Base
include(::RuboCop::Cop::RangeHelp)
extend(::RuboCop::Cop::AutoCorrector)
@@ -1440,6 +1464,12 @@ RuboCop::Cop::FrozenStringLiteral::FROZEN_STRING_LITERAL_ENABLED = T.let(T.unsaf
RuboCop::Cop::FrozenStringLiteral::FROZEN_STRING_LITERAL_TYPES = T.let(T.unsafe(nil), Array)
+module RuboCop::Cop::GemDeclaration
+ extend(::RuboCop::AST::NodePattern::Macros)
+
+ def gem_declaration?(param0 = T.unsafe(nil)); end
+end
+
module RuboCop::Cop::Gemspec
end
@@ -3232,6 +3262,8 @@ class RuboCop::Cop::Layout::RedundantLineBreak < ::RuboCop::Cop::Cop
def convertible_block?(node); end
def max_line_length; end
def offense?(node); end
+ def other_cop_takes_precedence?(node); end
+ def single_line_block_chain_enabled?; end
def suitable_as_single_line?(node); end
def to_single_line(source); end
def too_long?(node); end
@@ -3276,6 +3308,19 @@ RuboCop::Cop::Layout::RescueEnsureAlignment::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Layout::RescueEnsureAlignment::RUBY_2_5_ANCESTOR_TYPES = T.let(T.unsafe(nil), Array)
+class RuboCop::Cop::Layout::SingleLineBlockChain < ::RuboCop::Cop::Base
+ include(::RuboCop::Cop::RangeHelp)
+ extend(::RuboCop::Cop::AutoCorrector)
+
+ def on_send(node); end
+
+ private
+
+ def offending_range(node); end
+end
+
+RuboCop::Cop::Layout::SingleLineBlockChain::MSG = T.let(T.unsafe(nil), String)
+
class RuboCop::Cop::Layout::SpaceAfterColon < ::RuboCop::Cop::Base
extend(::RuboCop::Cop::AutoCorrector)
@@ -4095,28 +4140,48 @@ class RuboCop::Cop::Lint::DeprecatedClassMethods < ::RuboCop::Cop::Base
private
def check(node); end
- def deprecated_method(data); end
- def method_call(class_constant, method); end
- def replacement_method(data); end
+ def replacement(deprecated); end
end
-RuboCop::Cop::Lint::DeprecatedClassMethods::DEPRECATED_METHODS_OBJECT = T.let(T.unsafe(nil), Array)
+RuboCop::Cop::Lint::DeprecatedClassMethods::CLASS_METHOD_DELIMETER = T.let(T.unsafe(nil), String)
+
+RuboCop::Cop::Lint::DeprecatedClassMethods::DEPRECATED_METHODS_OBJECT = T.let(T.unsafe(nil), Hash)
class RuboCop::Cop::Lint::DeprecatedClassMethods::DeprecatedClassMethod
include(::RuboCop::AST::Sexp)
- def initialize(deprecated:, replacement:, class_constant: T.unsafe(nil)); end
+ def initialize(method, class_constant: T.unsafe(nil), correctable: T.unsafe(nil)); end
def class_constant; end
def class_nodes; end
- def deprecated_method; end
- def replacement_method; end
+ def correctable?; end
+ def method; end
+ def to_s; end
+
+ private
+
+ def delimeter; end
end
+RuboCop::Cop::Lint::DeprecatedClassMethods::INSTANCE_METHOD_DELIMETER = T.let(T.unsafe(nil), String)
+
RuboCop::Cop::Lint::DeprecatedClassMethods::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Lint::DeprecatedClassMethods::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
+class RuboCop::Cop::Lint::DeprecatedClassMethods::Replacement
+ def initialize(method, class_constant: T.unsafe(nil), instance_method: T.unsafe(nil)); end
+
+ def class_constant; end
+ def method; end
+ def to_s; end
+
+ private
+
+ def delimeter; end
+ def instance_method?; end
+end
+
class RuboCop::Cop::Lint::DeprecatedConstants < ::RuboCop::Cop::Base
extend(::RuboCop::Cop::AutoCorrector)
@@ -5615,11 +5680,14 @@ class RuboCop::Cop::Lint::UnreachableLoop < ::RuboCop::Cop::Base
def check(node); end
def check_case(node); end
def check_if(node); end
+ def conditional_continue_keyword?(break_statement); end
def loop_method?(node); end
def preceded_by_continue_statement?(break_statement); end
def statements(node); end
end
+RuboCop::Cop::Lint::UnreachableLoop::CONTINUE_KEYWORDS = T.let(T.unsafe(nil), Array)
+
RuboCop::Cop::Lint::UnreachableLoop::MSG = T.let(T.unsafe(nil), String)
module RuboCop::Cop::Lint::UnusedArgument
@@ -5652,6 +5720,7 @@ class RuboCop::Cop::Lint::UnusedBlockArgument < ::RuboCop::Cop::Base
def message_for_lambda(variable, all_arguments); end
def message_for_normal_block(variable, all_arguments); end
def message_for_underscore_prefix(variable); end
+ def used_block_local?(variable); end
def variable_type(variable); end
class << self
@@ -7518,9 +7587,9 @@ class RuboCop::Cop::Style::ClassAndModuleChildren < ::RuboCop::Cop::Base
def compact_node_name?(node); end
def indent_width; end
def leading_spaces(node); end
+ def needs_compacting?(body); end
def nest_definition(corrector, node); end
def nest_or_compact(corrector, node); end
- def one_child?(body); end
def remove_end(corrector, body); end
def replace_namespace_keyword(corrector, node); end
def split_on_double_colon(corrector, node, padding); end
@@ -9439,8 +9508,6 @@ end
class RuboCop::Cop::Style::NegatedIfElseCondition < ::RuboCop::Cop::Base
include(::RuboCop::Cop::RangeHelp)
- include(::RuboCop::Cop::VisibilityHelp)
- include(::RuboCop::Cop::CommentsHelp)
extend(::RuboCop::Cop::AutoCorrector)
def double_negation?(param0 = T.unsafe(nil)); end
@@ -9451,9 +9518,10 @@ class RuboCop::Cop::Style::NegatedIfElseCondition < ::RuboCop::Cop::Base
def correct_negated_condition(corrector, node); end
def corrected_ancestor?(node); end
+ def else_range(node); end
def if_else?(node); end
+ def if_range(node); end
def negated_condition?(node); end
- def node_with_comments(node); end
def swap_branches(corrector, node); end
class << self
@@ -10820,6 +10888,7 @@ class RuboCop::Cop::Style::SingleLineMethods < ::RuboCop::Cop::Base
def each_part(body); end
def method_body_source(method_body); end
def move_comment(node, corrector); end
+ def require_parentheses?(method_body); end
end
RuboCop::Cop::Style::SingleLineMethods::MSG = T.let(T.unsafe(nil), String)
@@ -10851,6 +10920,7 @@ class RuboCop::Cop::Style::SoleNestedConditional < ::RuboCop::Cop::Base
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_from_unless_to_if(corrector, node); end
def correct_outer_condition(corrector, condition); end
def offending_branch?(branch); end
def replacement_condition(and_operator, condition); end
@@ -11939,6 +12009,13 @@ class RuboCop::Cop::VariableForce::Branch::Case < ::RuboCop::Cop::VariableForce:
def when_clause?; end
end
+class RuboCop::Cop::VariableForce::Branch::CaseMatch < ::RuboCop::Cop::VariableForce::Branch::Base
+ def always_run?; end
+ def else_body?; end
+ def in_pattern?; end
+ def target?; end
+end
+
class RuboCop::Cop::VariableForce::Branch::Ensure < ::RuboCop::Cop::VariableForce::Branch::Base
include(::RuboCop::Cop::VariableForce::Branch::ExceptionHandler)
@@ -12982,6 +13059,7 @@ class RuboCop::TargetFinder
def ruby_filenames; end
def ruby_interpreters(file); end
def stdin?; end
+ def symlink_excluded_or_infinite_loop?(base_dir, current_dir, exclude_pattern, flags); end
def target_files_in_dir(base_dir = T.unsafe(nil)); end
def to_inspect?(file, hidden_files, base_dir_config); end
def wanted_dir_patterns(base_dir, exclude_pattern, flags); end | false |
Other | Homebrew | brew | 8f1cd1288d1bfdd1a48470a8671f7ca940d40426.json | extend/os/mac/keg_relocate: relocate rpaths on macOS | Library/Homebrew/extend/os/mac/keg_relocate.rb | @@ -35,6 +35,18 @@ def relocate_dynamic_linkage(relocation)
change_install_name(old_name, new_name, file) if new_name
end
+
+ if ENV["HOMEBREW_RELOCATE_RPATHS"]
+ each_rpath_for(file) do |old_name|
+ if old_name.start_with? relocation.old_cellar
+ new_name = old_name.sub(relocation.old_cellar, relocation.new_cellar)
+ elsif old_name.start_with? relocation.old_prefix
+ new_name = old_name.sub(relocation.old_prefix, relocation.new_prefix)
+ end
+
+ change_rpath(old_name, new_name, file) if new_name
+ end
+ end
end
end
end
@@ -111,6 +123,12 @@ def each_install_name_for(file, &block)
dylibs.each(&block)
end
+ def each_rpath_for(file, &block)
+ rpaths = file.rpaths
+ rpaths.reject! { |fn| fn =~ /^@(loader|executable)_path/ }
+ rpaths.each(&block)
+ end
+
def dylib_id_for(file)
# The new dylib ID should have the same basename as the old dylib ID, not
# the basename of the file itself. | false |
Other | Homebrew | brew | d15cb8a83d017aceaafd9265e6725d916cc4d43b.json | utils/ruby.sh: fix Ruby path searching | Library/Homebrew/utils/ruby.sh | @@ -15,14 +15,15 @@ test_ruby() {
# HOMEBREW_MACOS is set by brew.sh
# HOMEBREW_PATH is set by global.rb
-# shellcheck disable=SC2154
+# SC2230 falsely flags `which -a`
+# shellcheck disable=SC2154,SC2230
find_ruby() {
if [[ -n "${HOMEBREW_MACOS}" ]]
then
echo "/System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby"
else
IFS=$'\n' # Do word splitting on new lines only
- for ruby_exec in $(command -v -a ruby 2>/dev/null) $(PATH=${HOMEBREW_PATH} command -v -a ruby 2>/dev/null)
+ for ruby_exec in $(which -a ruby 2>/dev/null) $(PATH=${HOMEBREW_PATH} which -a ruby 2>/dev/null)
do
if test_ruby "${ruby_exec}"; then
echo "${ruby_exec}" | false |
Other | Homebrew | brew | 4d5971518de4a6cc8307d5c31567bca35072b5b6.json | os/mac/keg: add change_rpath method | Library/Homebrew/os/mac/keg.rb | @@ -34,6 +34,22 @@ def change_install_name(old, new, file)
raise
end
+ def change_rpath(old, new, file)
+ return if old == new
+
+ @require_relocation = true
+ odebug "Changing rpath in #{file}\n from #{old}\n to #{new}"
+ MachO::Tools.change_rpath(file, old, new, strict: false)
+ apply_ad_hoc_signature(file)
+ rescue MachO::MachOError
+ onoe <<~EOS
+ Failed changing rpath in #{file}
+ from #{old}
+ to #{new}
+ EOS
+ raise
+ end
+
def apply_ad_hoc_signature(file)
return if MacOS.version < :big_sur
return unless Hardware::CPU.arm? | false |
Other | Homebrew | brew | acebeab9cb2f44658384f56ffea9c9dc6d945e90.json | bottle: improve style of rebuild fallback
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com> | Library/Homebrew/dev-cmd/bottle.rb | @@ -339,10 +339,8 @@ def bottle_formula(f, args:)
else
0
end
- end
+ end || 0
end
- # FormulaVersions#formula_at_revision returns nil for new formulae
- rebuild ||= 0
filename = Bottle::Filename.create(f, bottle_tag.to_sym, rebuild)
local_filename = filename.to_s | false |
Other | Homebrew | brew | c3a9acbdded62175f975b73b0e2fcba3a5b8a688.json | Update RBI files for rubocop-performance. | Library/Homebrew/sorbet/rbi/gems/rubocop-performance@1.11.2.rbi | @@ -441,6 +441,7 @@ class RuboCop::Cop::Performance::MapCompact < ::RuboCop::Cop::Base
private
def compact_method_range(compact_node); end
+ def invoke_method_after_map_compact_on_same_line?(compact_node, chained_method); end
end
RuboCop::Cop::Performance::MapCompact::MSG = T.let(T.unsafe(nil), String) | false |
Other | Homebrew | brew | b3603b5de8033e926f71cedf2f7f3fd95ec58a2d.json | docs/Common-Issues: remove Oxford comma.
Not sure why CI didn't catch this the first time. | docs/Common-Issues.md | @@ -116,4 +116,4 @@ brew upgrade
### Other local issues
-If your Homebrew installation gets messed up (and fixing the issues found by `brew doctor` doesn't solve the problem), reinstalling Homebrew may help to reset to a normal state. To easily reinstall Homebrew, use [Homebrew Bundle](https://github.com/Homebrew/homebrew-bundle) to automatically restore your installed formulae and casks. To do so, run `brew bundle dump`, [uninstall](https://docs.brew.sh/FAQ#how-do-i-uninstall-homebrew), [reinstall](https://docs.brew.sh/Installation), and run `brew bundle install`.
+If your Homebrew installation gets messed up (and fixing the issues found by `brew doctor` doesn't solve the problem), reinstalling Homebrew may help to reset to a normal state. To easily reinstall Homebrew, use [Homebrew Bundle](https://github.com/Homebrew/homebrew-bundle) to automatically restore your installed formulae and casks. To do so, run `brew bundle dump`, [uninstall](https://docs.brew.sh/FAQ#how-do-i-uninstall-homebrew), [reinstall](https://docs.brew.sh/Installation) and run `brew bundle install`. | false |
Other | Homebrew | brew | efa278763e14229ea59f602aeb5cb9d9b4dc0561.json | Update RBI files for rubocop-rails. | Library/Homebrew/sorbet/rbi/gems/i18n@1.8.10.rbi | @@ -1,6 +1,6 @@
# DO NOT EDIT MANUALLY
# This is an autogenerated file for types exported from the `i18n` gem.
-# Please instead update this file by running `tapioca sync`.
+# Please instead update this file by running `bin/tapioca sync`.
# typed: true
| true |
Other | Homebrew | brew | efa278763e14229ea59f602aeb5cb9d9b4dc0561.json | Update RBI files for rubocop-rails. | Library/Homebrew/sorbet/rbi/gems/rubocop-rails@2.10.0.rbi | @@ -1,6 +1,6 @@
# DO NOT EDIT MANUALLY
# This is an autogenerated file for types exported from the `rubocop-rails` gem.
-# Please instead update this file by running `tapioca sync`.
+# Please instead update this file by running `bin/tapioca sync`.
# typed: true
@@ -13,11 +13,13 @@ end
module RuboCop::Cop::ActiveRecordHelper
extend(::RuboCop::AST::NodePattern::Macros)
+ def active_record?(param0 = T.unsafe(nil)); end
def external_dependency_checksum; end
def find_belongs_to(param0); end
def find_set_table_name(param0); end
def foreign_key_of(belongs_to); end
def in_where?(node); end
+ def inherit_active_record_base?(node); end
def resolve_relation_into_column(name:, class_node:, table:); end
def schema; end
def table_name(class_node); end
@@ -405,11 +407,14 @@ class RuboCop::Cop::Rails::ContentTag < ::RuboCop::Cop::Base
extend(::RuboCop::Cop::AutoCorrector)
extend(::RuboCop::Cop::TargetRailsVersion)
+ def on_new_investigation; end
def on_send(node); end
private
+ def allowed_argument?(argument); end
def autocorrect(corrector, node); end
+ def corrected_ancestor?(node); end
def correction_range(node); end
def method_name?(node); end
end
@@ -513,6 +518,7 @@ 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::DynamicFindBy < ::RuboCop::Cop::Base
+ include(::RuboCop::Cop::ActiveRecordHelper)
extend(::RuboCop::Cop::AutoCorrector)
def on_csend(node); end
@@ -593,6 +599,21 @@ RuboCop::Cop::Rails::EnvironmentComparison::RESTRICT_ON_SEND = T.let(T.unsafe(ni
RuboCop::Cop::Rails::EnvironmentComparison::SYM_MSG = T.let(T.unsafe(nil), String)
+class RuboCop::Cop::Rails::EnvironmentVariableAccess < ::RuboCop::Cop::Base
+ def env_read?(param0); end
+ def env_write?(param0); end
+ def on_const(node); end
+
+ private
+
+ def allow_reads?; end
+ def allow_writes?; end
+end
+
+RuboCop::Cop::Rails::EnvironmentVariableAccess::READ_MSG = T.let(T.unsafe(nil), String)
+
+RuboCop::Cop::Rails::EnvironmentVariableAccess::WRITE_MSG = T.let(T.unsafe(nil), String)
+
class RuboCop::Cop::Rails::Exit < ::RuboCop::Cop::Base
include(::RuboCop::Cop::ConfigurableEnforcedStyle)
@@ -677,6 +698,7 @@ RuboCop::Cop::Rails::FindById::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Rails::FindById::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
class RuboCop::Cop::Rails::FindEach < ::RuboCop::Cop::Base
+ include(::RuboCop::Cop::ActiveRecordHelper)
extend(::RuboCop::Cop::AutoCorrector)
def on_send(node); end
@@ -702,17 +724,20 @@ RuboCop::Cop::Rails::HasAndBelongsToMany::RESTRICT_ON_SEND = T.let(T.unsafe(nil)
class RuboCop::Cop::Rails::HasManyOrHasOneDependent < ::RuboCop::Cop::Base
def active_resource_class?(param0); end
+ def association_extension_block?(param0 = T.unsafe(nil)); end
def association_with_options?(param0 = T.unsafe(nil)); end
def association_without_options?(param0 = T.unsafe(nil)); end
def dependent_option?(param0 = T.unsafe(nil)); end
def on_send(node); end
def present_option?(param0 = T.unsafe(nil)); end
+ def readonly?(param0 = T.unsafe(nil)); end
def with_options_block(param0 = T.unsafe(nil)); end
private
def active_resource?(node); end
def contain_valid_options_in_with_options_block?(node); end
+ def readonly_model?(node); end
def valid_options?(options); end
def valid_options_in_with_options_block?(node); end
end
@@ -734,6 +759,7 @@ end
RuboCop::Cop::Rails::HelperInstanceVariable::MSG = T.let(T.unsafe(nil), String)
class RuboCop::Cop::Rails::HttpPositionalArguments < ::RuboCop::Cop::Base
+ include(::RuboCop::Cop::RangeHelp)
extend(::RuboCop::Cop::AutoCorrector)
extend(::RuboCop::Cop::TargetRailsVersion)
@@ -747,6 +773,7 @@ class RuboCop::Cop::Rails::HttpPositionalArguments < ::RuboCop::Cop::Base
def correction(node); end
def correction_template(node); end
def format_arg?(node); end
+ def highlight_range(node); end
def needs_conversion?(data); end
def special_keyword_arg?(node); end
end
@@ -1280,8 +1307,14 @@ class RuboCop::Cop::Rails::ReflectionClassName < ::RuboCop::Cop::Base
def association_with_reflection(param0 = T.unsafe(nil)); end
def on_send(node); end
def reflection_class_name(param0 = T.unsafe(nil)); end
+
+ private
+
+ def reflection_class_value?(class_value); end
end
+RuboCop::Cop::Rails::ReflectionClassName::ALLOWED_REFLECTION_CLASS_TYPES = T.let(T.unsafe(nil), Array)
+
RuboCop::Cop::Rails::ReflectionClassName::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Rails::ReflectionClassName::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
@@ -1318,18 +1351,20 @@ class RuboCop::Cop::Rails::RelativeDateConstant < ::RuboCop::Cop::Base
def on_masgn(node); end
def on_or_asgn(node); end
def relative_date?(param0 = T.unsafe(nil)); end
- def relative_date_assignment?(param0 = T.unsafe(nil)); end
def relative_date_or_assignment?(param0 = T.unsafe(nil)); end
private
def autocorrect(corrector, node); end
def message(method_name); end
def offense_range(name, value); end
+ def relative_date_method?(method_name); end
end
RuboCop::Cop::Rails::RelativeDateConstant::MSG = T.let(T.unsafe(nil), String)
+RuboCop::Cop::Rails::RelativeDateConstant::RELATIVE_DATE_METHODS = T.let(T.unsafe(nil), Array)
+
class RuboCop::Cop::Rails::RenderInline < ::RuboCop::Cop::Base
def on_send(node); end
def render_with_inline_option?(param0 = T.unsafe(nil)); end
@@ -1373,6 +1408,17 @@ RuboCop::Cop::Rails::RequestReferer::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Rails::RequestReferer::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
+class RuboCop::Cop::Rails::RequireDependency < ::RuboCop::Cop::Base
+ extend(::RuboCop::Cop::TargetRailsVersion)
+
+ def on_send(node); end
+ def require_dependency_call?(param0 = T.unsafe(nil)); end
+end
+
+RuboCop::Cop::Rails::RequireDependency::MSG = T.let(T.unsafe(nil), String)
+
+RuboCop::Cop::Rails::RequireDependency::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
+
class RuboCop::Cop::Rails::ReversibleMigration < ::RuboCop::Cop::Base
def change_table_call(param0 = T.unsafe(nil)); end
def drop_table_call(param0 = T.unsafe(nil)); end
@@ -1403,6 +1449,15 @@ end
RuboCop::Cop::Rails::ReversibleMigration::MSG = T.let(T.unsafe(nil), String)
+class RuboCop::Cop::Rails::ReversibleMigrationMethodDefinition < ::RuboCop::Cop::Base
+ def change_method?(param0 = T.unsafe(nil)); end
+ def migration_class?(param0 = T.unsafe(nil)); end
+ def on_class(node); end
+ def up_and_down_methods?(param0 = T.unsafe(nil)); end
+end
+
+RuboCop::Cop::Rails::ReversibleMigrationMethodDefinition::MSG = T.let(T.unsafe(nil), String)
+
class RuboCop::Cop::Rails::SafeNavigation < ::RuboCop::Cop::Base
include(::RuboCop::Cop::RangeHelp)
extend(::RuboCop::Cop::AutoCorrector)
@@ -1414,6 +1469,10 @@ class RuboCop::Cop::Rails::SafeNavigation < ::RuboCop::Cop::Base
def autocorrect(corrector, node); end
def replacement(method, params); end
+
+ class << self
+ def autocorrect_incompatible_with; end
+ end
end
RuboCop::Cop::Rails::SafeNavigation::MSG = T.let(T.unsafe(nil), String)
@@ -1552,6 +1611,7 @@ class RuboCop::Cop::Rails::TimeZone < ::RuboCop::Cop::Base
private
def acceptable_methods(klass, method_name, node); end
+ def attach_timezone_specifier?(date); end
def autocorrect(corrector, node); end
def autocorrect_time_new(node, corrector); end
def build_message(klass, method_name, node); end
@@ -1582,6 +1642,17 @@ RuboCop::Cop::Rails::TimeZone::MSG_ACCEPTABLE = T.let(T.unsafe(nil), String)
RuboCop::Cop::Rails::TimeZone::MSG_LOCALTIME = T.let(T.unsafe(nil), String)
+RuboCop::Cop::Rails::TimeZone::TIMEZONE_SPECIFIER = T.let(T.unsafe(nil), Regexp)
+
+class RuboCop::Cop::Rails::TimeZoneAssignment < ::RuboCop::Cop::Base
+ def on_send(node); end
+ def time_zone_assignement?(param0 = T.unsafe(nil)); end
+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::UniqBeforePluck < ::RuboCop::Cop::Base
include(::RuboCop::Cop::ConfigurableEnforcedStyle)
include(::RuboCop::Cop::RangeHelp) | true |
Other | Homebrew | brew | d78dc014d14bf2619d3ae3e985373aff393e67e0.json | github_packages: add missing root mkpath | Library/Homebrew/github_packages.rb | @@ -260,6 +260,7 @@ def upload_bottle(user, token, skopeo, formula_full_name, bottle_hash, keep_old:
root = Pathname("#{formula_name}--#{version_rebuild}")
FileUtils.rm_rf root
+ root.mkpath
if keep_old
download(user, token, skopeo, image_uri, root, dry_run: dry_run) | false |
Other | Homebrew | brew | 4c67a8ce27394d05f7436907d7f0afb8f1845189.json | caveats: simplify non-plist return
Co-authored-by: Rylan Polster <rslpolster@gmail.com> | Library/Homebrew/extend/os/mac/caveats.rb | @@ -6,10 +6,7 @@ class Caveats
def plist_caveats
s = []
- if !f.plist && !f.service? && !keg&.plist_installed?
- caveat = "#{s.join("\n")}\n" if s.present?
- return caveat
- end
+ return if !f.plist && !f.service? && !keg&.plist_installed?
plist_domain = f.plist_path.basename(".plist")
| false |
Other | Homebrew | brew | 25d754b8b0f41508d2ebe59f2005f1bbec9a7768.json | Update RBI files for rubocop-ast. | Library/Homebrew/sorbet/rbi/gems/rubocop-ast@1.5.0.rbi | @@ -1,6 +1,6 @@
# DO NOT EDIT MANUALLY
# This is an autogenerated file for types exported from the `rubocop-ast` gem.
-# Please instead update this file by running `tapioca sync`.
+# Please instead update this file by running `bin/tapioca sync`.
# typed: true
@@ -1367,8 +1367,6 @@ RuboCop::AST::NodePattern::Sets::SET_AND_RETURN_AND_RAISE_AND_THROW_ETC = T.let(
RuboCop::AST::NodePattern::Sets::SET_ANY_ALL_NORETURN_ETC = T.let(T.unsafe(nil), Set)
-RuboCop::AST::NodePattern::Sets::SET_ANY_INSTANCE_ALLOW_ANY_INSTANCE_OF_EXPECT_ANY_INSTANCE_OF = T.let(T.unsafe(nil), Set)
-
RuboCop::AST::NodePattern::Sets::SET_AP_P_PP_ETC = T.let(T.unsafe(nil), Set)
RuboCop::AST::NodePattern::Sets::SET_ATTR_READER_ATTR_WRITER_ATTR_ACCESSOR = T.let(T.unsafe(nil), Set) | false |
Other | Homebrew | brew | 4e831d518dd1ea39c50e317a1cf0c08d7fcb07c3.json | Update RBI files for rubocop-performance. | Library/Homebrew/sorbet/rbi/gems/parser@3.0.1.1.rbi | @@ -1236,6 +1236,7 @@ class Parser::Source::Comment
class << self
def associate(ast, comments); end
+ def associate_by_identity(ast, comments); end
def associate_locations(ast, comments); end
end
end
@@ -1244,6 +1245,7 @@ class Parser::Source::Comment::Associator
def initialize(ast, comments); end
def associate; end
+ def associate_by_identity; end
def associate_locations; end
def skip_directives; end
def skip_directives=(_arg0); end | true |
Other | Homebrew | brew | 4e831d518dd1ea39c50e317a1cf0c08d7fcb07c3.json | Update RBI files for rubocop-performance. | Library/Homebrew/sorbet/rbi/gems/rubocop-performance@1.11.1.rbi | @@ -437,6 +437,10 @@ class RuboCop::Cop::Performance::MapCompact < ::RuboCop::Cop::Base
def map_compact(param0 = T.unsafe(nil)); end
def on_send(node); end
+
+ private
+
+ def compact_method_range(compact_node); end
end
RuboCop::Cop::Performance::MapCompact::MSG = T.let(T.unsafe(nil), String) | true |
Other | Homebrew | brew | 681f5a5914b3d0c4fb05ae63628e8d372959e18c.json | docs/Formula-Cookbook: Fix outdated HEAD hash syntax
- Using the previous syntax, `brew audit --strict` fails because this
uses the old Ruby hash syntax. | docs/Formula-Cookbook.md | @@ -577,10 +577,9 @@ To use a specific commit, tag, or branch from a repository, specify [`head`](htt
```ruby
class Foo < Formula
- head "https://github.com/some/package.git", :revision => "090930930295adslfknsdfsdaffnasd13"
- # or :branch => "develop" (the default is "master")
- # or :tag => "1_0_release",
- # :revision => "090930930295adslfknsdfsdaffnasd13"
+ head "https://github.com/some/package.git", revision: "090930930295adslfknsdfsdaffnasd13"
+ # or branch: "main" (the default is "master")
+ # or tag: "1_0_release", revision: "090930930295adslfknsdfsdaffnasd13"
end
```
| false |
Other | Homebrew | brew | 59879b5d1473f64709d4bc102fc1c80a78c30194.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 | @@ -9684,6 +9684,8 @@ module IRB
def self.load_modules(); end
+ def self.parse_opts(argv: T.unsafe(nil)); end
+
def self.rc_file(ext=T.unsafe(nil)); end
def self.rc_file_generators(); end | false |
Other | Homebrew | brew | 658352ac1f515ecc3b581e801fe150658dc3df21.json | Remove hardcoded reference to Java 11
Java 11 is no longer the current stable build, so a dependency on “11” should not be treated as a dependency on the latest Java. | Library/Homebrew/cask/dsl/caveats.rb | @@ -114,7 +114,7 @@ def eval_caveats(&block)
#{@cask} requires Java. You can install the latest version with:
brew install --cask adoptopenjdk
EOS
- elsif java_version.include?("11") || java_version.include?("+")
+ elsif java_version.include?("+")
<<~EOS
#{@cask} requires Java #{java_version}. You can install the latest version with:
brew install --cask adoptopenjdk | false |
Other | Homebrew | brew | 76607bbb6fae52fcd32cda339c22121c3e0a23ec.json | Simplify conditional as suggested
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com> | Library/Homebrew/dev-cmd/bottle.rb | @@ -16,7 +16,7 @@
bottle do
<% if [HOMEBREW_BOTTLE_DEFAULT_DOMAIN.to_s,
"#{HOMEBREW_BOTTLE_DEFAULT_DOMAIN}/bottles"].exclude?(root_url) %>
- root_url "<%= root_url %>"<% unless download_strategy.blank? %>,
+ root_url "<%= root_url %>"<% if download_strategy.present? %>,
using: <%= download_strategy %>
<% end %>
<% end %> | false |
Other | Homebrew | brew | f9589429d63f52445d136eb4480260271e6d6fd0.json | dev-cmd/bottle: handle empty collector tags.
Fixes https://github.com/Homebrew/homebrew-core/runs/2467738434?check_suite_focus=true#step:6:458 | Library/Homebrew/dev-cmd/bottle.rb | @@ -654,9 +654,15 @@ def merge(args:)
bottle.rebuild != old_bottle_spec.rebuild &&
bottle.root_url == old_bottle_spec.root_url
bottle.collector.keys.all? do |tag|
- next false if bottle.collector[tag][:cellar] != old_bottle_spec.collector[tag][:cellar]
+ bottle_collector_tag = bottle.collector[tag]
+ next false if bottle_collector_tag.blank?
- bottle.collector[tag][:checksum].hexdigest == old_bottle_spec.collector[tag][:checksum].hexdigest
+ old_bottle_spec_collector_tag = old_bottle_spec.collector[tag][tag]
+ next false if old_bottle_spec_collector_tag.blank?
+
+ next false if bottle_collector_tag[:cellar] != old_bottle_spec_collector_tag[:cellar]
+
+ bottle_collector_tag[:checksum].hexdigest == old_bottle_spec_collector_tag[:checksum].hexdigest
end
end
| false |
Other | Homebrew | brew | 6d308a6ea4a6b018ef13fe20e829f4d819d4dce9.json | Update RBI files for rubocop-rspec. | Library/Homebrew/sorbet/rbi/gems/rubocop-rspec@2.3.0.rbi | @@ -1,6 +1,6 @@
# DO NOT EDIT MANUALLY
# This is an autogenerated file for types exported from the `rubocop-rspec` gem.
-# Please instead update this file by running `tapioca sync`.
+# Please instead update this file by running `bin/tapioca sync`.
# typed: true
@@ -236,6 +236,7 @@ class RuboCop::Cop::RSpec::ContextWording < ::RuboCop::Cop::RSpec::Base
def bad_prefix?(description); end
def joined_prefixes; end
+ def prefix_regex; end
def prefixes; end
end
@@ -432,11 +433,10 @@ class RuboCop::Cop::RSpec::ExampleLength < ::RuboCop::Cop::RSpec::Base
private
- def code_length(node); end
- def message(length); end
+ def cop_label; end
end
-RuboCop::Cop::RSpec::ExampleLength::MSG = T.let(T.unsafe(nil), String)
+RuboCop::Cop::RSpec::ExampleLength::LABEL = T.let(T.unsafe(nil), String)
class RuboCop::Cop::RSpec::ExampleWithoutDescription < ::RuboCop::Cop::RSpec::Base
include(::RuboCop::Cop::ConfigurableEnforcedStyle) | false |
Other | Homebrew | brew | 16d5472e4b0af20826e49ea8cf74dff5544f849e.json | dev-cmd/bottle: improve filename handling.
Rely more heavily on the `Bottle::Filename` class rather than hacking
around things manually.
Without this the rebuilding bottles workflow is broken for `all:`
bottles. | Library/Homebrew/.rubocop.yml | @@ -33,7 +33,7 @@ Metrics/PerceivedComplexity:
Metrics/MethodLength:
Max: 260
Metrics/ModuleLength:
- Max: 600
+ Max: 610
Exclude:
- "test/**/*"
| true |
Other | Homebrew | brew | 16d5472e4b0af20826e49ea8cf74dff5544f849e.json | dev-cmd/bottle: improve filename handling.
Rely more heavily on the `Bottle::Filename` class rather than hacking
around things manually.
Without this the rebuilding bottles workflow is broken for `all:`
bottles. | Library/Homebrew/dev-cmd/bottle.rb | @@ -558,11 +558,11 @@ def bottle_formula(f, args:)
"prefix" => bottle.prefix,
"cellar" => bottle_cellar.to_s,
"rebuild" => bottle.rebuild,
- "date" => Pathname(local_filename).mtime.strftime("%F"),
+ "date" => Pathname(filename.to_s).mtime.strftime("%F"),
"tags" => {
bottle_tag.to_s => {
"filename" => filename.url_encode,
- "local_filename" => local_filename,
+ "local_filename" => filename.to_s,
"sha256" => sha256,
"formulae_brew_sh_path" => formulae_brew_sh_path,
"tab" => tab.to_bottle_hash,
@@ -581,9 +581,9 @@ def bottle_formula(f, args:)
}
end
- File.open(filename.json, "w") do |file|
- file.write JSON.pretty_generate json
- end
+ json_path = Pathname(filename.json)
+ json_path.unlink if json_path.exist?
+ json_path.write(JSON.pretty_generate(json))
end
def parse_json_files(filenames)
@@ -643,17 +643,25 @@ def merge(args:)
if all_bottle
all_bottle_hash = nil
bottle_hash["bottle"]["tags"].each do |tag, tag_hash|
- local_filename = tag_hash["local_filename"]
- local_json_filename = local_filename.sub(/\.tar\.gz$/, ".json")
+ filename = Bottle::Filename.new(
+ formula_name,
+ bottle_hash["formula"]["pkg_version"],
+ tag,
+ bottle_hash["bottle"]["rebuild"],
+ )
if all_bottle_hash.nil?
- all_filename = tag_hash["filename"].sub(tag, "all")
- all_local_filename = local_filename.sub(tag, "all")
- all_local_json_filename = local_json_filename.sub(tag, "all")
-
all_bottle_tag_hash = tag_hash.dup
- all_bottle_tag_hash["filename"] = all_filename
- all_bottle_tag_hash["local_filename"] = all_local_filename
+
+ all_filename = Bottle::Filename.new(
+ formula_name,
+ bottle_hash["formula"]["pkg_version"],
+ "all",
+ bottle_hash["bottle"]["rebuild"],
+ )
+
+ all_bottle_tag_hash["filename"] = all_filename.url_encode
+ all_bottle_tag_hash["local_filename"] = all_filename.to_s
cellar = all_bottle_tag_hash.delete("cellar")
all_bottle_formula_hash = bottle_hash.dup
@@ -662,16 +670,16 @@ def merge(args:)
all_bottle_hash = { formula_name => all_bottle_formula_hash }
- puts "Copying #{local_filename} to #{all_local_filename}" if args.verbose?
- FileUtils.cp local_filename, all_local_filename
+ puts "Copying #{filename} to #{all_filename}" if args.verbose?
+ FileUtils.cp filename.to_s, all_filename.to_s
- all_local_json_path = Pathname(all_local_json_filename)
+ all_local_json_path = Pathname(filename.json)
all_local_json_path.unlink if all_local_json_path.exist?
all_local_json_path.write(JSON.pretty_generate(all_bottle_hash))
end
- puts "Removing #{local_filename} and #{local_json_filename}" if args.verbose?
- FileUtils.rm_f [local_filename, local_json_filename]
+ puts "Removing #{filename} and #{filename.json}" if args.verbose?
+ FileUtils.rm_f [filename.to_s, filename.json]
end
end
| true |
Other | Homebrew | brew | 20eeb5aca03915bc071a9f42b0bb3fc188fc1818.json | dev-cmd/bottle: add missing verbose puts.
These were added but didn't actually output anything... | Library/Homebrew/dev-cmd/bottle.rb | @@ -662,15 +662,15 @@ def merge(args:)
all_bottle_hash = { formula_name => all_bottle_formula_hash }
- "Copying #{local_filename} to #{all_local_filename}" if args.verbose?
+ puts "Copying #{local_filename} to #{all_local_filename}" if args.verbose?
FileUtils.cp local_filename, all_local_filename
all_local_json_path = Pathname(all_local_json_filename)
all_local_json_path.unlink if all_local_json_path.exist?
all_local_json_path.write(JSON.pretty_generate(all_bottle_hash))
end
- "Removing #{local_filename} and #{local_json_filename}" if args.verbose?
+ puts "Removing #{local_filename} and #{local_json_filename}" if args.verbose?
FileUtils.rm_f [local_filename, local_json_filename]
end
end | false |
Other | Homebrew | brew | 20d05297c3089fb6c214a94e26814417b533d0f0.json | Remove extra space from manpage | docs/Manpage.md | @@ -1545,7 +1545,7 @@ to send a notification when the autoupdate process has finished successfully.
<br>Output this tool's current version.
* `--upgrade`:
- Automatically upgrade your installed formulae. If the Caskroom exists locally Casks will be upgraded as well. Must be passed with `start`.
+ Automatically upgrade your installed formulae. If the Caskroom exists locally Casks will be upgraded as well. Must be passed with `start`.
* `--cleanup`:
Automatically clean brew's cache and logs. Must be passed with `start`.
* `--enable-notification`: | false |
Other | Homebrew | brew | 7ee76b85d5372f4c85e9947495ae4eeaa91436a5.json | unpack_strategy/zip: ensure consistent timezone management | Library/Homebrew/extend/os/mac/unpack_strategy/zip.rb | @@ -15,47 +15,49 @@ module MacOSZipExtension
sig { override.params(unpack_dir: Pathname, basename: Pathname, verbose: T::Boolean).returns(T.untyped) }
def extract_to_dir(unpack_dir, basename:, verbose:)
- if merge_xattrs && contains_extended_attributes?(path)
- # We use ditto directly, because dot_clean has issues if the __MACOSX
- # folder has incorrect permissions.
- # (Also, Homebrew's ZIP artifact automatically deletes this folder.)
- return system_command! "ditto",
- args: ["-x", "-k", path, unpack_dir],
- verbose: verbose,
- print_stderr: false
- end
+ with_env(TZ: "UTC") do
+ if merge_xattrs && contains_extended_attributes?(path)
+ # We use ditto directly, because dot_clean has issues if the __MACOSX
+ # folder has incorrect permissions.
+ # (Also, Homebrew's ZIP artifact automatically deletes this folder.)
+ return system_command! "ditto",
+ args: ["-x", "-k", path, unpack_dir],
+ verbose: verbose,
+ print_stderr: false
+ end
- result = begin
- T.let(super, T.nilable(SystemCommand::Result))
- rescue ErrorDuringExecution => e
- raise unless e.stderr.include?("End-of-central-directory signature not found.")
+ result = begin
+ T.let(super, T.nilable(SystemCommand::Result))
+ rescue ErrorDuringExecution => e
+ raise unless e.stderr.include?("End-of-central-directory signature not found.")
- system_command! "ditto",
- args: ["-x", "-k", path, unpack_dir],
- verbose: verbose
- nil
- end
+ system_command! "ditto",
+ args: ["-x", "-k", path, unpack_dir],
+ verbose: verbose
+ nil
+ end
- return if result.blank?
+ return if result.blank?
- volumes = result.stderr.chomp
- .split("\n")
- .map { |l| l[/\A skipping: (.+) volume label\Z/, 1] }
- .compact
+ volumes = result.stderr.chomp
+ .split("\n")
+ .map { |l| l[/\A skipping: (.+) volume label\Z/, 1] }
+ .compact
- return if volumes.empty?
+ return if volumes.empty?
- Dir.mktmpdir do |tmp_unpack_dir|
- tmp_unpack_dir = Pathname(tmp_unpack_dir)
+ Dir.mktmpdir do |tmp_unpack_dir|
+ tmp_unpack_dir = Pathname(tmp_unpack_dir)
- # `ditto` keeps Finder attributes intact and does not skip volume labels
- # like `unzip` does, which can prevent disk images from being unzipped.
- system_command! "ditto",
- args: ["-x", "-k", path, tmp_unpack_dir],
- verbose: verbose
+ # `ditto` keeps Finder attributes intact and does not skip volume labels
+ # like `unzip` does, which can prevent disk images from being unzipped.
+ system_command! "ditto",
+ args: ["-x", "-k", path, tmp_unpack_dir],
+ verbose: verbose
- volumes.each do |volume|
- FileUtils.mv tmp_unpack_dir/volume, unpack_dir/volume, verbose: verbose
+ volumes.each do |volume|
+ FileUtils.mv tmp_unpack_dir/volume, unpack_dir/volume, verbose: verbose
+ end
end
end
end | true |
Other | Homebrew | brew | 7ee76b85d5372f4c85e9947495ae4eeaa91436a5.json | unpack_strategy/zip: ensure consistent timezone management | Library/Homebrew/unpack_strategy/zip.rb | @@ -27,15 +27,17 @@ def self.can_extract?(path)
.returns(SystemCommand::Result)
}
def extract_to_dir(unpack_dir, basename:, verbose:)
- quiet_flags = verbose ? [] : ["-qq"]
- result = system_command! "unzip",
- args: [*quiet_flags, "-o", path, "-d", unpack_dir],
- verbose: verbose,
- print_stderr: false
+ with_env(TZ: "UTC") do
+ quiet_flags = verbose ? [] : ["-qq"]
+ result = system_command! "unzip",
+ args: [*quiet_flags, "-o", path, "-d", unpack_dir],
+ verbose: verbose,
+ print_stderr: false
- FileUtils.rm_rf unpack_dir/"__MACOSX"
+ FileUtils.rm_rf unpack_dir/"__MACOSX"
- result
+ result
+ end
end
end
end | true |
Other | Homebrew | brew | df04c2f9faf4cc7b989094cdbe4e4347fee4dd10.json | docs: clarify upstream versions requirement | docs/Versions.md | @@ -8,7 +8,7 @@ Versioned formulae we include in [homebrew/core](https://github.com/homebrew/hom
* Versioned software should build on all Homebrew's supported versions of macOS.
* Versioned formulae should differ in major/minor (not patch) versions from the current stable release. This is because patch versions indicate bug or security updates, and we want to ensure you apply security updates.
* Unstable versions (alpha, beta, development versions) are not acceptable for versioned (or unversioned) formulae.
-* Upstream should have a release branch for each formula version, and release security updates for each version when necessary. For example, [PHP 7.0 was not a supported version but PHP 7.2 was](https://php.net/supported-versions.php) in January 2020. By contrast, most software projects are structured to only release security updates for their latest versions, so their earlier versions are not eligible for versioning.
+* Upstream should have a release branch for each formula version, and claim to release security updates for each version when necessary. For example, [PHP 7.0 was not a supported version but PHP 7.2 was](https://php.net/supported-versions.php) in January 2020. By contrast, most software projects are structured to only release security updates for their latest versions, so their earlier versions are not eligible for versioning.
* Versioned formulae should share a codebase with the main formula. If the project is split into a different repository, we recommend creating a new formula (`formula2` rather than `formula@2` or `formula@1`).
* Formulae that depend on versioned formulae must not depend on the same formulae at two different versions twice in their recursive dependencies. For example, if you depend on `openssl@1.0` and `foo`, and `foo` depends on `openssl` then you must instead use `openssl`.
* Versioned formulae should only be linkable at the same time as their non-versioned counterpart if the upstream project provides support for it, e.g. using suffixed binaries. If this is not possible, use `keg_only :versioned_formula` to allow users to have multiple versions installed at once. | false |
Other | Homebrew | brew | 1978f4be653c2621658e1da16a2a0478cb159738.json | Unbottled: fix use of invalid argument | Library/Homebrew/dev-cmd/unbottled.rb | @@ -216,7 +216,7 @@ def output_unbottled(formulae, deps_hash, noun, hash, any_named_args)
end
deps = Array(deps_hash[f.name]).reject do |dep|
- dep.bottle_specification.tag?(@bottle_tag, exact: true) || dep.bottle_unneeded?
+ dep.bottle_specification.tag?(@bottle_tag, no_older_versions: true) || dep.bottle_unneeded?
end
if deps.blank? | false |
Other | Homebrew | brew | 390d1085553b2b7d909f7cfbbfb28a5950832fff.json | docs: add Cask Cookbook | docs/Cask-Cookbook.md | @@ -0,0 +1,1458 @@
+# Cask Cookbook
+
+Each Cask is a Ruby block, beginning with a special header line. The Cask definition itself is always enclosed in a `do … end` block. Example:
+
+```ruby
+cask "alfred" do
+ version "2.7.1_387"
+ sha256 "a3738d0513d736918a6d71535ef3d85dd184af267c05698e49ac4c6b48f38e17"
+
+ url "https://cachefly.alfredapp.com/Alfred_#{version}.zip"
+ name "Alfred"
+ desc "Application launcher and productivity software"
+ homepage "https://www.alfredapp.com/"
+
+ app "Alfred 2.app"
+ app "Alfred 2.app/Contents/Preferences/Alfred Preferences.app"
+end
+```
+
+## The Cask Language Is Declarative
+
+Each Cask contains a series of stanzas (or “fields”) which *declare* how the software is to be obtained and installed. In a declarative language, the author does not need to worry about **order**. As long as all the needed fields are present, Homebrew Cask will figure out what needs to be done at install time.
+
+To make maintenance easier, the most-frequently-updated stanzas are usually placed at the top. But that’s a convention, not a rule.
+
+Exception: `do` blocks such as `postflight` may enclose a block of pure Ruby code. Lines within that block follow a procedural (order-dependent) paradigm.
+
+## Conditional Statements
+
+### Efficiency
+
+Conditional statements are permitted, but only if they are very efficient.
+Tests on the following values are known to be acceptable:
+
+| value | examples
+| ----------------------------|--------------------------------------
+| `MacOS.version` | [coconutbattery.rb](https://github.com/Homebrew/homebrew-cask/blob/a11ee55e8ed8255f7dab77120dfb1fb955789559/Casks/coconutbattery.rb#L2-L16), [yasu.rb](https://github.com/Homebrew/homebrew-cask/blob/21d3f7ac8a4adac0fe474b3d4b020d284eeef88d/Casks/yasu.rb#L2-L23)
+
+### Version Comparisons
+
+Tests against `MacOS.version` may use either symbolic names or version
+strings with numeric comparison operators:
+
+```ruby
+if MacOS.version <= :mojave # symbolic name
+```
+
+```ruby
+if MacOS.version <= "10.14" # version string
+```
+
+The available symbols for macOS versions are: `:yosemite`, `:el_capitan`, `:sierra`, `:high_sierra`, `:mojave`, `:catalina` and `:big_sur`. The corresponding numeric version strings should be given as major releases containing a single dot.
+
+Note that in the official Homebrew Cask repositories only the symbolic names are allowed. The numeric comparison may only be used for third-party taps.
+
+### Always Fall Through to the Newest Case
+
+Conditionals should be constructed so that the default is the newest OS version. When using an `if` statement, test for older versions, and then let the `else` statement hold the latest and greatest. This makes it more likely that the Cask will work without alteration when a new OS is released. Example (from [coconutbattery.rb](https://github.com/Homebrew/homebrew-cask/blob/2c801af44be29fff7f3cb2996455fce5dd95d1cc/Casks/coconutbattery.rb)):
+
+```ruby
+if MacOS.version <= :sierra
+ # ...
+elsif MacOS.version <= :mojave
+ # ...
+else
+ # ...
+end
+```
+
+### Switch Between Languages or Regions
+
+If a cask is available in multiple languages, you can use the `language` stanza to switch between languages or regions based on the system locale.
+
+## Arbitrary Ruby Methods
+
+In the exceptional case that the Cask DSL is insufficient, it is possible to define arbitrary Ruby variables and methods inside the Cask by creating a `Utils` namespace. Example:
+
+```ruby
+cask "myapp" do
+ module Utils
+ def self.arbitrary_method
+ ...
+ end
+ end
+
+ name "MyApp"
+ version "1.0"
+ sha256 "a32565cdb1673f4071593d4cc9e1c26bc884218b62fef8abc450daa47ba8fa92"
+
+ url "https://#{Utils.arbitrary_method}"
+ homepage "https://www.example.com/"
+ ...
+end
+```
+
+This should be used sparingly: any method which is needed by two or more Casks should instead be rolled into the core. Care must also be taken that such methods be very efficient.
+
+Variables and methods should not be defined outside the `Utils` namespace, as they may collide with Homebrew Cask internals.
+
+## Header Line Details
+
+The first non-comment line in a Cask follows the form:
+
+```ruby
+cask "<cask-token>" do
+```
+
+[`<cask-token>`](token_reference.md) should match the Cask filename, without the `.rb` extension,
+enclosed in single quotes.
+
+There are currently some arbitrary limitations on Cask tokens which are in the process of being removed. The Travis bot will catch any errors during the transition.
+
+## Stanza order
+
+Having a common order for stanzas makes Casks easier to update and parse. Below is the complete stanza sequence (no Cask will have all stanzas). The empty lines shown here are also important, as they help to visually delineate information.
+
+```
+version
+sha256
+
+language
+
+url
+appcast
+name
+desc
+homepage
+
+livecheck
+
+auto_updates
+conflicts_with
+depends_on
+container
+
+suite
+app
+pkg
+installer
+binary
+manpage
+colorpicker
+dictionary
+font
+input_method
+internet_plugin
+prefpane
+qlplugin
+mdimporter
+screen_saver
+service
+audio_unit_plugin
+vst_plugin
+vst3_plugin
+artifact, target: # target: shown here as is required with `artifact`
+stage_only
+
+preflight
+
+postflight
+
+uninstall_preflight
+
+uninstall_postflight
+
+uninstall
+
+zap
+
+caveats
+```
+
+Note that every stanza that has additional parameters (`:symbols` after a `,`) shall have them on separate lines, one per line, in alphabetical order. An exception is `target:` which typically consists of short lines.
+
+## Stanzas
+### Required Stanzas
+
+Each of the following stanzas is required for every Cask.
+
+| name | multiple occurrences allowed? | value |
+| ---------- |------------------------------ | ------------------------------- |
+| `version` | no | Application version.<br />See [Version Stanza Details](#stanza-version) for more information.
+| `sha256` | no | SHA-256 checksum of the file downloaded from `url`, calculated by the command `shasum -a 256 <file>`. Can be suppressed by using the special value `:no_check`.<br />See [Checksum Stanza Details](#stanza-sha256) for more information.
+| `url` | no | URL to the `.dmg`/`.zip`/`.tgz`/`.tbz2` file that contains the application.<br />A [comment](#when-url-and-homepage-hostnames-differ-add-a-comment) should be added if the hostnames in the `url` and `homepage` stanzas differ. Block syntax should be used for URLs that change on every visit.<br />See [URL Stanza Details](#stanza-url) for more information.
+| `name` | yes | String providing the full and proper name defined by the vendor.<br />See [Name Stanza Details](#stanza-name) for more information.
+| `desc` | no | One-line description of the Cask. Shows when running `brew info`.<br />See [Desc Stanza Details](#stanza-desc) for more information.
+| `homepage` | no | Application homepage; used for the `brew home` command.
+
+### At Least One Artifact Stanza Is Also Required
+
+Each Cask must declare one or more *artifacts* (i.e. something to install).
+
+| name | multiple occurrences allowed? | value |
+| ------------------- |------------------------------ | ---------------------- |
+| `app` | yes | Relative path to an `.app` that should be moved into the `/Applications` folder on installation.<br />See [App Stanza Details](#stanza-app) for more information.
+| `pkg` | yes | Relative path to a `.pkg` file containing the distribution.<br />See [Pkg Stanza Details](#stanza-pkg) for more information.
+| `binary` | yes | Relative path to a Binary that should be linked into the `$(brew --prefix)/bin` folder (typically `/usr/local/bin`) on installation.<br />See [Binary Stanza Details](#stanza-binary) for more information.
+| `colorpicker` | yes | Relative path to a ColorPicker plugin that should be moved into the `~/Library/ColorPickers` folder on installation.
+| `dictionary` | yes | Relative path to a Dictionary that should be moved into the `~/Library/Dictionaries` folder on installation.
+| `font` | yes | Relative path to a Font that should be moved into the `~/Library/Fonts` folder on installation.
+| `input_method` | yes | Relative path to a Input Method that should be moved into the `~/Library/Input Methods` folder on installation.
+| `internet_plugin` | yes | Relative path to a Service that should be moved into the `~/Library/Internet Plug-Ins` folder on installation.
+| `manpage` | yes | Relative path to a Man Page that should be linked into the respective man page folder on installation, e.g. `/usr/local/share/man/man3` for `my_app.3`.
+| `prefpane` | yes | Relative path to a Preference Pane that should be moved into the `~/Library/PreferencePanes` folder on installation.
+| `qlplugin` | yes | Relative path to a QuickLook Plugin that should be moved into the `~/Library/QuickLook` folder on installation.
+| `mdimporter` | yes | Relative path to a Spotlight metadata importer that should be moved into the `~/Library/Spotlight` folder on installation.
+| `screen_saver` | yes | Relative path to a Screen Saver that should be moved into the `~/Library/Screen Savers` folder on installation.
+| `service` | yes | Relative path to a Service that should be moved into the `~/Library/Services` folder on installation.
+| `audio_unit_plugin` | yes | Relative path to an Audio Unit plugin that should be moved into the `~/Library/Audio/Components` folder on installation.
+| `vst_plugin` | yes | Relative path to a VST Plugin that should be moved into the `~/Library/Audio/VST` folder on installation.
+| `vst3_plugin` | yes | Relative path to a VST3 Plugin that should be moved into the `~/Library/Audio/VST3` folder on installation.
+| `suite` | yes | Relative path to a containing directory that should be moved into the `/Applications` folder on installation.<br />See [Suite Stanza Details](#stanza-suite) for more information.
+| `artifact` | yes | Relative path to an arbitrary path that should be moved on installation. Must provide an absolute path as a `target` (example [alcatraz.rb](https://github.com/Homebrew/homebrew-cask/blob/312ae841f1f1b2ec07f4d88b7dfdd7fbdf8d4f94/Casks/alcatraz.rb#L12)). This is only for unusual cases. The `app` stanza is strongly preferred when moving `.app` bundles.
+| `installer` | yes | Describes an executable which must be run to complete the installation.<br />See [Installer Stanza Details](#stanza-installer) for more information.
+| `stage_only` | no | `true`. Assert that the Cask contains no activatable artifacts.
+
+### Optional Stanzas
+
+| name | multiple occurrences allowed? | value |
+| ---------------------- |------------------------------ | ------------------- |
+| `uninstall` | yes | Procedures to uninstall a Cask. Optional unless the `pkg` stanza is used.<br />See [Uninstall Stanza Details](#stanza-uninstall) for more information.
+| `zap` | yes | Additional procedures for a more complete uninstall, including user files and shared resources.<br />See [Zap Stanza Details](#stanza-zap) for more information.
+| `appcast` | no | URL providing an appcast feed to find updates for this Cask.<br />See [Appcast Stanza Details](#stanza-appcast) for more information.
+| `depends_on` | yes | List of dependencies and requirements for this Cask.<br />See [Depends_on Stanza Details](#stanza-depends_on) for more information.
+| `conflicts_with` | yes | List of conflicts with this Cask (*not yet functional*).<br />See [Conflicts_with Stanza Details](#stanza-conflicts_with) for more information.
+| `caveats` | yes | String or Ruby block providing the user with Cask-specific information at install time.<br />See [Caveats Stanza Details](#stanza-caveats) for more information.
+| `livecheck` | no | Ruby block describing how to find updates for this Cask.<br />See [Livecheck Stanza Details](#stanza-livecheck) for more information.
+| `preflight` | yes | Ruby block containing preflight install operations (needed only in very rare cases).
+| `postflight` | yes | Ruby block containing postflight install operations.<br />See [Postflight Stanza Details](#stanza-flight) for more information.
+| `uninstall_preflight` | yes | Ruby block containing preflight uninstall operations (needed only in very rare cases).
+| `uninstall_postflight` | yes | Ruby block containing postflight uninstall operations.
+| `language` | required | Ruby block, called with language code parameters, containing other stanzas and/or a return value.<br />See [Language Stanza Details](#stanza-language) for more information.
+| `container nested:` | no | Relative path to an inner container that must be extracted before moving on with the installation. This allows us to support dmg inside tar, zip inside dmg, etc.
+| `container type:` | no | Symbol to override container-type autodetect. May be one of: `:air`, `:bz2`, `:cab`, `:dmg`, `:generic_unar`, `:gzip`, `:otf`, `:pkg`, `:rar`, `:seven_zip`, `:sit`, `:tar`, `:ttf`, `:xar`, `:zip`, `:naked`. (Example: [parse.rb](https://github.com/Homebrew/homebrew-cask/blob/312ae841f1f1b2ec07f4d88b7dfdd7fbdf8d4f94/Casks/parse.rb#L11))
+| `auto_updates` | no | `true`. Assert the Cask artifacts auto-update. Use if `Check for Updates…` or similar is present in app menu, but not if it only opens a webpage and does not do the download and installation for you.
+
+
+## Stanza descriptions
+
+### Stanza: `app`
+
+In the simple case of a string argument to `app`, the source file is moved to the target `/Applications` directory. For example:
+
+```ruby
+app "Alfred 2.app"
+```
+
+by default moves the source to:
+
+```bash
+/Applications/Alfred 2.app
+```
+
+#### Renaming the Target
+
+You can rename the target which appears in your `/Applications` directory by adding a `target:` key to `app`. Example (from [scala-ide.rb](https://github.com/Homebrew/homebrew-cask/blob/312ae841f1f1b2ec07f4d88b7dfdd7fbdf8d4f94/Casks/scala-ide.rb#L21)):
+
+```ruby
+app "eclipse/Eclipse.app", target: "Scala IDE.app"
+```
+
+#### target: May Contain an Absolute Path
+
+If `target:` has a leading slash, it is interpreted as an absolute path. The containing directory for the absolute path will be created if it does not already exist. Example (from [manopen.rb](https://github.com/Homebrew/homebrew-cask/blob/312ae841f1f1b2ec07f4d88b7dfdd7fbdf8d4f94/Casks/manopen.rb#L12)):
+
+```ruby
+artifact "openman.1", target: "/usr/local/share/man/man1/openman.1"
+```
+
+#### target: Works on Most Artifact Types
+
+The `target:` key works similarly for most Cask artifacts, such as `app`, `binary`, `colorpicker`, `dictionary`, `font`, `input_method`, `prefpane`, `qlplugin`, `mdimporter`, `service`, `suite`, and `artifact`.
+
+#### target: Should Only Be Used in Select Cases
+
+Don’t use `target:` for aesthetic reasons, like removing version numbers (`app "Slack #{version}.app", target: "Slack.app"`). Use it when it makes sense functionally and document your reason clearly in the Cask, using one of the templates: [for clarity](https://github.com/Homebrew/homebrew-cask/blob/312ae841f1f1b2ec07f4d88b7dfdd7fbdf8d4f94/Casks/imagemin.rb#L12); [for consistency](https://github.com/Homebrew/homebrew-cask/blob/d2a6b26df69fc28c4d84d6f5198b2b652c2f414d/Casks/devonthink-pro-office.rb#L16); [to prevent conflicts](https://github.com/Homebrew/homebrew-cask/blob/bd6dc1a64e0bdd35ba0e20789045ea023b0b6aed/Casks/flash-player-debugger.rb#L11); [due to developer suggestion](https://github.com/Homebrew/homebrew-cask/blob/ff3e9c4a6623af44b8a071027e8dcf3f4edfc6d9/Casks/kivy.rb#L12).
+
+### Stanza: `appcast`
+
+The value of the `appcast` stanza is a string, holding the URL for an appcast which provides information on future updates.
+
+Note: The [`livecheck` stanza](#stanza-livecheck) should be preferred in most cases, as it allows casks to be updated automatically.
+
+The main casks repo only accepts submissions for stable versions of software (and [documented exceptions](https://github.com/Homebrew/homebrew-cask/blob/HEAD/doc/development/adding_a_cask.md#but-there-is-no-stable-version)), but it still gets pull requests for unstable versions. By checking the submitted `version` against the contents of an appcast, we can better detect these invalid cases.
+
+Example: [`atom.rb`](https://github.com/Homebrew/homebrew-cask/blob/645dbb8228ec2f1f217ed1431e188687aac13ca5/Casks/atom.rb#L7)
+
+There are a few different ways the `appcast` can be determined:
+
+* If the app is distributed via GitHub releases, the `appcast` will be of the form `https://github.com/<user>/<project_name>/releases.atom`. Example: [`electron.rb`](https://github.com/Homebrew/homebrew-cask/blob/645dbb8228ec2f1f217ed1431e188687aac13ca5/Casks/electron.rb#L7)
+
+* If the app is distributed via GitLab releases, the `appcast` will be of the form `https://gitlab.com/<user>/<project_name>/-/tags?format=atom`. Example: [`grafx.rb`](https://github.com/Homebrew/homebrew-cask/blob/b22381902f9da870bb07d21b496558f283dad612/Casks/grafx.rb#L6)
+
+* The popular update framework [Sparkle](https://sparkle-project.org/) generally uses the `SUFeedURL` property in `Contents/Info.plist` inside `.app` bundles. Example: [`glyphs.rb`](https://github.com/Homebrew/homebrew-cask/blob/645dbb8228ec2f1f217ed1431e188687aac13ca5/Casks/glyphs.rb#L6)
+
+* Sourceforge projects follow the form `https://sourceforge.net/projects/<project_name>/rss`. A more specific page can be used as needed, pointing to a specific directory structure: `https://sourceforge.net/projects/<project_name>/rss?path=/<path_here>`. Example: [`seashore.rb`](https://github.com/Homebrew/homebrew-cask/blob/645dbb8228ec2f1f217ed1431e188687aac13ca5/Casks/seashore.rb#L6)
+
+* An appcast can be any URL hosted by the app’s developer that changes every time a new release is out or that contains the version number of the current release (e.g. a download HTML page). Webpages that only change on new version releases are preferred, as are sites that do not contain previous version strings (i.e. avoid changelog pages if the download page contains the current version number but not older ones). Example: [`razorsql.rb`](https://github.com/Homebrew/homebrew-cask/blob/645dbb8228ec2f1f217ed1431e188687aac13ca5/Casks/razorsql.rb#L6)
+
+The [`find-appcast`](https://github.com/Homebrew/homebrew-cask/blob/HEAD/developer/bin/find-appcast) script is able to identify some of these, as well as `electron-builder` appcasts which are trickier to find by hand. Run it with `"$(brew --repository)/Library/Taps/homebrew/homebrew-cask/developer/bin/find-appcast" '</path/to/software.app>'`.
+
+#### Parameters
+
+| key | value |
+| --------------- | ----------- |
+| `must_contain:` | a custom string for `brew audit --appcast {{cask_file}}` to check against. |
+
+Sometimes a `version` doesn’t match a string on the webpage, in which case we tweak what to search for. Example: if `version` is `6.26.1440` and the appcast’s contents only show `6.24`, the check for “is `version` in the appcast feed” will fail. With `must_contain`, the check is told to “look for this string instead of `version`”. In the example, `must_contain: version.major_minor` is saying “look for `6.24`”, making the check succeed.
+
+If no `must_contain` is given, the check considers from the beginning of the `version` string until the first character that isn’t alphanumeric or a period. Example: if `version` is `6.26b-14,40`, the check will see `6.26b`. This is so it covers most cases by default, while still allowing complex `version`s suitable for interpolation on the rest of the cask.
+
+Example of using `must_contain`: [`hwsensors.rb`](https://github.com/Homebrew/homebrew-cask/blob/87bc3860f43d5b14d0c38ae8de469d24ee7f5b2f/Casks/hwsensors.rb#L6L7)
+
+### Stanza: `binary`
+
+In the simple case of a string argument to `binary`, the source file is linked into the `$(brew --prefix)/bin` directory (typically `/usr/local/bin`) on installation. For example (from [operadriver.rb](https://github.com/Homebrew/homebrew-cask/blob/60531a2812005dd5f17dc92f3ce7419af3c5d019/Casks/operadriver.rb#L11)):
+
+```ruby
+binary "operadriver"
+```
+
+creates a symlink to:
+
+```bash
+$(brew --prefix)/bin/operadriver
+```
+
+from a source file such as:
+
+```bash
+/usr/local/Caskroom/operadriver/0.2.2/operadriver
+```
+
+A binary (or multiple) can also be contained in an application bundle:
+
+```ruby
+app "Atom.app"
+binary "#{appdir}/Atom.app/Contents/Resources/app/apm/bin/apm"
+```
+
+You can rename the target which appears in your binaries directory by adding a `target:` key to `binary`:
+
+```ruby
+binary "#{appdir}/Atom.app/Contents/Resources/app/atom.sh", target: "atom"
+```
+
+Behaviour and usage of `target:` is [the same as with `app`](#renaming-the-target). However, for `binary` the select cases don’t apply as rigidly. It’s fine to take extra liberties with `target:` to be consistent with other command-line tools, like [changing case](https://github.com/Homebrew/homebrew-cask/blob/9ad93b833961f1d969505bc6bdb1c2ad4e58a433/Casks/openscad.rb#L12), [removing an extension](https://github.com/Homebrew/homebrew-cask/blob/c443d4f5c6864538efe5bb1ecf662565a5ffb438/Casks/filebot.rb#L13), or [cleaning up the name](https://github.com/Homebrew/homebrew-cask/blob/146917cbcc679648de6b0bccff4e9b43fce0e6c8/Casks/minishift.rb#L13).
+
+### Stanza: `caveats`
+
+Sometimes there are particularities with the installation of a piece of software that cannot or should not be handled programmatically by Homebrew Cask. In those instances, `caveats` is the way to inform the user. Information in `caveats` is displayed when a cask is invoked with either `install` or `info`.
+
+To avoid flooding users with too many messages (thus desensitising them to the important ones), `caveats` should be used sparingly and exclusively for installation-related matters. If you’re not sure a `caveat` you find pertinent is installation-related or not, ask a maintainer. As a general rule, if your case isn’t already covered in our comprehensive [`caveats Mini-DSL`](#caveats-mini-dsl), it’s unlikely to be accepted.
+
+#### caveats as a String
+
+When `caveats` is a string, it is evaluated at compile time. The following methods are available for interpolation if `caveats` is placed in its customary position at the end of the Cask:
+
+| method | description |
+| ------------------ | ----------- |
+| `token` | the Cask token
+| `version` | the Cask version
+| `homepage` | the Cask homepage
+| `caskroom_path` | the containing directory for all staged Casks, typically `/usr/local/Caskroom` (only available with block form)
+| `staged_path` | the staged location for this Cask, including version number: `/usr/local/Caskroom/{{token}}/{{version}}` (only available with block form)
+
+Example:
+
+```ruby
+caveats "Using #{token} is hazardous to your health."
+```
+
+#### caveats as a Block
+
+When `caveats` is a Ruby block, evaluation is deferred until install time. Within a block you may refer to the `@cask` instance variable, and invoke any method available on `@cask`.
+
+#### caveats Mini-DSL
+
+There is a mini-DSL available within `caveats` blocks.
+
+The following methods may be called to generate standard warning messages:
+
+| method | description |
+| ---------------------------------- | ----------- |
+| `path_environment_variable "path"` | users should make sure `path` is in their `$PATH` environment variable.
+| `zsh_path_helper "path"` | zsh users must take additional steps to make sure `path` is in their `$PATH` environment variable.
+| `depends_on_java "version"` | users should make sure they have the specified version of java installed. `version` can be exact (e.g. `6`), a minimum (e.g. `7+`), or omitted (when any version works).
+| `logout` | users should log out and log back in to complete installation.
+| `reboot` | users should reboot to complete installation.
+| `files_in_usr_local` | the Cask installs files to `/usr/local`, which may confuse Homebrew.
+| `discontinued` | all software development has been officially discontinued upstream.
+| `free_license "web_page"` | users may get an official license to use the software at `web_page`.
+| `kext` | users may need to enable their kexts in System Preferences → Security & Privacy → General.
+| `unsigned_accessibility` | users will need to re-enable the app on each update in System Preferences → Security & Privacy → Privacy as it is unsigned.
+| `license "web_page"` | software has a usage license at `web_page`.
+
+Example:
+
+```ruby
+caveats do
+ path_environment_variable "/usr/texbin"
+end
+```
+
+### Stanza: `conflicts_with`
+
+`conflicts_with` is used to declare conflicts that keep a Cask from installing or working correctly.
+
+#### conflicts_with cask:
+
+The value should be another Cask token.
+
+Example use: [`wireshark`](https://github.com/Homebrew/homebrew-cask/blob/903493e09cf33b845e7cf497ecf9cfc9709087ee/Casks/wireshark.rb#L10), which conflicts with `wireshark-chmodbpf`.
+
+```ruby
+conflicts_with cask: "wireshark-chmodbpf"
+```
+
+#### conflicts_with formula:
+
+Note: `conflicts_with formula:` is a stub and is not yet functional.
+
+The value should be another formula name.
+
+Example use: [`macvim`](https://github.com/Homebrew/homebrew-cask/blob/84b90afd7b571e581f8a48d4bdf9c7bb24ebff3b/Casks/macvim.rb#L10), which conflicts with the `macvim` formula.
+
+```ruby
+conflicts_with formula: "macvim"
+```
+
+### Stanza: `depends_on`
+
+`depends_on` is used to declare dependencies and requirements for a Cask.
+`depends_on` is not consulted until `install` is attempted.
+
+#### depends_on cask:
+
+The value should be another Cask token, needed by the current Cask.
+
+Example use: [`cellery`](https://github.com/Homebrew/homebrew-cask/blob/4002df8f6bca93ed6eb40494995fcfa038cf99bf/Casks/cellery.rb#L11) depends on OSXFUSE:
+
+```ruby
+depends_on cask: "osxfuse"
+```
+
+#### depends_on formula:
+
+The value should name a Homebrew Formula needed by the Cask.
+
+Example use: some distributions are contained in archive formats such as `7z` which are not supported by stock Apple tools. For these cases, a more capable archive reader may be pulled in at install time by declaring a dependency on the Homebrew Formula `unar`:
+
+```ruby
+depends_on formula: "unar"
+```
+
+#### depends_on macos:
+
+##### Requiring an Exact macOS Release
+
+The value for `depends_on macos:` may be a symbol or an array of symbols, listing the exact compatible macOS releases.
+
+The available values for macOS releases are:
+
+| symbol | corresponding release
+| -------------------|----------------------
+| `:yosemite` | `10.10`
+| `:el_capitan` | `10.11`
+| `:sierra` | `10.12`
+| `:high_sierra` | `10.13`
+| `:mojave` | `10.14`
+| `:catalina` | `10.15`
+| `:big_sur` | `11.0`
+
+Only major releases are covered (version numbers containing a single dot). The symbol form is used for readability. The following are all valid ways to enumerate the exact macOS release requirements for a Cask:
+
+```ruby
+depends_on macos: :big_sur
+depends_on macos: [
+ :catalina,
+ :big_sur,
+]
+```
+
+##### Setting a Minimum macOS Release
+
+`depends_on macos:` can also accept a string starting with a comparison operator such as `>=`, followed by an macOS release in the form above. The following is a valid expression meaning “at least macOS Big Sur (11.0)”:
+
+```ruby
+depends_on macos: ">= :big_sur"
+```
+
+A comparison expression cannot be combined with any other form of `depends_on macos:`.
+
+#### depends_on arch:
+
+The value for `depends_on arch:` may be a symbol or an array of symbols, listing the hardware compatibility requirements for a Cask. The requirement is satisfied at install time if any one of multiple `arch:` value matches the user’s hardware.
+
+The available symbols for hardware are:
+
+| symbol | meaning |
+| ---------- | -------------- |
+| `:x86_64` | 64-bit Intel |
+| `:intel` | 64-bit Intel |
+
+The following are all valid expressions:
+
+```ruby
+depends_on arch: :intel
+depends_on arch: :x86_64 # same meaning as above
+depends_on arch: [:x86_64] # same meaning as above
+```
+
+Since as of now all the macOS versions we support only run on 64-bit Intel, `depends_on arch:` is never necessary.
+
+#### All depends_on Keys
+
+| key | description |
+| ---------- | ----------- |
+| `formula:` | a Homebrew Formula
+| `cask:` | a Cask token
+| `macos:` | a symbol, string, array, or comparison expression defining macOS release requirements
+| `arch:` | a symbol or array defining hardware requirements
+| `java:` | *stub - not yet functional*
+
+### Stanza: `desc`
+
+`desc` accepts a single-line UTF-8 string containing a short description of the software. It’s used to help with searchability and disambiguation, thus it must concisely describe what the software does (or what you can accomplish with it).
+
+`desc` is not for app slogans! Vendors’ descriptions tend to be filled with generic adjectives such as “modern” and “lightweight”. Those are meaningless marketing fluff (do you ever see apps proudly describing themselves as outdated and bulky?) which must the deleted. It’s fine to use the information on the software’s website as a starting point, but it will require editing in almost all cases.
+
+#### Dos and Don'ts
+
+- **Do** start with an uppercase letter.
+
+ ```diff
+ - desc "sound and music editor"
+ + desc "Sound and music editor"
+ ```
+
+- **Do** be brief, i.e. use less than 80 characters.
+
+ ```diff
+ - desc "Sound and music editor which comes with effects, instruments, sounds and all kinds of creative features"
+ + desc "Sound and music editor"
+ ```
+
+- **Do** describe what the software does or is:
+
+ ```diff
+ - desc "Development of musical ideas made easy"
+ + desc "Sound and music editor"
+ ```
+
+- **Do not** include the platform. Casks only work on macOS, so this is redundant information.
+
+ ```diff
+ - desc "Sound and music editor for macOS"
+ + desc "Sound and music editor"
+ ```
+
+- **Do not** include the Cask’s [name](#stanza-name).
+
+ ```diff
+ - desc "Ableton Live is a sound and music editor"
+ + desc "Sound and music editor"
+ ```
+
+- **Do not** include the vendor. This should be added to the Cask’s [name](#stanza-name) instead.
+
+
+ ```diff
+ - desc "Sound and music editor made by Ableton"
+ + desc "Sound and music editor"
+ ```
+
+- **Do not** add user pronouns.
+
+ ```diff
+ - desc "Edit your music files"
+ + desc "Sound and music editor"
+ ```
+
+- **Do not** use empty marketing jargon.
+
+ ```diff
+ - desc "Beautiful and powerful modern sound and music editor"
+ + desc "Sound and music editor"
+ ```
+
+### Stanza: `\*flight`
+
+#### Evaluation of Blocks is Always Deferred
+
+The Ruby blocks defined by `preflight`, `postflight`, `uninstall_preflight`, and `uninstall_postflight` are not evaluated until install time or uninstall time. Within a block, you may refer to the `@cask` instance variable, and invoke any method available on `@cask`.
+
+#### \*flight Mini-DSL
+
+There is a mini-DSL available within these blocks.
+
+The following methods may be called to perform standard tasks:
+
+| method | availability | description |
+| ----------------------------------------- | ------------------------------------------------ | ----------- |
+| `set_ownership(paths)` | `preflight`, `postflight`, `uninstall_preflight` | set user and group ownership of `paths`. Example: [`unifi-controller.rb`](https://github.com/Homebrew/homebrew-cask/blob/8a452a41707af6a661049da6254571090fac5418/Casks/unifi-controller.rb#L13)
+| `set_permissions(paths, permissions_str)` | `preflight`, `postflight`, `uninstall_preflight` | set permissions in `paths` to `permissions_str`. Example: [`docker-machine.rb`](https://github.com/Homebrew/homebrew-cask/blob/8a452a41707af6a661049da6254571090fac5418/Casks/docker-machine.rb#L16)
+
+`set_ownership(paths)` defaults user ownership to the current user and group ownership to `staff`. These can be changed by passing in extra options: `set_ownership(paths, user: 'user', group: 'group')`.
+
+### Stanza: `installer`
+
+This stanza must always be accompanied by [`uninstall`](#stanza-uninstall).
+
+The `installer` stanza takes a series of key-value pairs, the first key of which must be `manual:` or `script:`.
+
+#### installer manual:
+
+`installer manual:` takes a single string value, describing a GUI installer which must be run by the user at a later time. The path may be absolute, or relative to the Cask. Example (from [nutstore.rb](https://github.com/Homebrew/homebrew-cask/blob/249ec31048591308e63e50f79dae01d2f933cccf/Casks/nutstore.rb#L9)):
+
+```ruby
+installer manual: "Nutstore Installer.app"
+```
+
+#### installer script:
+
+`installer script:` introduces a series of key-value pairs describing a command which will automate completion of the install. **It should never be used for interactive installations.** The form is similar to `uninstall script:`:
+
+| key | value
+| ----------------|------------------------------
+| `executable:` | path to an install script to be run
+| `args:` | array of arguments to the install script
+| `input:` | array of lines of input to be sent to `stdin` of the script
+| `must_succeed:` | set to `false` if the script is allowed to fail
+| `sudo:` | set to `true` if the script needs `sudo`
+
+The path may be absolute, or relative to the Cask. Example (from [miniforge.rb](https://github.com/Homebrew/homebrew-cask/blob/ed2033fb3578376c3ee58a2cb459ef96fa6eb37d/Casks/miniforge.rb#L15L18)):
+
+```ruby
+ installer script: {
+ executable: "Miniforge3-#{version}-MacOSX-x86_64.sh",
+ args: ["-b", "-p", "#{caskroom_path}/base"],
+ }
+```
+
+If the `installer script:` does not require any of the key-values it can point directly to the path of the install script:
+
+```ruby
+installer script: "#{staged_path}/install.sh"
+```
+
+### Stanza: `language`
+
+The `language` stanza can match [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) language codes, regional identifiers ([ISO 3166-1 Alpha 2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)) and script codes ([ISO 15924](https://en.wikipedia.org/wiki/ISO_15924)), or a combination thereof.
+
+US English should always be used as the default language:
+
+```ruby
+language "zh", "CN" do
+ "zh_CN"
+end
+
+language "de" do
+ "de_DE"
+end
+
+language "en-GB" do
+ "en_GB"
+end
+
+language "en", default: true do
+ "en_US"
+end
+```
+
+Note that the following are not the same:
+
+```ruby
+language "en", "GB" do
+ # matches all locales containing "en" or "GB"
+end
+
+language "en-GB" do
+ # matches only locales containing "en" and "GB"
+end
+```
+
+The return value of the matching `language` block can be accessed by simply calling `language`.
+
+```ruby
+homepage "https://example.org/#{language}"
+```
+
+Examples: [Firefox](https://github.com/Homebrew/homebrew-cask/blob/306b8fbd9502036f1ca742f70c569d8677b62403/Casks/firefox.rb#L4L74), [Battle.net](https://github.com/Homebrew/homebrew-cask/blob/306b8fbd9502036f1ca742f70c569d8677b62403/Casks/battle-net.rb#L5L17)
+
+
+#### Installation
+
+To install a cask in a specific language, you can pass the `--language=` option to `brew install`:
+
+```
+brew install firefox --language=it
+```
+
+### Stanza: `livecheck`
+
+The `livecheck` stanza is used to automatically fetch the latest version of a cask from changelogs, release notes, appcasts, etc. See also: [`brew livecheck` reference](Brew-Livecheck.md)
+
+Every `livecheck` block must contain a `url`, which can either be a string or a symbol pointing to other URLs in the cask (`:url` or `:homepage`).
+
+Additionally, a `livecheck` should specify which `strategy` should be used to extract the version:
+
+| `strategy` | Description |
+|-----------------|-----------|
+| `:header_match` | extract version from HTTP headers (e.g. `Location` or `Content-Disposition`) |
+| `:page_match` | extract version from page contents |
+| `:sparkle` | extract version from Sparkle appcast contents |
+
+Here is a basic example, extracting a simple version from a page:
+
+```ruby
+livecheck do
+ url "https://example.org/my-app/download"
+ strategy :page_match
+ regex(%r{href=.*?/MyApp-(\d+(?:\.\d+)*)\.zip}i)
+end
+```
+
+If the download URL is present on the homepage, we can use a symbol instead of a string:
+
+```ruby
+livecheck do
+ url :homepage
+ strategy :page_match
+ regex(%r{href=.*?/MyApp-(\d+(?:\.\d+)*)\.zip}i)
+end
+```
+
+
+The `header_match` strategy will try parsing a version from the filename (in the `Content-Disposition` header) and the final URL (in the `Location` header). If that doesn't work, a `regex` can be specified, e.g.:
+
+```ruby
+strategy :header_match
+regex(/MyApp-(\d+(?:\.\d+)*)\.zip/i)
+```
+
+If the version depends on multiple header fields, a block can be specified, e.g.
+
+```ruby
+strategy :header_match do |headers|
+ v = headers["content-disposition"][/MyApp-(\d+(?:\.\d+)*)\.zip/i, 1]
+ id = headers["location"][%r{/(\d+)/download$}i, 1]
+ "#{v},#{id}"
+end
+```
+
+Similarly, the `:page_match` strategy can also be used for more complex versions by specifying a block:
+
+```ruby
+strategy :page_match do |page|
+ match = page.match(%r{href=.*?/(\d+)/MyApp-(\d+(?:\.\d+)*)\.zip}i)
+ "#{match[2]},#{match[1]}"
+end
+```
+
+### Stanza: `name`
+
+`name` accepts a UTF-8 string defining the name of the software, including capitalization and punctuation. It is used to help with searchability and disambiguation.
+
+Unlike the [token](#token-reference), which is simplified and reduced to a limited set of characters, the `name` stanza can include the proper capitalization, spacing and punctuation to match the official name of the software. For disambiguation purposes, it is recommended to spell out the name of the application, and including the vendor name if necessary. A good example is [`pycharm-ce`](https://github.com/Homebrew/homebrew-cask/blob/fc05c0353aebb28e40db72faba04b82ca832d11a/Casks/pycharm-ce.rb#L6-L7), whose name is spelled out as `Jetbrains PyCharm Community Edition`, even though it is likely never referenced as such anywhere.
+
+Additional details about the software can be provided in the [desc](#stanza-desc) stanza.
+
+The `name` stanza can be repeated multiple times if there are useful alternative names. The first instance should use the Latin alphabet. For example, see the [`cave-story`](https://github.com/Homebrew/homebrew-cask/blob/0fe48607f5656e4f1de58c6884945378b7e6f960/Casks/cave-story.rb#L7-L9) cask, whose original name does not use the Latin alphabet.
+
+### Stanza: `pkg`
+
+This stanza must always be accompanied by [`uninstall`](#stanza-uninstall)
+
+The first argument to the `pkg` stanza should be a relative path to the `.pkg` file to be installed. For example:
+
+```ruby
+pkg "Unity.pkg"
+```
+
+Subsequent arguments to `pkg` are key/value pairs which modify the install process. Currently supported keys are `allow_untrusted:` and `choices:`.
+
+#### `pkg allow_untrusted:`
+
+`pkg allow_untrusted: true` can be used to install the `.pkg` with an untrusted certificate passing `-allowUntrusted` to `/usr/sbin/installer`.
+
+This option is not permitted in official Homebrew Cask taps, it is only provided for use in third-party taps or local Casks.
+
+Example ([alinof-timer.rb](https://github.com/Homebrew/homebrew-cask/blob/312ae841f1f1b2ec07f4d88b7dfdd7fbdf8d4f94/Casks/alinof-timer.rb#L10)):
+
+```ruby
+pkg "AlinofTimer.pkg", allow_untrusted: true
+```
+
+#### `pkg choices:`
+
+`pkg choices:` can be used to override `.pkg`’s default install options via `-applyChoiceChangesXML`. It uses a deserialized version of the `choiceChanges` property list (refer to the `CHOICE CHANGES FILE` section of the `installer` manual page by running `man -P 'less --pattern "^CHOICE CHANGES FILE"' installer`).
+
+Running the macOS command:
+
+```bash
+$ installer -showChoicesXML -pkg '/path/to/my.pkg'
+```
+
+will output an XML which you can use to extract the `choices:` values, as well as their equivalents to the GUI options.
+
+See [this pull request for wireshark-chmodbpf](https://github.com/Homebrew/homebrew-cask/pull/26997) and [this one for wine-staging](https://github.com/Homebrew/homebrew-cask/pull/27937) for some examples of the procedure.
+
+Example ([wireshark-chmodbpf.rb](https://github.com/Homebrew/homebrew-cask/blob/f95b8a8306b91fe9da7908b842f4a5fa80f7afe0/Casks/wireshark-chmodbpf.rb#L9-L26)):
+```ruby
+pkg "Wireshark #{version} Intel 64.pkg",
+ choices: [
+ {
+ "choiceIdentifier" => "wireshark",
+ "choiceAttribute" => "selected",
+ "attributeSetting" => 0,
+ },
+ {
+ "choiceIdentifier" => "chmodbpf",
+ "choiceAttribute" => "selected",
+ "attributeSetting" => 1,
+ },
+ {
+ "choiceIdentifier" => "cli",
+ "choiceAttribute" => "selected",
+ "attributeSetting" => 0,
+ },
+ ]
+```
+
+Example ([wine-staging.rb](https://github.com/Homebrew/homebrew-cask/blob/51b65f6a5a25a7f79af4d372e1a0bf1dc3849251/Casks/wine-staging.rb#L11-L18)):
+```ruby
+pkg "winehq-staging-#{version}.pkg",
+ choices: [
+ {
+ "choiceIdentifier" => "choice3",
+ "choiceAttribute" => "selected",
+ "attributeSetting" => 1,
+ },
+ ]
+```
+
+### Stanza: `sha256`
+
+#### Calculating the SHA256
+
+The `sha256` value is usually calculated by the command:
+
+```bash
+$ shasum --algorithm 256 <file>
+```
+
+#### Special Value `:no_check`
+
+The special value `sha256 :no_check` is used to turn off SHA checking whenever checksumming is impractical due to the upstream configuration.
+
+`version :latest` requires `sha256 :no_check`, and this pairing is common. However, `sha256 :no_check` does not require `version :latest`.
+
+We use a checksum whenever possible.
+
+### Stanza: `suite`
+
+Some distributions provide a suite of multiple applications, or an application with required data, to be installed together in a subdirectory of `/Applications`.
+
+For these Casks, use the `suite` stanza to define the directory containing the application suite. Example (from [sketchup.rb](https://github.com/Homebrew/homebrew-cask/blob/312ae841f1f1b2ec07f4d88b7dfdd7fbdf8d4f94/Casks/sketchup.rb#L12)):
+
+```ruby
+suite "SketchUp 2016"
+```
+
+The value of `suite` is never an `.app` bundle, but a plain directory.
+
+### Stanza: `uninstall`
+
+> If you cannot design a working `uninstall` stanza, please submit your cask anyway. The maintainers can help you write an `uninstall` stanza, just ask!
+
+#### `uninstall pkgutil:` Is The Easiest and Most Useful
+
+`pkgutil:` is the easiest and most useful `uninstall` directive. See [Uninstall Key pkgutil:](#uninstall-key-pkgutil).
+
+#### `uninstall` Is Required for Casks That Install a pkg or installer manual:
+
+For most Casks, uninstall actions are determined automatically, and an explicit `uninstall` stanza is not needed. However, a Cask which uses the `pkg` or `installer manual:` stanzas will **not** know how to uninstall correctly unless an `uninstall` stanza is given.
+
+So, while the [Cask DSL](#required-stanzas) does not enforce the requirement, it is much better for end-users if every `pkg` and `installer manual:` has a corresponding `uninstall`.
+
+The `uninstall` stanza is available for non-`pkg` Casks, and is useful for a few corner cases. However, the documentation below concerns the typical case of using `uninstall` to define procedures for a `pkg`.
+
+#### There Are Multiple Uninstall Techniques
+
+Since `pkg` installers can do arbitrary things, different techniques are needed to uninstall in each case. You may need to specify one, or several, of the following key/value pairs as arguments to `uninstall`.
+
+#### Summary of Keys
+
+* `early_script:` (string or hash) - like [`script:`](#uninstall-key-script), but runs early (for special cases, best avoided)
+* [`launchctl:`](#uninstall-key-launchctl) (string or array) - ids of `launchctl` jobs to remove
+* [`quit:`](#uninstall-key-quit) (string or array) - bundle ids of running applications to quit
+* [`signal:`](#uninstall-key-signal) (array of arrays) - signal numbers and bundle ids of running applications to send a Unix signal to (used when `quit:` does not work)
+* [`login_item:`](#uninstall-key-login_item) (string or array) - names of login items to remove
+* [`kext:`](#uninstall-key-kext) (string or array) - bundle ids of kexts to unload from the system
+* [`script:`](#uninstall-key-script) (string or hash) - relative path to an uninstall script to be run via sudo; use hash if args are needed
+ - `executable:` - relative path to an uninstall script to be run via sudo (required for hash form)
+ - `args:` - array of arguments to the uninstall script
+ - `input:` - array of lines of input to be sent to `stdin` of the script
+ - `must_succeed:` - set to `false` if the script is allowed to fail
+ - `sudo:` - set to `true` if the script needs `sudo`
+* [`pkgutil:`](#uninstall-key-pkgutil) (string, regexp or array of strings and regexps) - strings or regexps matching bundle ids of packages to uninstall using `pkgutil`
+* [`delete:`](#uninstall-key-delete) (string or array) - single-quoted, absolute paths of files or directory trees to remove. `delete:` should only be used as a last resort. `pkgutil:` is strongly preferred.
+* `rmdir:` (string or array) - single-quoted, absolute paths of directories to remove if empty. Works recursively.
+* [`trash:`](#uninstall-key-trash) (string or array) - single-quoted, absolute paths of files or directory trees to move to Trash.
+
+Each `uninstall` technique is applied according to the order above. The order in which `uninstall` keys appear in the Cask file is ignored.
+
+For assistance filling in the right values for `uninstall` keys, there are several helper scripts found under `developer/bin` in the Homebrew Cask repository. Each of these scripts responds to the `-help` option with additional documentation.
+
+The easiest way to work out an `uninstall` stanza is on a system where the `pkg` is currently installed and operational. To operate on an uninstalled `pkg` file, see [Working With a pkg File Manually](#working-with-a-pkg-file-manually), below.
+
+#### `uninstall` Key `pkgutil:`
+
+This is the most useful uninstall key. `pkgutil:` is often sufficient to completely uninstall a `pkg`, and is strongly preferred over `delete:`.
+
+IDs for the most recently-installed packages can be listed using the command:
+
+```bash
+$ "$(brew --repository)/Library/Taps/homebrew/homebrew-cask/developer/bin/list_recent_pkg_ids"
+```
+
+`pkgutil:` also accepts a regular expression match against multiple package IDs. The regular expressions are somewhat nonstandard. To test a `pkgutil:` regular expression against currently-installed packages, use the command:
+
+```bash
+$ "$(brew --repository)/Library/Taps/homebrew/homebrew-cask/developer/bin/list_pkg_ids_by_regexp" <regular-expression>
+```
+
+#### List Files Associated With a pkg Id
+
+Once you know the ID for an installed package, (above), you can list all files on your system associated with that package ID using the macOS command:
+
+```bash
+$ pkgutil --files <package.id.goes.here>
+```
+
+Listing the associated files can help you assess whether the package included any `launchctl` jobs or kernel extensions (kexts).
+
+#### `uninstall` Key `launchctl:`
+
+IDs for currently loaded `launchctl` jobs can be listed using the command:
+
+```bash
+$ "$(brew --repository)/Library/Taps/homebrew/homebrew-cask/developer/bin/list_loaded_launchjob_ids"
+```
+
+IDs for all installed `launchctl` jobs can be listed using the command:
+
+```bash
+$ "$(brew --repository)/Library/Taps/homebrew/homebrew-cask/developer/bin/list_installed_launchjob_ids"
+```
+
+#### `uninstall` Key `quit:`
+
+Bundle IDs for currently running Applications can be listed using the command:
+
+```bash
+$ "$(brew --repository)/Library/Taps/homebrew/homebrew-cask/developer/bin/list_running_app_ids"
+```
+
+Bundle IDs inside an Application bundle on disk can be listed using the command:
+
+```bash
+$ "$(brew --repository)/Library/Taps/homebrew/homebrew-cask/developer/bin/list_ids_in_app" '/path/to/application.app'
+```
+
+#### `uninstall` Key `signal:`
+
+`signal:` should only be needed in the rare case that a process does not respond to `quit:`.
+
+Bundle IDs for `signal:` targets may be obtained as for `quit:`. The value for `signal:` is an array-of-arrays, with each cell containing two elements: the desired Unix signal followed by the corresponding bundle ID.
+
+The Unix signal may be given in numeric or string form (see the `kill` man page for more details).
+
+The elements of the `signal:` array are applied in order, only if there is an existing process associated the bundle ID, and stopping when that process terminates. A bundle ID may be repeated to send more than one signal to the same process.
+
+It is better to use the least-severe signals which are sufficient to stop a process. The `KILL` signal in particular can have unwanted side-effects.
+
+An example, with commonly-used signals in ascending order of severity:
+
+```ruby
+ uninstall signal: [
+ ["TERM", "fr.madrau.switchresx.daemon"],
+ ["QUIT", "fr.madrau.switchresx.daemon"],
+ ["INT", "fr.madrau.switchresx.daemon"],
+ ["HUP", "fr.madrau.switchresx.daemon"],
+ ["KILL", "fr.madrau.switchresx.daemon"],
+ ]
+```
+
+Note that when multiple running processes match the given Bundle ID, all matching processes will be signaled.
+
+Unlike `quit:` directives, Unix signals originate from the current user, not from the superuser. This is construed as a safety feature, since the superuser is capable of bringing down the system via signals. However, this inconsistency may also be considered a bug, and should be addressed in some fashion in a future version.
+
+## `uninstall` key `login_item:`
+
+Login items associated with an Application bundle on disk can be listed using the command:
+
+```bash
+$ "$(brew --repository)/Library/Taps/homebrew/homebrew-cask/developer/bin/list_login_items_for_app" '/path/to/application.app'
+```
+
+Note that you will likely need to have opened the app at least once for any login items to be present.
+
+#### `uninstall` Key `kext:`
+
+IDs for currently loaded kernel extensions can be listed using the command:
+
+```bash
+$ "$(brew --repository)/Library/Taps/homebrew/homebrew-cask/developer/bin/list_loaded_kext_ids"
+```
+
+IDs inside a kext bundle you have located on disk can be listed using the command:
+
+```bash
+$ "$(brew --repository)/Library/Taps/homebrew/homebrew-cask/developer/bin/list_id_in_kext" '/path/to/name.kext'
+```
+
+#### `uninstall` Key `script:`
+
+`uninstall script:` introduces a series of key-value pairs describing a command which will automate completion of the uninstall. Example (from [gpgtools.rb](https://github.com/Homebrew/homebrew-cask/blob/4a0a49d1210a8202cbdd54bce2986f15049b8b61/Casks/gpgtools.rb#L33-#L37)):
+
+```ruby
+ uninstall script: {
+ executable: "#{staged_path}/Uninstall.app/Contents/Resources/GPG Suite Uninstaller.app/Contents/Resources/uninstall.sh",
+ sudo: true,
+ }
+```
+
+It is important to note that, although `script:` in the above example does attempt to completely uninstall the `pkg`, it should not be used in detriment of [`pkgutil:`](#uninstall-key-pkgutil), but as a complement when possible.
+
+#### `uninstall` Key `delete:`
+
+`delete:` should only be used as a last resort, if other `uninstall` methods are insufficient.
+
+Arguments to `uninstall delete:` should use the following basic rules:
+
+* Basic tilde expansion is performed on paths, i.e. leading `~` is expanded to the home directory.
+* Paths must be absolute.
+* Glob expansion is performed using the [standard set of characters](https://en.wikipedia.org/wiki/Glob_(programming)).
+
+To remove user-specific files, use the [`zap` stanza](#stanza-zap).
+
+#### `uninstall` Key `trash:`
+
+`trash:` arguments follow the same rules listed above for `delete:`.
+
+#### Working With a pkg File Manually
+
+Advanced users may wish to work with a `pkg` file manually, without having the package installed.
+
+A list of files which may be installed from a `pkg` can be extracted using the command:
+
+```bash
+$ "$(brew --repository)/Library/Taps/homebrew/homebrew-cask/developer/bin/list_payload_in_pkg" '/path/to/my.pkg'
+```
+
+Candidate application names helpful for determining the name of a Cask may be extracted from a `pkg` file using the command:
+
+```bash
+$ "$(brew --repository)/Library/Taps/homebrew/homebrew-cask/developer/bin/list_apps_in_pkg" '/path/to/my.pkg'
+```
+
+Candidate package IDs which may be useful in a `pkgutil:` key may be extracted from a `pkg` file using the command:
+
+```bash
+$ "$(brew --repository)/Library/Taps/homebrew/homebrew-cask/developer/bin/list_ids_in_pkg" '/path/to/my.pkg'
+```
+
+A fully manual method for finding bundle ids in a package file follows:
+
+1. Unpack `/path/to/my.pkg` (replace with your package name) with `pkgutil --expand /path/to/my.pkg /tmp/expanded.unpkg`.
+2. The unpacked package is a folder. Bundle ids are contained within files named `PackageInfo`. These files can be found with the command `find /tmp/expanded.unpkg -name PackageInfo`.
+3. `PackageInfo` files are XML files, and bundle ids are found within the `identifier` attributes of `<pkg-info>` tags that look like `<pkg-info ... identifier="com.oracle.jdk7u51" ... >`, where extraneous attributes have been snipped out and replaced with ellipses.
+4. Kexts inside packages are also described in `PackageInfo` files. If any kernel extensions are present, the command `find /tmp/expanded.unpkg -name PackageInfo -print0 | xargs -0 grep -i kext` should return a `<bundle id>` tag with a `path` attribute that contains a `.kext` extension, for example `<bundle id="com.wavtap.driver.WavTap" ... path="./WavTap.kext" ... />`.
+5. Once bundle ids have been identified, the unpacked package directory can be deleted.
+
+### Stanza: `url`
+
+#### HTTPS URLs are Preferred
+
+If available, an HTTPS URL is preferred. A plain HTTP URL should only be used in the absence of a secure alternative.
+
+#### Additional HTTP/S URL Parameters
+
+When a plain URL string is insufficient to fetch a file, additional information may be provided to the `curl`-based downloader, in the form of key/value pairs appended to `url`:
+
+| key | value |
+| ------------------ | ----------- |
+| `verified:` | a string repeating the beginning of `url`, for verification purposes. [See below](#when-url-and-homepage-hostnames-differ-add-verified).
+| `using:` | the symbol `:post` is the only legal value
+| `cookies:` | a hash of cookies to be set in the download request
+| `referer:` | a string holding the URL to set as referer in the download request
+| `header:` | a string holding the header to set for the download request.
+| `user_agent:` | a string holding the user agent to set for the download request. Can also be set to the symbol `:fake`, which will use a generic Browser-like user agent string. We prefer `:fake` when the server does not require a specific user agent.
+| `data:` | a hash of parameters to be set in the POST request
+
+Example of using `cookies:`: [java.rb](https://github.com/Homebrew/homebrew-cask/blob/472930df191d66747a57d5c96c0d00511d56e21b/Casks/java.rb#L5-L8)
+
+Example of using `referer:`: [rrootage.rb](https://github.com/Homebrew/homebrew-cask/blob/312ae841f1f1b2ec07f4d88b7dfdd7fbdf8d4f94/Casks/rrootage.rb#L5)
+
+Example of using `header:`: [issue-325182724](https://github.com/Homebrew/brew/pull/6545#issue-325182724)
+
+#### When URL and Homepage Hostnames Differ, Add `verified:`
+
+When the hostnames of `url` and `homepage` differ, the discrepancy should be documented with the `verified:` parameter, repeating the smallest possible portion of the URL that uniquely identifies the app or vendor, excluding the protocol. Example: [`shotcut.rb`](https://github.com/Homebrew/homebrew-cask/blob/08733296b49c59c58b6beeada59ed4207cef60c3/Casks/shotcut.rb#L5L6).
+
+This must be added so a user auditing the cask knows the URL was verified by the Homebrew Cask team as the one provided by the vendor, even though it may look unofficial. It is our responsibility as Homebrew Cask maintainers to verify both the `url` and `homepage` information when first added (or subsequently modified, apart from versioning).
+
+The parameter doesn’t mean you should trust the source blindly, but we only approve casks in which users can easily verify its authenticity with basic means, such as checking the official homepage or public repository. Occasionally, slightly more elaborate techniques may be used, such as inspecting an [`appcast`](#stanza-appcast) we established as official. Cases where such quick verifications aren’t possible (e.g. when the download URL is behind a registration wall) are [treated in a stricter manner](https://github.com/Homebrew/homebrew-cask/blob/HEAD/doc/development/adding_a_cask.md#unofficial-vendorless-and-walled-builds).
+
+#### Difficulty Finding a URL
+
+Web browsers may obscure the direct `url` download location for a variety of reasons. Homebrew Cask supplies a script which can read extended file attributes to extract the actual source URL for most files downloaded by a browser on macOS. The script usually emits multiple candidate URLs; you may have to test each of them:
+
+```bash
+$ $(brew --repository)/Library/Taps/homebrew/homebrew-cask/developer/bin/list_url_attributes_on_file <file>
+```
+
+#### Subversion URLs
+
+In rare cases, a distribution may not be available over ordinary HTTP/S. Subversion URLs are also supported, and can be specified by appending the following key/value pairs to `url`:
+
+| key | value |
+| ------------------ | ----------- |
+| `using:` | the symbol `:svn` is the only legal value
+| `revision:` | a string identifying the subversion revision to download
+| `trust_cert:` | set to `true` to automatically trust the certificate presented by the server (avoiding an interactive prompt)
+
+#### SourceForge/OSDN URLs
+
+SourceForge and OSDN (formerly `SourceForge.JP`) projects are common ways to distribute binaries, but they provide many different styles of URLs to get to the goods.
+
+We prefer URLs of this format:
+
+```
+https://downloads.sourceforge.net/{{project_name}}/{{filename}}.{{ext}}
+```
+
+Or, if it’s from [OSDN](https://osdn.jp/):
+
+```
+http://{{subdomain}}.osdn.jp/{{project_name}}/{{release_id}}/{{filename}}.{{ext}}
+```
+
+`{{subdomain}}` is typically of the form `dl` or `{{user}}.dl`.
+
+If these formats are not available, and the application is macOS-exclusive (otherwise a command-line download defaults to the Windows version) we prefer the use of this format:
+
+```
+https://sourceforge.net/projects/{{project_name}}/files/latest/download
+```
+
+#### Some Providers Block Command-line Downloads
+
+Some hosting providers actively block command-line HTTP clients. Such URLs cannot be used in Casks.
+
+Other providers may use URLs that change periodically, or even on each visit (example: FossHub). While some cases [could be circumvented](#using-a-block-to-defer-code-execution), they tend to occur when the vendor is actively trying to prevent automated downloads, so we prefer to not add those casks to the main repository.
+
+#### Using a Block to Defer Code Execution
+
+Some casks—notably nightlies—have versioned download URLs but are updated so often that they become impractical to keep current with the usual process. For those, we want to dynamically determine `url`.
+
+##### The Problem
+
+In theory, one can write arbitrary Ruby code right in the Cask definition to fetch and construct a disposable URL.
+
+However, this typically involves an HTTP round trip to a landing site, which may take a long time. Because of the way Homebrew Cask loads and parses Casks, it is not acceptable that such expensive operations be performed directly in the body of a Cask definition.
+
+##### Writing the Block
+
+Similar to the `preflight`, `postflight`, `uninstall_preflight`, and `uninstall_postflight` blocks, the `url` stanza offers an optional _block syntax_:
+
+```rb
+url "https://handbrake.fr/nightly.php" do |page|
+ file_path = page[/href=["']?([^"' >]*Handbrake[._-][^"' >]+\.dmg)["' >]/i, 1]
+ file_path ? URI.join(page.url, file_path) : nil
+end
+```
+
+You can also nest `url do` blocks inside `url do` blocks to follow a chain of URLs.
+
+The block is only evaluated when needed, for example on download time or when auditing a Cask. Inside a block, you may safely do things such as HTTP/S requests that may take a long time to execute. You may also refer to the `@cask` instance variable, and invoke any method available on `@cask`.
+
+The block will be called immediately before downloading; its result value will be assumed to be a `String` (or a pair of a `String` and `Hash` containing parameters) and subsequently used as a download URL.
+
+You can use the `url` stanza with either a direct argument or a block but not with both.
+
+Example for using the block syntax: [vlc-nightly.rb](https://github.com/Homebrew/homebrew-cask-versions/blob/2bf0f13dd49d263ebec0ca56e58ad8458633f789/Casks/vlc-nightly.rb#L5L10)
+
+##### Mixing Additional URL Parameters With the Block Syntax
+
+In rare cases, you might need to set URL parameters like `cookies` or `referer` while also using the block syntax.
+
+This is possible by returning a two-element array as a block result. The first element of the array must be the download URL; the second element must be a `Hash` containing the parameters.
+
+### Stanza: `version`
+
+`version`, while related to the app’s own versioning, doesn’t have to follow it exactly. It is common to change it slightly so it can be [interpolated](https://en.wikipedia.org/wiki/String_interpolation#Ruby_/_Crystal) in other stanzas, usually in `url` to create a Cask that only needs `version` and `sha256` changes when updated. This can be taken further, when needed, with [ruby String methods](https://ruby-doc.org/core/String.html).
+
+For example:
+
+Instead of
+
+```ruby
+version "1.2.3"
+url "https://example.com/file-version-123.dmg"
+```
+
+We can use
+
+```ruby
+version "1.2.3"
+url "https://example.com/file-version-#{version.delete('.')}.dmg"
+```
+
+We can also leverage the power of regular expressions. So instead of
+
+```ruby
+version "1.2.3build4"
+url "https://example.com/1.2.3/file-version-1.2.3build4.dmg"
+```
+
+We can use
+
+```ruby
+version "1.2.3build4"
+url "https://example.com/#{version.sub(%r{build\d+}, '')}/file-version-#{version}.dmg"
+```
+
+#### version :latest
+
+The special value `:latest` is used on casks which:
+
+1. `url` doesn’t contain a version.
+2. Having a correct value to `version` is too difficult or impractical, even with our automated systems.
+
+Example: [spotify.rb](https://github.com/Homebrew/homebrew-cask/blob/f56e8ba057687690e26a6502623aa9476ff4ac0e/Casks/spotify.rb#L2)
+
+#### version methods
+
+The examples above can become hard to read, however. Since many of these changes are common, we provide a number of helpers to clearly interpret otherwise obtuse cases:
+
+| Method | Input | Output |
+|--------------------------|--------------------|--------------------|
+| `major` | `1.2.3-a45,ccdd88` | `1` |
+| `minor` | `1.2.3-a45,ccdd88` | `2` |
+| `patch` | `1.2.3-a45,ccdd88` | `3-a45` |
+| `major_minor` | `1.2.3-a45,ccdd88` | `1.2` |
+| `major_minor_patch` | `1.2.3-a45,ccdd88` | `1.2.3-a45` |
+| `minor_patch` | `1.2.3-a45,ccdd88` | `2.3-a45` |
+| `before_comma` | `1.2.3-a45,ccdd88` | `1.2.3-a45` |
+| `after_comma` | `1.2.3-a45,ccdd88` | `ccdd88` |
+| `dots_to_hyphens` | `1.2.3-a45,ccdd88` | `1-2-3-a45,ccdd88` |
+| `no_dots` | `1.2.3-a45,ccdd88` | `123-a45,ccdd88` |
+
+Similar to `dots_to_hyphens`, we provide all logical permutations of `{dots,hyphens,underscores}_to_{dots,hyphens,underscores}`. The same applies to `no_dots` in the form of `no_{dots,hyphens,underscores}`, with an extra `no_dividers` that applies all of those at once.
+
+Finally, there are `before_colon` and `after_colon` that act like their `comma` counterparts. These four are extra special to allow for otherwise complex cases, and should be used sparingly. There should be no more than one of `,` and `:` per `version`. Use `,` first, and `:` only if absolutely necessary.
+
+### Stanza: `zap`
+
+#### `zap` Stanza Purpose
+
+The `zap` stanza describes a more complete uninstallation of files associated with a Cask. The `zap` procedures will never be performed by default, but only if the user uses `--zap` on `uninstall`:
+
+```bash
+$ brew uninstall --zap firefox
+```
+
+`zap` stanzas may remove:
+
+* Preference files and caches stored within the user’s `~/Library` directory.
+* Shared resources such as application updaters. Since shared resources may be removed, other applications may be affected by `brew uninstall --zap`. Understanding that is the responsibility of the end user.
+
+`zap` stanzas should not remove:
+
+* Files created by the user directly.
+
+Appending `--force` to the command will allow you to perform these actions even if the Cask is no longer installed:
+
+```bash
+brew uninstall --zap --force firefox
+```
+
+#### `zap` Stanza Syntax
+
+The form of `zap` stanza follows the [`uninstall` stanza](#stanza-uninstall). All of the same directives are available. The `trash:` key is preferred over `delete:`.
+
+Example: [dropbox.rb](https://github.com/Homebrew/homebrew-cask/blob/31cd96cc0e00dab1bff74d622e32d816bafd1f6f/Casks/dropbox.rb#L17-L35)
+
+#### `zap` Creation
+
+The simplest method is to use [@nrlquaker's CreateZap](https://github.com/nrlquaker/homebrew-createzap), which can automatically generate the stanza. In a few instances it may fail to pick up anything and manual creation may be required.
+
+Manual creation can be facilitated with:
+
+* Some of the developer tools are already available in Homebrew Cask.
+* `sudo find / -iname "*<search item>*"`
+* An uninstaller tool such as [AppCleaner](https://github.com/Homebrew/homebrew-cask/blob/HEAD/Casks/appcleaner.rb).
+* Inspecting the usual suspects, i.e. `/Library/{'Application Support',LaunchAgents,LaunchDaemons,Frameworks,Logs,Preferences,PrivilegedHelperTools}` and `~/Library/{'Application Support',Caches,Containers,LaunchAgents,Logs,Preferences,'Saved Application State'}`.
+
+
+
+---
+
+## Token reference
+
+This section describes the algorithm implemented in the `generate_cask_token` script, and covers detailed rules and exceptions which are not needed in most cases.
+
+* [Purpose](#purpose)
+* [Finding the Simplified Name of the Vendor’s Distribution](#finding-the-simplified-name-of-the-vendors-distribution)
+* [Converting the Simplified Name To a Token](#converting-the-simplified-name-to-a-token)
+* [Cask Filenames](#cask-filenames)
+* [Cask Headers](#cask-headers)
+* [Cask Token Examples](#cask-token-examples)
+* [Tap Specific Cask Token Examples](#tap-specific-cask-token-examples)
+* [Token Overlap](#token-overlap)
+
+## Purpose
+
+Software vendors are often inconsistent with their naming. By enforcing strict naming conventions we aim to:
+
+* Prevent duplicate submissions
+* Minimize renaming events
+* Unambiguously boil down the name of the software into a unique identifier
+
+Details of software names and brands will inevitably be lost in the conversion to a minimal token. To capture the vendor’s full name for a distribution, use the [`name`](#stanza-name) within a Cask. `name` accepts an unrestricted UTF-8 string.
+
+## Finding the Simplified Name of the Vendor’s Distribution
+
+### Simplified Names of Apps
+
+* Start with the exact name of the Application bundle as it appears on disk, such as `Google Chrome.app`.
+
+* If the name uses letters outside A-Z, convert it to ASCII as described in [Converting to ASCII](#converting-to-ascii).
+
+* Remove `.app` from the end.
+
+* Remove from the end: the string “app”, if the vendor styles the name like “Software App.app”. Exception: when “app” is an inseparable part of the name, without which the name would be inherently nonsensical, as in [whatsapp.rb](https://github.com/Homebrew/homebrew-cask/blob/HEAD/Casks/whatsapp.rb).
+
+* Remove from the end: version numbers or incremental release designations such as “alpha”, “beta”, or “release candidate”. Strings which distinguish different capabilities or codebases such as “Community Edition” are currently accepted. Exception: when a number is not an incremental release counter, but a differentiator for a different product from a different vendor, as in [kdiff3.rb](https://github.com/Homebrew/homebrew-cask/blob/HEAD/Casks/kdiff3.rb).
+
+* If the version number is arranged to occur in the middle of the App name, it should also be removed.
+
+* Remove from the end: “Launcher”, “Quick Launcher”.
+
+* Remove from the end: strings such as “Desktop”, “for Desktop”.
+
+* Remove from the end: strings such as “Mac”, “for Mac”, “for OS X”, “macOS”, “for macOS”. These terms are generally added to ported software such as “MAME OS X.app”. Exception: when the software is not a port, and “Mac” is an inseparable part of the name, without which the name would be inherently nonsensical, as in [PlayOnMac.app](https://github.com/Homebrew/homebrew-cask/blob/HEAD/Casks/playonmac.rb).
+
+* Remove from the end: hardware designations such as “for x86”, “32-bit”, “ppc”.
+
+* Remove from the end: software framework names such as “Cocoa”, “Qt”, “Gtk”, “Wx”, “Java”, “Oracle JVM”, etc. Exception: the framework is the product being Casked.
+
+* Remove from the end: localization strings such as “en-US”.
+
+* If the result of that process is a generic term, such as “Macintosh Installer”, try prepending the name of the vendor or developer, followed by a hyphen. If that doesn’t work, then just create the best name you can, based on the vendor’s web page.
+
+* If the result conflicts with the name of an existing Cask, make yours unique by prepending the name of the vendor or developer, followed by a hyphen. Example: [unison.rb](https://github.com/Homebrew/homebrew-cask/blob/HEAD/Casks/unison.rb) and [panic-unison.rb](https://github.com/Homebrew/homebrew-cask/blob/HEAD/Casks/panic-unison.rb).
+
+* Inevitably, there are a small number of exceptions not covered by the rules. Don’t hesitate to [use the forum](https://github.com/Homebrew/discussions/discussions) if you have a problem.
+
+### Converting to ASCII
+
+* If the vendor provides an English localization string, that is preferred. Here are the places it may be found, in order of preference:
+
+ - `CFBundleDisplayName` in the main `Info.plist` file of the app bundle
+ - `CFBundleName` in the main `Info.plist` file of the app bundle
+ - `CFBundleDisplayName` in `InfoPlist.strings` of an `en.lproj` localization directory
+ - `CFBundleName` in `InfoPlist.strings` of an `en.lproj` localization directory
+ - `CFBundleDisplayName` in `InfoPlist.strings` of an `English.lproj` localization directory
+ - `CFBundleName` in `InfoPlist.strings` of an `English.lproj` localization directory
+
+* When there is no vendor localization string, romanize the name by transliteration or decomposition.
+
+* As a last resort, translate the name of the app bundle into English.
+
+### Simplified Names of `pkg`-based Installers
+
+* The Simplified Name of a `pkg` may be more tricky to determine than that of an App. If a `pkg` installs an App, then use that App name with the rules above. If not, just create the best name you can, based on the vendor’s web page.
+
+### Simplified Names of non-App Software
+
+* Currently, rules for generating a token are not well-defined for Preference Panes, QuickLook plugins, and several other types of software installable by Homebrew Cask. Just create the best name you can, based on the filename on disk or the vendor’s web page. Watch out for duplicates.
+
+ Non-app tokens should become more standardized in the future.
+
+## Converting the Simplified Name To a Token
+
+The token is the primary identifier for a package in our project. It’s the unique string users refer to when operating on the Cask.
+
+To convert the App’s Simplified Name (above) to a token:
+
+* Convert all letters to lower case.
+* Expand the `+` symbol into a separated English word: `-plus-`.
+* Expand the `@` symbol into a separated English word: `-at-`.
+* Spaces become hyphens.
+* Underscores become hyphens.
+* Middots/Interpuncts become hyphens.
+* Hyphens stay hyphens.
+* Digits stay digits.
+* Delete any character which is not alphanumeric or a hyphen.
+* Collapse a series of multiple hyphens into one hyphen.
+* Delete a leading or trailing hyphen.
+
+## Cask Filenames
+
+Casks are stored in a Ruby file named after the token, with the file extension `.rb`.
+
+## Cask Headers
+
+The token is also given in the header line for each Cask.
+
+## Cask Token Examples
+
+These illustrate most of the rules for generating a token:
+
+App Name on Disk | Simplified App Name | Cask Token | Filename
+-----------------------|---------------------|------------------|----------------------
+`Audio Hijack Pro.app` | Audio Hijack Pro | audio-hijack-pro | `audio-hijack-pro.rb`
+`VLC.app` | VLC | vlc | `vlc.rb`
+`BetterTouchTool.app` | BetterTouchTool | bettertouchtool | `bettertouchtool.rb`
+`LPK25 Editor.app` | LPK25 Editor | lpk25-editor | `lpk25-editor.rb`
+`Sublime Text 2.app` | Sublime Text | sublime-text | `sublime-text.rb`
+
+## Tap Specific Cask Token Examples
+
+Cask taps have naming conventions specific to each tap.
+
+[Homebrew/cask-versions](https://github.com/Homebrew/homebrew-cask-versions/blob/HEAD/CONTRIBUTING.md#naming-versions-casks)
+
+[Homebrew/cask-fonts](https://github.com/Homebrew/homebrew-cask-fonts/blob/HEAD/CONTRIBUTING.md#naming-font-casks)
+
+[Homebrew/cask-drivers](https://github.com/Homebrew/homebrew-cask-drivers/blob/HEAD/CONTRIBUTING.md#naming-driver-casks)
+
+# Special Affixes
+
+A few situations require a prefix or suffix to be added to the token.
+
+## Token Overlap
+
+When the token for a new Cask would otherwise conflict with the token of an already existing Cask, the nature of that overlap dictates the token (for possibly both Casks). See [Forks and Apps with Conflicting Names](Acceptable-Casks.md#forks-and-apps-with-conflicting-names) for information on how to proceed.
+
+## Potentially Misleading Name
+
+If the token for a piece of unofficial software that interacts with a popular service would make it look official and the vendor is not authorised to use the name, [a prefix must be added](Acceptable-Casks.md#forks-and-apps-with-conflicting-names) for disambiguation.
+
+In cases where the prefix is ambiguous and would make the app appear official, the `-unofficial` suffix may be used.
+ | true |
Other | Homebrew | brew | 390d1085553b2b7d909f7cfbbfb28a5950832fff.json | docs: add Cask Cookbook | docs/README.md | @@ -37,6 +37,7 @@
- [How To Open A Pull Request (and get it merged)](How-To-Open-a-Homebrew-Pull-Request.md)
- [Formula Cookbook](Formula-Cookbook.md)
+- [Cask Cookbook](Cask-Cookbook.md)
- [Acceptable Formulae](Acceptable-Formulae.md)
- [Acceptable Casks](Acceptable-Casks.md)
- [License Guidelines](License-Guidelines.md) | true |
Other | Homebrew | brew | 1c7fe799680b82350759559bab3a1e8735811ee9.json | dev-cmd/pr-upload: fix bad args reference.
Currently breaking CI. | Library/Homebrew/dev-cmd/pr-upload.rb | @@ -94,7 +94,7 @@ def bottles_hash_from_json_files(root_url)
if root_url
bottles_hash.each_value do |bottle_hash|
- bottle_hash["bottle"]["root_url"] = args.root_url
+ bottle_hash["bottle"]["root_url"] = root_url
end
end
| false |
Other | Homebrew | brew | f04b2ef789998a323715bc0890cfbcbb3e19344e.json | Update RBI files for tapioca. | Library/Homebrew/sorbet/rbi/gems/commander@4.5.2.rbi | @@ -1,7 +0,0 @@
-# DO NOT EDIT MANUALLY
-# This is an autogenerated file for types exported from the `commander` gem.
-# Please instead update this file by running `tapioca generate --exclude json`.
-
-# typed: true
-
- | true |
Other | Homebrew | brew | f04b2ef789998a323715bc0890cfbcbb3e19344e.json | Update RBI files for tapioca. | Library/Homebrew/sorbet/rbi/gems/commander@4.6.0.rbi | @@ -0,0 +1,8 @@
+# DO NOT EDIT MANUALLY
+# This is an autogenerated file for types exported from the `commander` gem.
+# Please instead update this file by running `bin/tapioca sync`.
+
+# typed: true
+
+# THIS IS AN EMPTY RBI FILE.
+# see https://github.com/Shopify/tapioca/blob/master/README.md#manual-gem-requires | true |
Other | Homebrew | brew | f04b2ef789998a323715bc0890cfbcbb3e19344e.json | Update RBI files for tapioca. | Library/Homebrew/sorbet/rbi/gems/pry@0.14.1.rbi | @@ -1,6 +1,6 @@
# DO NOT EDIT MANUALLY
# This is an autogenerated file for types exported from the `pry` gem.
-# Please instead update this file by running `tapioca sync`.
+# Please instead update this file by running `bin/tapioca sync`.
# typed: true
| true |
Other | Homebrew | brew | f04b2ef789998a323715bc0890cfbcbb3e19344e.json | Update RBI files for tapioca. | Library/Homebrew/sorbet/rbi/gems/tapioca@0.4.21.rbi | @@ -521,8 +521,8 @@ class Tapioca::Generator < ::Thor::Shell::Color
def move(old_filename, new_filename); end
sig { void }
def perform_additions; end
- sig { params(dir: Pathname, constant_lookup: T::Hash[String, String]).void }
- def perform_dsl_verification(dir, constant_lookup); end
+ sig { params(dir: Pathname).void }
+ def perform_dsl_verification(dir); end
sig { void }
def perform_removals; end
sig { params(files: T::Set[Pathname]).void }
@@ -561,7 +561,7 @@ module Tapioca::GenericTypeRegistry
sig { params(constant: Module, name: String).returns(Module) }
def create_generic_type(constant, name); end
sig { params(constant: Class).returns(Class) }
- def create_sealed_safe_subclass(constant); end
+ def create_safe_subclass(constant); end
sig { params(constant: Module).returns(T::Hash[Integer, String]) }
def lookup_or_initialize_type_variables(constant); end
sig { params(constant: Module).returns(T.nilable(String)) } | true |
Other | Homebrew | brew | 57c4ef7d537a26a58dad06634b4bed32ca58f3d9.json | Update RBI files for rubocop-performance. | Library/Homebrew/sorbet/rbi/gems/rubocop-performance@1.11.0.rbi | @@ -1,6 +1,6 @@
# DO NOT EDIT MANUALLY
# This is an autogenerated file for types exported from the `rubocop-performance` gem.
-# Please instead update this file by running `tapioca sync`.
+# Please instead update this file by running `bin/tapioca sync`.
# typed: true
@@ -430,6 +430,19 @@ RuboCop::Cop::Performance::IoReadlines::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Performance::IoReadlines::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
+class RuboCop::Cop::Performance::MapCompact < ::RuboCop::Cop::Base
+ include(::RuboCop::Cop::RangeHelp)
+ extend(::RuboCop::Cop::AutoCorrector)
+ extend(::RuboCop::Cop::TargetRubyVersion)
+
+ def map_compact(param0 = T.unsafe(nil)); end
+ def on_send(node); end
+end
+
+RuboCop::Cop::Performance::MapCompact::MSG = T.let(T.unsafe(nil), String)
+
+RuboCop::Cop::Performance::MapCompact::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
+
class RuboCop::Cop::Performance::MethodObjectAsBlock < ::RuboCop::Cop::Base
def method_object_as_argument?(param0 = T.unsafe(nil)); end
def on_block_pass(node); end
@@ -701,6 +714,23 @@ RuboCop::Cop::Performance::ReverseFirst::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Performance::ReverseFirst::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
+class RuboCop::Cop::Performance::SelectMap < ::RuboCop::Cop::Base
+ include(::RuboCop::Cop::RangeHelp)
+ extend(::RuboCop::Cop::TargetRubyVersion)
+
+ def bad_method?(param0 = T.unsafe(nil)); end
+ def on_send(node); end
+
+ private
+
+ def map_method_candidate(node); end
+ def offense_range(node, map_method); end
+end
+
+RuboCop::Cop::Performance::SelectMap::MSG = T.let(T.unsafe(nil), String)
+
+RuboCop::Cop::Performance::SelectMap::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
+
class RuboCop::Cop::Performance::Size < ::RuboCop::Cop::Base
extend(::RuboCop::Cop::AutoCorrector)
| false |
Other | Homebrew | brew | d5a09933805594f86d3a89e6a66fa8883541ebc1.json | Update RBI files for bootsnap. | Library/Homebrew/sorbet/rbi/gems/bootsnap@1.7.4.rbi | @@ -1,6 +1,6 @@
# DO NOT EDIT MANUALLY
# This is an autogenerated file for types exported from the `bootsnap` gem.
-# Please instead update this file by running `tapioca sync`.
+# Please instead update this file by running `bin/tapioca sync`.
# typed: true
| false |
Other | Homebrew | brew | 7af68d0f8ed1db23e229933d4cdcdfe1e52c9262.json | Fix shellcheck failures
A new version of `shellcheck` (I think?) brought us so new warnings and
errors.
To fix:
- pass `--source-path` so we don't need to stop `shellcheck` trying to
read sourced files every time
- disable some more warnings/errors we don't care about fixing | Library/Homebrew/brew.sh | @@ -51,10 +51,9 @@ HOMEBREW_CACHE="${HOMEBREW_CACHE:-${HOMEBREW_DEFAULT_CACHE}}"
HOMEBREW_LOGS="${HOMEBREW_LOGS:-${HOMEBREW_DEFAULT_LOGS}}"
HOMEBREW_TEMP="${HOMEBREW_TEMP:-${HOMEBREW_DEFAULT_TEMP}}"
-# Don't need shellcheck to follow these `source`.
# These referenced variables are set by bin/brew
# Don't need to handle a default case.
-# shellcheck disable=SC1090,SC2154,SC2249
+# shellcheck disable=SC2154,SC2249
case "$*" in
--cellar) echo "${HOMEBREW_CELLAR}"; exit 0 ;;
--repository|--repo) echo "${HOMEBREW_REPOSITORY}"; exit 0 ;;
@@ -317,8 +316,6 @@ fi
HOMEBREW_CORE_REPOSITORY="${HOMEBREW_LIBRARY}/Taps/homebrew/homebrew-core"
-# Don't need shellcheck to follow these `source`.
-# shellcheck disable=SC1090
case "$*" in
--version|-v) source "${HOMEBREW_LIBRARY}/Homebrew/cmd/--version.sh"; homebrew-version; exit 0 ;;
esac
@@ -648,8 +645,6 @@ access to all bottles."
EOS
fi
-# Don't need shellcheck to follow this `source`.
-# shellcheck disable=SC1090
source "${HOMEBREW_LIBRARY}/Homebrew/utils/analytics.sh"
setup-analytics
@@ -660,13 +655,11 @@ then
# a Ruby script and avoids hard-to-debug issues if the Bash script is updated
# at the same time as being run.
#
- # Don't need shellcheck to follow this `source`.
+ # Shellcheck can't follow this dynamic `source`.
# shellcheck disable=SC1090
source "${HOMEBREW_BASH_COMMAND}"
{ update-preinstall "$@"; "homebrew-${HOMEBREW_COMMAND}" "$@"; exit $?; }
else
- # Don't need shellcheck to follow this `source`.
- # shellcheck disable=SC1090
source "${HOMEBREW_LIBRARY}/Homebrew/utils/ruby.sh"
setup-ruby-path
| true |
Other | Homebrew | brew | 7af68d0f8ed1db23e229933d4cdcdfe1e52c9262.json | Fix shellcheck failures
A new version of `shellcheck` (I think?) brought us so new warnings and
errors.
To fix:
- pass `--source-path` so we don't need to stop `shellcheck` trying to
read sourced files every time
- disable some more warnings/errors we don't care about fixing | Library/Homebrew/cmd/casks.sh | @@ -3,8 +3,6 @@
#: List all locally installable casks including short names.
#:
-# Don't need shellcheck to follow the `source`.
-# shellcheck disable=SC1090
source "$HOMEBREW_LIBRARY/Homebrew/items.sh"
homebrew-casks() { | true |
Other | Homebrew | brew | 7af68d0f8ed1db23e229933d4cdcdfe1e52c9262.json | Fix shellcheck failures
A new version of `shellcheck` (I think?) brought us so new warnings and
errors.
To fix:
- pass `--source-path` so we don't need to stop `shellcheck` trying to
read sourced files every time
- disable some more warnings/errors we don't care about fixing | Library/Homebrew/cmd/formulae.sh | @@ -3,8 +3,6 @@
#: List all locally installable formulae including short names.
#:
-# Don't need shellcheck to follow the `source`.
-# shellcheck disable=SC1090
source "$HOMEBREW_LIBRARY/Homebrew/items.sh"
homebrew-formulae() { | true |
Other | Homebrew | brew | 7af68d0f8ed1db23e229933d4cdcdfe1e52c9262.json | Fix shellcheck failures
A new version of `shellcheck` (I think?) brought us so new warnings and
errors.
To fix:
- pass `--source-path` so we don't need to stop `shellcheck` trying to
read sourced files every time
- disable some more warnings/errors we don't care about fixing | Library/Homebrew/cmd/update.sh | @@ -9,8 +9,6 @@
#: -d, --debug Display a trace of all shell commands as they are executed.
#: -h, --help Show this message.
-# Don't need shellcheck to follow this `source`.
-# shellcheck disable=SC1090
source "$HOMEBREW_LIBRARY/Homebrew/utils/lock.sh"
# Replaces the function in Library/Homebrew/brew.sh to cache the Git executable to
@@ -522,6 +520,9 @@ EOS
# the refspec ensures that the default upstream branch gets updated
(
UPSTREAM_REPOSITORY_URL="$(git config remote.origin.url)"
+
+ # HOMEBREW_UPDATE_FORCE and HOMEBREW_UPDATE_PREINSTALL aren't modified here so ignore subshell warning.
+ # shellcheck disable=SC2030
if [[ "$UPSTREAM_REPOSITORY_URL" = "https://github.com/"* ]]
then
UPSTREAM_REPOSITORY="${UPSTREAM_REPOSITORY_URL#https://github.com/}"
@@ -542,6 +543,8 @@ EOS
GITHUB_API_ENDPOINT="commits/$UPSTREAM_BRANCH_DIR"
fi
+ # HOMEBREW_CURL is set by brew.sh (and isn't mispelt here)
+ # shellcheck disable=SC2153
UPSTREAM_SHA_HTTP_CODE="$("$HOMEBREW_CURL" \
"${CURL_DISABLE_CURLRC_ARGS[@]}" \
--silent --max-time 3 \
@@ -565,6 +568,9 @@ EOS
fi
fi
+
+ # HOMEBREW_VERBOSE isn't modified here so ignore subshell warning.
+ # shellcheck disable=SC2030
if [[ -n "$HOMEBREW_VERBOSE" ]]
then
echo "Fetching $DIR..."
@@ -636,6 +642,8 @@ EOS
PREFETCH_REVISION="${!PREFETCH_REVISION_VAR}"
POSTFETCH_REVISION="$(git rev-parse -q --verify refs/remotes/origin/"$UPSTREAM_BRANCH")"
+ # HOMEBREW_UPDATE_FORCE and HOMEBREW_VERBOSE weren't modified in subshell.
+ # shellcheck disable=SC2031
if [[ -n "$HOMEBREW_SIMULATE_FROM_CURRENT_BRANCH" ]]
then
simulate_from_current_branch "$DIR" "$TAP_VAR" "$UPSTREAM_BRANCH" "$CURRENT_REVISION"
@@ -653,6 +661,8 @@ EOS
safe_cd "$HOMEBREW_REPOSITORY"
+ # HOMEBREW_UPDATE_PREINSTALL wasn't modified in subshell.
+ # shellcheck disable=SC2031
if [[ -n "$HOMEBREW_UPDATED" ||
-n "$HOMEBREW_UPDATE_FAILED" ||
-n "$HOMEBREW_FAILED_FETCH_DIRS" || | true |
Other | Homebrew | brew | 7af68d0f8ed1db23e229933d4cdcdfe1e52c9262.json | Fix shellcheck failures
A new version of `shellcheck` (I think?) brought us so new warnings and
errors.
To fix:
- pass `--source-path` so we don't need to stop `shellcheck` trying to
read sourced files every time
- disable some more warnings/errors we don't care about fixing | Library/Homebrew/cmd/vendor-install.sh | @@ -3,8 +3,6 @@
#:
#: Install Homebrew's portable Ruby.
-# Don't need shellcheck to follow this `source`.
-# shellcheck disable=SC1090
source "$HOMEBREW_LIBRARY/Homebrew/utils/lock.sh"
VENDOR_DIR="$HOMEBREW_LIBRARY/Homebrew/vendor"
@@ -119,6 +117,8 @@ fetch() {
else
if [[ -f "$temporary_path" ]]
then
+ # HOMEBREW_CURL is set by brew.sh (and isn't mispelt here)
+ # shellcheck disable=SC2153
"$HOMEBREW_CURL" "${curl_args[@]}" -C - "$VENDOR_URL" -o "$temporary_path"
if [[ $? -eq 33 ]]
then | true |
Other | Homebrew | brew | 7af68d0f8ed1db23e229933d4cdcdfe1e52c9262.json | Fix shellcheck failures
A new version of `shellcheck` (I think?) brought us so new warnings and
errors.
To fix:
- pass `--source-path` so we don't need to stop `shellcheck` trying to
read sourced files every time
- disable some more warnings/errors we don't care about fixing | Library/Homebrew/dev-cmd/rubocop.sh | @@ -8,8 +8,6 @@
# HOMEBREW_BREW_FILE is set by extend/ENV/super.rb
# shellcheck disable=SC2154
homebrew-rubocop() {
- # Don't need shellcheck to follow this `source`.
- # shellcheck disable=SC1090
source "${HOMEBREW_LIBRARY}/Homebrew/utils/ruby.sh"
setup-ruby-path
| true |
Other | Homebrew | brew | 7af68d0f8ed1db23e229933d4cdcdfe1e52c9262.json | Fix shellcheck failures
A new version of `shellcheck` (I think?) brought us so new warnings and
errors.
To fix:
- pass `--source-path` so we don't need to stop `shellcheck` trying to
read sourced files every time
- disable some more warnings/errors we don't care about fixing | Library/Homebrew/shims/mac/super/ruby | @@ -2,10 +2,9 @@
# System Ruby's mkmf on Mojave (10.14) and later require SDKROOT set to work correctly.
-# Don't need shellcheck to follow the `source`.
# HOMEBREW_LIBRARY is set by bin/brew
# HOMEBREW_SDKROOT is set by extend/ENV/super.rb
-# shellcheck disable=SC1090,SC2154
+# shellcheck disable=SC2154
source "${HOMEBREW_LIBRARY}/Homebrew/shims/utils.sh"
try_exec_non_system "${SHIM_FILE}" "$@" | true |
Other | Homebrew | brew | 7af68d0f8ed1db23e229933d4cdcdfe1e52c9262.json | Fix shellcheck failures
A new version of `shellcheck` (I think?) brought us so new warnings and
errors.
To fix:
- pass `--source-path` so we don't need to stop `shellcheck` trying to
read sourced files every time
- disable some more warnings/errors we don't care about fixing | Library/Homebrew/shims/scm/git | @@ -15,8 +15,6 @@ then
exit 1
fi
-# Don't need shellcheck to follow the `source`.
-# shellcheck disable=SC1090
source "${HOMEBREW_LIBRARY}/Homebrew/shims/utils.sh"
# shellcheck disable=SC2249 | true |
Other | Homebrew | brew | 7af68d0f8ed1db23e229933d4cdcdfe1e52c9262.json | Fix shellcheck failures
A new version of `shellcheck` (I think?) brought us so new warnings and
errors.
To fix:
- pass `--source-path` so we don't need to stop `shellcheck` trying to
read sourced files every time
- disable some more warnings/errors we don't care about fixing | Library/Homebrew/style.rb | @@ -186,7 +186,7 @@ def run_shellcheck(files, output_type)
end
# TODO: Add `--enable=all` to check for more problems.
- args = ["--shell=bash", "--external-sources", "--", *files]
+ args = ["--shell=bash", "--external-sources", "--source-path=#{HOMEBREW_LIBRARY}", "--", *files]
case output_type
when :print | true |
Other | Homebrew | brew | 7af68d0f8ed1db23e229933d4cdcdfe1e52c9262.json | Fix shellcheck failures
A new version of `shellcheck` (I think?) brought us so new warnings and
errors.
To fix:
- pass `--source-path` so we don't need to stop `shellcheck` trying to
read sourced files every time
- disable some more warnings/errors we don't care about fixing | bin/brew | @@ -121,7 +121,5 @@ then
else
echo "Warning: HOMEBREW_NO_ENV_FILTERING is undocumented, deprecated and will be removed in a future Homebrew release (because it breaks many things)!" >&2
- # Don't need shellcheck to follow this `source`.
- # shellcheck disable=SC1090
source "${HOMEBREW_LIBRARY}/Homebrew/brew.sh"
fi | true |
Other | Homebrew | brew | 965dbaa1720bbfe2451022ebf082611d584a1382.json | dev-cmd/bottle: fix libarchive installed check.
Used now-removed old method name. | Library/Homebrew/dev-cmd/bottle.rb | @@ -271,7 +271,7 @@ def setup_tar_owner_group_args!
return [].freeze
end
- unless libarchive.installed?
+ unless libarchive.any_version_installed?
ohai "Installing `libarchive` for bottling..."
safe_system HOMEBREW_BREW_FILE, "install", "--formula", libarchive.full_name
end | false |
Other | Homebrew | brew | 443bae5522fc6d81ecc362e4f7ea79eb53f6733a.json | pod2man: use newer pod2man.
This shim was originally added in
5c973bad7422cf7f335e952a91ddfa2273aa2e4f to workaround a missing
`/usr/bin/pod2man`. It's now unfortunately resulting in using an older
`pod2man` on newer macOS versions.
Instead, let's use `/usr/bin/pod2man` if it's available and, if not,
work backwards to find the newest available version that is available. | Library/Homebrew/shims/mac/super/pod2man | @@ -2,7 +2,10 @@
# HOMEBREW_PREFIX is set by bin/brew
# shellcheck disable=SC2154
-POD2MAN="$(type -P pod2man5.18 ||
+POD2MAN="$(type -P /usr/bin/pod2man ||
+ type -P pod2man5.30 ||
+ type -P pod2man5.28 ||
+ type -P pod2man5.18 ||
type -P pod2man5.16 ||
type -P pod2man5.12 ||
type -P "${HOMEBREW_PREFIX}/opt/pod2man/bin/pod2man" || | false |
Other | Homebrew | brew | 4a3fc2a8fc562418212b8ffea273ff9a3806c38e.json | dev-cmd/bottle: set uid/gid, use libarchive on macOS.
Take 2 on #11165 but use newish `libarchive` consistently on macOS. | Library/Homebrew/dev-cmd/bottle.rb | @@ -254,6 +254,35 @@ def sudo_purge
system "/usr/bin/sudo", "--non-interactive", "/usr/sbin/purge"
end
+ def setup_tar_owner_group_args!
+ # Unset the owner/group for reproducible bottles.
+ # Use gnu-tar on Linux
+ return ["--owner", "0", "--group", "0"].freeze if OS.linux?
+
+ bsdtar_args = ["--uid", "0", "--gid", "0"].freeze
+
+ # System bsdtar is new enough on macOS Catalina and above.
+ return bsdtar_args if OS.mac? && MacOS.version >= :catalina
+
+ # Use newish libarchive on older macOS versions for reproducibility.
+ begin
+ libarchive = Formula["libarchive"]
+ rescue FormulaUnavailableError
+ return [].freeze
+ end
+
+ unless libarchive.installed?
+ ohai "Installing `libarchive` for bottling..."
+ safe_system HOMEBREW_BREW_FILE, "install", "--formula", libarchive.full_name
+ end
+
+ path = PATH.new(ENV["PATH"])
+ path.prepend(libarchive.opt_bin.to_s)
+ ENV["PATH"] = path
+
+ bsdtar_args
+ end
+
def bottle_formula(f, args:)
local_bottle_json = args.json? && f.local_bottle_path.present?
@@ -387,9 +416,11 @@ def bottle_formula(f, args:)
cd cellar do
sudo_purge
- # Unset the owner/group for reproducible bottles.
# Tar then gzip for reproducible bottles.
- safe_system "tar", "--create", "--numeric-owner", "--file", tar_path, "#{f.name}/#{f.pkg_version}"
+ owner_group_args = setup_tar_owner_group_args!
+ safe_system "tar", "--create", "--numeric-owner",
+ *owner_group_args,
+ "--file", tar_path, "#{f.name}/#{f.pkg_version}"
sudo_purge
# Set more times for reproducible bottles.
tar_path.utime(tab.source_modified_time, tab.source_modified_time) | false |
Other | Homebrew | brew | 060ee065743967f563bf51be57d30886fa881383.json | Update RBI files for rubocop. | Library/Homebrew/sorbet/rbi/gems/parser@3.0.1.0.rbi | @@ -1,6 +1,6 @@
# DO NOT EDIT MANUALLY
# This is an autogenerated file for types exported from the `parser` gem.
-# Please instead update this file by running `tapioca sync`.
+# Please instead update this file by running `bin/tapioca sync`.
# typed: true
@@ -1194,6 +1194,7 @@ class Parser::Source::Buffer
def decompose_position(position); end
def first_line; end
def freeze; end
+ def inspect; end
def last_line; end
def line_for_position(position); end
def line_range(lineno); end
@@ -1549,6 +1550,7 @@ class Parser::Source::TreeRewriter
def insert_after_multi(range, text); end
def insert_before(range, content); end
def insert_before_multi(range, text); end
+ def inspect; end
def merge(with); end
def merge!(with); end
def process; end
@@ -1564,6 +1566,7 @@ class Parser::Source::TreeRewriter
private
+ def action_summary; end
def check_policy_validity; end
def check_range_validity(range); end
def combine(range, attributes); end | true |
Other | Homebrew | brew | 060ee065743967f563bf51be57d30886fa881383.json | Update RBI files for rubocop. | Library/Homebrew/sorbet/rbi/gems/rexml@3.2.5.rbi | @@ -1,39 +1,9 @@
# DO NOT EDIT MANUALLY
# This is an autogenerated file for types exported from the `rexml` gem.
-# Please instead update this file by running `tapioca generate --exclude json`.
+# Please instead update this file by running `bin/tapioca sync`.
# typed: true
-class Array
- include(::Enumerable)
- include(::JSON::Ext::Generator::GeneratorMethods::Array)
- include(::Plist::Emit)
-
- def dclone; end
-end
-
-class Float < ::Numeric
- include(::JSON::Ext::Generator::GeneratorMethods::Float)
-
- def dclone; end
-end
-
-class Integer < ::Numeric
- include(::JSON::Ext::Generator::GeneratorMethods::Integer)
-
- def dclone; end
-end
-
-Integer::GMP_VERSION = T.let(T.unsafe(nil), String)
-
-class Object < ::BasicObject
- include(::Kernel)
- include(::JSON::Ext::Generator::GeneratorMethods::Object)
- include(::PP::ObjectMixin)
-
- def dclone; end
-end
-
class REXML::AttlistDecl < ::REXML::Child
include(::Enumerable)
@@ -63,7 +33,7 @@ class REXML::Attribute
def inspect; end
def namespace(arg = T.unsafe(nil)); end
def node_type; end
- def normalized=(_); end
+ def normalized=(_arg0); end
def prefix; end
def remove; end
def to_s; end
@@ -129,11 +99,14 @@ class REXML::Comment < ::REXML::Child
def clone; end
def node_type; end
def string; end
- def string=(_); end
+ def string=(_arg0); end
def to_s; end
def write(output, indent = T.unsafe(nil), transitive = T.unsafe(nil), ie_hack = T.unsafe(nil)); end
end
+module REXML::DClonable
+end
+
class REXML::Declaration < ::REXML::Child
def initialize(src); end
@@ -162,10 +135,6 @@ class REXML::DocType < ::REXML::Parent
def public; end
def system; end
def write(output, indent = T.unsafe(nil), transitive = T.unsafe(nil), ie_hack = T.unsafe(nil)); end
-
- private
-
- def strip_quotes(quoted_string); end
end
class REXML::Document < ::REXML::Element
@@ -220,7 +189,7 @@ class REXML::Element < ::REXML::Parent
def clone; end
def comments; end
def context; end
- def context=(_); end
+ def context=(_arg0); end
def delete_attribute(key); end
def delete_element(element); end
def delete_namespace(namespace = T.unsafe(nil)); end
@@ -275,6 +244,7 @@ class REXML::Elements
def empty?; end
def index(element); end
def inject(xpath = T.unsafe(nil), initial = T.unsafe(nil)); end
+ def parent; end
def size; end
def to_a(xpath = T.unsafe(nil)); end
@@ -341,9 +311,9 @@ class REXML::Formatters::Pretty < ::REXML::Formatters::Default
def initialize(indentation = T.unsafe(nil), ie_hack = T.unsafe(nil)); end
def compact; end
- def compact=(_); end
+ def compact=(_arg0); end
def width; end
- def width=(_); end
+ def width=(_arg0); end
protected
@@ -382,11 +352,11 @@ class REXML::Instruction < ::REXML::Child
def ==(other); end
def clone; end
def content; end
- def content=(_); end
+ def content=(_arg0); end
def inspect; end
def node_type; end
def target; end
- def target=(_); end
+ def target=(_arg0); end
def write(writer, indent = T.unsafe(nil), transitive = T.unsafe(nil), ie_hack = T.unsafe(nil)); end
end
@@ -395,9 +365,9 @@ class REXML::NotationDecl < ::REXML::Child
def name; end
def public; end
- def public=(_); end
+ def public=(_arg0); end
def system; end
- def system=(_); end
+ def system=(_arg0); end
def to_s; end
def write(output, indent = T.unsafe(nil)); end
end
@@ -446,13 +416,13 @@ class REXML::ParseException < ::RuntimeError
def context; end
def continued_exception; end
- def continued_exception=(_); end
+ def continued_exception=(_arg0); end
def line; end
def parser; end
- def parser=(_); end
+ def parser=(_arg0); end
def position; end
def source; end
- def source=(_); end
+ def source=(_arg0); end
def to_s; end
end
@@ -476,10 +446,19 @@ class REXML::Parsers::BaseParser
def need_source_encoding_update?(xml_declaration_encoding); end
def parse_attributes(prefixes, curr_ns); end
+ def parse_id(base_error_message, accept_external_id:, accept_public_id:); end
+ def parse_id_invalid_details(accept_external_id:, accept_public_id:); end
+ def parse_name(base_error_message); end
def process_instruction; end
def pull_event; end
end
+REXML::Parsers::BaseParser::EXTERNAL_ID_PUBLIC = T.let(T.unsafe(nil), Regexp)
+
+REXML::Parsers::BaseParser::EXTERNAL_ID_SYSTEM = T.let(T.unsafe(nil), Regexp)
+
+REXML::Parsers::BaseParser::PUBLIC_ID = T.let(T.unsafe(nil), Regexp)
+
REXML::Parsers::BaseParser::QNAME = T.let(T.unsafe(nil), Regexp)
REXML::Parsers::BaseParser::QNAME_STR = T.let(T.unsafe(nil), String)
@@ -534,6 +513,12 @@ REXML::Parsers::XPathParser::LOCAL_NAME_WILDCARD = T.let(T.unsafe(nil), Regexp)
REXML::Parsers::XPathParser::PREFIX_WILDCARD = T.let(T.unsafe(nil), Regexp)
+class REXML::ReferenceWriter
+ def initialize(id_type, public_id_literal, system_literal, context = T.unsafe(nil)); end
+
+ def write(output); end
+end
+
class REXML::Source
include(::REXML::Encoding)
@@ -574,7 +559,7 @@ class REXML::Text < ::REXML::Child
def node_type; end
def parent=(parent); end
def raw; end
- def raw=(_); end
+ def raw=(_arg0); end
def to_s; end
def value; end
def value=(val); end
@@ -611,9 +596,9 @@ class REXML::XMLDecl < ::REXML::Child
def old_enc=(encoding); end
def stand_alone?; end
def standalone; end
- def standalone=(_); end
+ def standalone=(_arg0); end
def version; end
- def version=(_); end
+ def version=(_arg0); end
def write(writer, indent = T.unsafe(nil), transitive = T.unsafe(nil), ie_hack = T.unsafe(nil)); end
def writeencoding; end
def writethis; end
@@ -679,9 +664,3 @@ class REXML::XPathParser
def unnode(nodeset); end
def value_type(value); end
end
-
-class Symbol
- include(::Comparable)
-
- def dclone; end
-end | true |
Other | Homebrew | brew | 060ee065743967f563bf51be57d30886fa881383.json | Update RBI files for rubocop. | Library/Homebrew/sorbet/rbi/gems/rubocop@1.13.0.rbi | @@ -350,6 +350,7 @@ RuboCop::ConfigLoader::RUBOCOP_HOME = T.let(T.unsafe(nil), String)
RuboCop::ConfigLoader::XDG_CONFIG = T.let(T.unsafe(nil), String)
class RuboCop::ConfigLoaderResolver
+ def fix_include_paths(base_config_path, hash, path, key, value); end
def merge(base_hash, derived_hash, **opts); end
def merge_with_default(config, config_file, unset_nil:); end
def override_department_setting_for_cops(base_hash, derived_hash); end
@@ -732,6 +733,7 @@ class RuboCop::Cop::Base
def on_investigation_end; end
def on_new_investigation; end
def on_other_file; end
+ def parse(source, path = T.unsafe(nil)); end
def processed_source; end
def ready; end
def relevant_file?(file); end
@@ -838,13 +840,18 @@ class RuboCop::Cop::Bundler::GemComment < ::RuboCop::Cop::Base
def precede?(node1, node2); end
def preceding_comment?(node1, node2); end
def preceding_lines(node); end
+ def restrictive_version_specified_gem?(node); end
def version_specified_gem?(node); end
end
RuboCop::Cop::Bundler::GemComment::CHECKED_OPTIONS_CONFIG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Bundler::GemComment::MSG = T.let(T.unsafe(nil), String)
+RuboCop::Cop::Bundler::GemComment::RESTRICTIVE_VERSION_PATTERN = T.let(T.unsafe(nil), Regexp)
+
+RuboCop::Cop::Bundler::GemComment::RESTRICTIVE_VERSION_SPECIFIERS_OPTION = T.let(T.unsafe(nil), String)
+
RuboCop::Cop::Bundler::GemComment::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
RuboCop::Cop::Bundler::GemComment::VERSION_SPECIFIERS_OPTION = T.let(T.unsafe(nil), String)
@@ -1181,7 +1188,6 @@ class RuboCop::Cop::Cop < ::RuboCop::Cop::Base
def offenses; end
def on_investigation_end; end
def on_new_investigation; end
- def parse(source, path = T.unsafe(nil)); end
def support_autocorrect?; end
private
@@ -3212,6 +3218,27 @@ RuboCop::Cop::Layout::ParameterAlignment::ALIGN_PARAMS_MSG = T.let(T.unsafe(nil)
RuboCop::Cop::Layout::ParameterAlignment::FIXED_INDENT_MSG = T.let(T.unsafe(nil), String)
+class RuboCop::Cop::Layout::RedundantLineBreak < ::RuboCop::Cop::Cop
+ include(::RuboCop::Cop::CheckAssignment)
+
+ def autocorrect(node); end
+ def check_assignment(node, _rhs); end
+ def on_send(node); end
+
+ private
+
+ def comment_within?(node); end
+ def configured_to_not_be_inspected?(node); end
+ def convertible_block?(node); end
+ def max_line_length; end
+ def offense?(node); end
+ def suitable_as_single_line?(node); end
+ def to_single_line(source); end
+ def too_long?(node); end
+end
+
+RuboCop::Cop::Layout::RedundantLineBreak::MSG = T.let(T.unsafe(nil), String)
+
class RuboCop::Cop::Layout::RescueEnsureAlignment < ::RuboCop::Cop::Base
include(::RuboCop::Cop::ConfigurableEnforcedStyle)
include(::RuboCop::Cop::RangeHelp)
@@ -3901,6 +3928,9 @@ RuboCop::Cop::Lint::AmbiguousAssignment::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Lint::AmbiguousAssignment::SIMPLE_ASSIGNMENT_TYPES = T.let(T.unsafe(nil), Array)
class RuboCop::Cop::Lint::AmbiguousBlockAssociation < ::RuboCop::Cop::Base
+ include(::RuboCop::Cop::IgnoredMethods)
+ extend(::RuboCop::Cop::IgnoredMethods::Config)
+
def on_csend(node); end
def on_send(node); end
@@ -4094,7 +4124,7 @@ class RuboCop::Cop::Lint::DeprecatedConstants < ::RuboCop::Cop::Base
private
- def consntant_name(node, nested_constant_name); end
+ def constant_name(node, nested_constant_name); end
def deprecated_constants; end
def message(good, bad, deprecated_version); end
end
@@ -4574,7 +4604,6 @@ class RuboCop::Cop::Lint::InterpolationCheck < ::RuboCop::Cop::Base
def autocorrect(corrector, node); end
def heredoc?(node); end
- def string_or_regex?(node); end
end
RuboCop::Cop::Lint::InterpolationCheck::MSG = T.let(T.unsafe(nil), String)
@@ -6685,7 +6714,6 @@ module RuboCop::Cop::PercentLiteral
private
def begin_source(node); end
- def contents_range(node); end
def percent_literal?(node); end
def process(node, *types); end
def type(node); end
@@ -6774,6 +6802,7 @@ module RuboCop::Cop::RangeHelp
private
def column_offset_between(base_range, range); end
+ def contents_range(node); end
def directions(side); end
def effective_column(range); end
def final_pos(src, pos, increment, continuations, newlines, whitespace); end
@@ -8534,8 +8563,11 @@ class RuboCop::Cop::Style::HashConversion < ::RuboCop::Cop::Base
def allowed_splat_argument?; end
def args_to_hash(args); end
def multi_argument(node); end
+ def register_offense_for_hash(node, hash_argument); end
+ def register_offense_for_zip_method(node, zip_method); end
def requires_parens?(node); end
def single_argument(node); end
+ def use_zip_method_without_argument?(first_argument); end
end
RuboCop::Cop::Style::HashConversion::MSG_LITERAL_HASH_ARG = T.let(T.unsafe(nil), String)
@@ -8718,6 +8750,7 @@ class RuboCop::Cop::Style::IfUnlessModifier < ::RuboCop::Cop::Base
include(::RuboCop::Cop::LineLengthHelp)
include(::RuboCop::Cop::StatementModifier)
include(::RuboCop::Cop::IgnoredPattern)
+ include(::RuboCop::Cop::RangeHelp)
extend(::RuboCop::Cop::AutoCorrector)
def on_if(node); end
@@ -8726,12 +8759,15 @@ class RuboCop::Cop::Style::IfUnlessModifier < ::RuboCop::Cop::Base
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
def non_simple_if_unless?(node); end
- def to_normal_form(node); end
+ def remove_heredoc(corrector, heredoc); end
+ def to_normal_form(node, indentation); end
+ def to_normal_form_with_heredoc(node, indentation, heredoc); end
def too_long_due_to_modifier?(node); end
def too_long_line_based_on_allow_uri?(line); end
def too_long_line_based_on_config?(range, line); end
@@ -10268,7 +10304,6 @@ class RuboCop::Cop::Style::RedundantParentheses < ::RuboCop::Cop::Base
def allowed_expression?(node); end
def allowed_method_call?(node); end
def allowed_multiple_expression?(node); end
- def array_element?(node); end
def call_chain_starts_with_int?(begin_node, send_node); end
def check(begin_node); end
def check_send(begin_node, node); end
@@ -10277,7 +10312,7 @@ class RuboCop::Cop::Style::RedundantParentheses < ::RuboCop::Cop::Base
def empty_parentheses?(node); end
def first_arg_begins_with_hash_literal?(node); end
def first_argument?(node); end
- def hash_element?(node); end
+ def hash_or_array_element?(node); end
def ignore_syntax?(node); end
def keyword_ancestor?(node); end
def keyword_with_redundant_parentheses?(node); end
@@ -10545,6 +10580,10 @@ class RuboCop::Cop::Style::RescueModifier < ::RuboCop::Cop::Base
def correct_rescue_block(corrector, node, parenthesized); end
def indentation_and_offset(node, parenthesized); end
def parenthesized?(node); end
+
+ class << self
+ def autocorrect_incompatible_with; end
+ end
end
RuboCop::Cop::Style::RescueModifier::MSG = T.let(T.unsafe(nil), String)
@@ -10779,6 +10818,7 @@ class RuboCop::Cop::Style::SingleLineMethods < ::RuboCop::Cop::Base
def correct_to_endless?(body_node); end
def correct_to_multiline(corrector, node); end
def each_part(body); end
+ def method_body_source(method_body); end
def move_comment(node, corrector); end
end
@@ -10906,6 +10946,7 @@ RuboCop::Cop::Style::StderrPuts::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Style::StderrPuts::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
class RuboCop::Cop::Style::StringChars < ::RuboCop::Cop::Base
+ include(::RuboCop::Cop::RangeHelp)
extend(::RuboCop::Cop::AutoCorrector)
def on_send(node); end
@@ -10918,6 +10959,7 @@ RuboCop::Cop::Style::StringChars::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Style::StringChars::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
class RuboCop::Cop::Style::StringConcatenation < ::RuboCop::Cop::Base
+ include(::RuboCop::Cop::RangeHelp)
extend(::RuboCop::Cop::AutoCorrector)
def on_new_investigation; end
@@ -11022,6 +11064,7 @@ class RuboCop::Cop::Style::StructInheritance < ::RuboCop::Cop::Base
private
def correct_parent(parent, corrector); end
+ def range_for_empty_class_body(class_node, struct_new); end
end
RuboCop::Cop::Style::StructInheritance::MSG = T.let(T.unsafe(nil), String)
@@ -12735,6 +12778,7 @@ class RuboCop::OptionsValidator
def initialize(options); end
def boolean_or_empty_cache?; end
+ def disable_parallel_when_invalid_combo; end
def display_only_fail_level_offenses_with_autocorrect?; end
def except_syntax?; end
def incompatible_options; end
@@ -12747,7 +12791,6 @@ class RuboCop::OptionsValidator
def validate_display_only_failed; end
def validate_exclude_limit_option; end
def validate_parallel; end
- def validate_parallel_with_combo_option; end
class << self
def validate_cop_list(names); end | true |
Other | Homebrew | brew | 060ee065743967f563bf51be57d30886fa881383.json | Update RBI files for rubocop. | Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi | @@ -9694,6 +9694,7 @@ module IRB
end
class Integer
+ include ::JSON::Ext::Generator::GeneratorMethods::Integer
include ::MessagePack::CoreExt
def to_bn(); end
end | true |
Other | Homebrew | brew | 39c34b99539caaab0f2e707634f8d627e2910cbc.json | Remove issue_body key from issue forms | .github/ISSUE_TEMPLATE/bug.yml | @@ -1,7 +1,6 @@
name: New issue for Reproducible Bug
description: "If you're sure it's reproducible and not just your machine: submit an issue so we can investigate."
labels: bug
-issue_body: false
body:
- type: markdown
attributes: | false |
Other | Homebrew | brew | 34919c45f257dff0943b32b88d4c6c9477e9ef9c.json | add comments about ENV | Library/Homebrew/shims/linux/super/make | @@ -1,5 +1,7 @@
#!/bin/bash
+# HOMEBREW_CCCFG is set by extend/ENV/super.rb
+# HOMEBREW_LIBRARY is set by bin/brew
# shellcheck disable=SC2154,SC2250
pathremove() {
local IFS=':' NEWPATH="" DIR="" PATHVARIABLE=${2:-PATH} | true |
Other | Homebrew | brew | 34919c45f257dff0943b32b88d4c6c9477e9ef9c.json | add comments about ENV | Library/Homebrew/shims/mac/super/apr-1-config | @@ -1,5 +1,6 @@
#!/bin/bash
+# HOMEBREW_CCCFG and HOMEBREW_SDKROOT are set by extend/ENV/super.rb
# shellcheck disable=SC2154
if [[ "${HOMEBREW_CCCFG}" = *a* ]]
then | true |
Other | Homebrew | brew | 34919c45f257dff0943b32b88d4c6c9477e9ef9c.json | add comments about ENV | Library/Homebrew/shims/mac/super/make | @@ -1,6 +1,7 @@
#!/bin/bash
# shellcheck disable=SC2154
+# HOMEBREW_CCCFG is set by extend/ENV/super.rb
if [[ -n "${HOMEBREW_MAKE}" && "${HOMEBREW_MAKE}" != "make" ]]
then
export MAKE="${HOMEBREW_MAKE}" | true |
Other | Homebrew | brew | 34919c45f257dff0943b32b88d4c6c9477e9ef9c.json | add comments about ENV | Library/Homebrew/shims/mac/super/pkg-config | @@ -1,5 +1,6 @@
#!/bin/sh
+# HOMEBREW_OPT and HOMEBREW_SDKROOT are set by extend/ENV/super.rb
# shellcheck disable=SC2154
pkg_config="${HOMEBREW_OPT}/pkg-config/bin/pkg-config"
| true |
Other | Homebrew | brew | 34919c45f257dff0943b32b88d4c6c9477e9ef9c.json | add comments about ENV | Library/Homebrew/shims/mac/super/ruby | @@ -3,6 +3,8 @@
# System Ruby's mkmf on Mojave (10.14) and later require SDKROOT set to work correctly.
# Don't need shellcheck to follow the `source`.
+# HOMEBREW_LIBRARY is set by bin/brew
+# HOMEBREW_SDKROOT is set by extend/ENV/super.rb
# shellcheck disable=SC1090,SC2154
source "${HOMEBREW_LIBRARY}/Homebrew/shims/utils.sh"
| true |
Other | Homebrew | brew | 34919c45f257dff0943b32b88d4c6c9477e9ef9c.json | add comments about ENV | Library/Homebrew/shims/mac/super/xcrun | @@ -5,6 +5,7 @@
# it and attempts to avoid these issues.
# These could be used in conjunction with `--sdk` which ignores SDKROOT.
+# HOMEBREW_DEVELOPER_DIR, HOMEBREW_SDKROOT and HOMEBREW_PREFER_CLT_PROXIES are set by extend/ENV/super.rb
# shellcheck disable=SC2154
if [[ "$*" =~ (^| )-?-show-sdk-(path|version|build) && -n "${HOMEBREW_DEVELOPER_DIR}" ]]; then
export DEVELOPER_DIR=${HOMEBREW_DEVELOPER_DIR} | true |
Other | Homebrew | brew | 34919c45f257dff0943b32b88d4c6c9477e9ef9c.json | add comments about ENV | Library/Homebrew/shims/scm/git | @@ -3,6 +3,11 @@
# This script because we support $HOMEBREW_GIT, $HOMEBREW_SVN, etc., Xcode-only and
# no Xcode/CLT configurations. Order is careful to be what the user would want.
+# HOMEBREW_LIBRARY is set by bin/brew
+# SHIM_FILE is set by shims/utils.sh
+# HOMEBREW_GIT is set by brew.sh
+# HOMEBREW_SVN is from the user environment.
+# HOMEBREW_PREFIX is set extend/ENV/super.rb
# shellcheck disable=SC2154
if [ -z "${HOMEBREW_LIBRARY}" ]
then | true |
Other | Homebrew | brew | 9a697736400f42ded179f1eb23972e049e1020e7.json | workflows/tests: simulate macOS for `brew style homebrew-core` | .github/workflows/tests.yml | @@ -106,6 +106,8 @@ jobs:
- name: Run brew style on homebrew-core
run: brew style --display-cop-names homebrew/core
+ env:
+ HOMEBREW_SIMULATE_MACOS_ON_LINUX: 1
- name: Run brew audit --skip-style on homebrew-core
run: brew audit --skip-style --tap=homebrew/core | false |
Other | Homebrew | brew | 117902803f2ec08a644e83613392f2e518c37717.json | add detail comments and delete cask | Library/Homebrew/brew.sh | @@ -3,6 +3,7 @@
##### able to `source` in shell configuration quick.
#####
+# Doesn't need a default case because we don't support other OSs
# shellcheck disable=SC2249
HOMEBREW_PROCESSOR="$(uname -m)"
HOMEBREW_SYSTEM="$(uname -s)"
@@ -14,6 +15,7 @@ esac
# If we're running under macOS Rosetta 2, and it was requested by setting
# HOMEBREW_CHANGE_ARCH_TO_ARM (for example in CI), then we re-exec this
# same file under the native architecture
+# These variables are set from the user environment.
# shellcheck disable=SC2154
if [[ "${HOMEBREW_CHANGE_ARCH_TO_ARM}" = "1" ]] && \
[[ "${HOMEBREW_MACOS}" = "1" ]] && \
@@ -24,6 +26,7 @@ fi
# Where we store built products; a Cellar in HOMEBREW_PREFIX (often /usr/local
# for bottles) unless there's already a Cellar in HOMEBREW_REPOSITORY.
+# These variables are set by bin/brew
# shellcheck disable=SC2154
if [[ -d "${HOMEBREW_REPOSITORY}/Cellar" ]]
then
@@ -49,6 +52,8 @@ HOMEBREW_LOGS="${HOMEBREW_LOGS:-${HOMEBREW_DEFAULT_LOGS}}"
HOMEBREW_TEMP="${HOMEBREW_TEMP:-${HOMEBREW_DEFAULT_TEMP}}"
# Don't need shellcheck to follow these `source`.
+# These referenced variables are set by bin/brew
+# Don't need to handle a default case.
# shellcheck disable=SC1090,SC2154,SC2249
case "$*" in
--cellar) echo "${HOMEBREW_CELLAR}"; exit 0 ;;
@@ -66,6 +71,7 @@ esac
##### Next, define all helper functions.
#####
+# These variables are set from the user environment.
# shellcheck disable=SC2154
ohai() {
if [[ -n "${HOMEBREW_COLOR}" || (-t 1 && -z "${HOMEBREW_NO_COLOR}") ]] # check whether stdout is a tty.
@@ -154,6 +160,7 @@ update-preinstall-timer() {
echo 'Updating Homebrew...' >&2
}
+# These variables are set from various Homebrew scripts.
# shellcheck disable=SC2154
update-preinstall() {
[[ -z "${HOMEBREW_HELP}" ]] || return
@@ -165,22 +172,10 @@ update-preinstall() {
# If we've checked for updates, we don't need to check again.
export HOMEBREW_AUTO_UPDATE_CHECKED="1"
- if [[ "${HOMEBREW_COMMAND}" = "cask" ]]
- then
- if [[ "${HOMEBREW_CASK_COMMAND}" != "upgrade" && ${HOMEBREW_ARG_COUNT} -lt 3 ]]
- then
- return
- fi
- elif [[ "${HOMEBREW_COMMAND}" != "upgrade" && ${HOMEBREW_ARG_COUNT} -lt 2 ]]
- then
- return
- fi
-
if [[ "${HOMEBREW_COMMAND}" = "install" || "${HOMEBREW_COMMAND}" = "upgrade" ||
"${HOMEBREW_COMMAND}" = "bump-formula-pr" || "${HOMEBREW_COMMAND}" = "bump-cask-pr" ||
"${HOMEBREW_COMMAND}" = "bundle" || "${HOMEBREW_COMMAND}" = "release" ||
- "${HOMEBREW_COMMAND}" = "tap" && ${HOMEBREW_ARG_COUNT} -gt 1 ||
- "${HOMEBREW_CASK_COMMAND}" = "install" || "${HOMEBREW_CASK_COMMAND}" = "upgrade" ]]
+ "${HOMEBREW_COMMAND}" = "tap" && ${HOMEBREW_ARG_COUNT} -gt 1 ]]
then
export HOMEBREW_AUTO_UPDATING="1"
@@ -189,14 +184,9 @@ update-preinstall() {
HOMEBREW_AUTO_UPDATE_SECS="300"
fi
- # Skip auto-update if the cask/core tap has been updated in the
+ # Skip auto-update if the core tap has been updated in the
# last $HOMEBREW_AUTO_UPDATE_SECS.
- if [[ "${HOMEBREW_COMMAND}" = "cask" ]]
- then
- tap_fetch_head="${HOMEBREW_CASK_REPOSITORY}/.git/FETCH_HEAD"
- else
- tap_fetch_head="${HOMEBREW_CORE_REPOSITORY}/.git/FETCH_HEAD"
- fi
+ tap_fetch_head="${HOMEBREW_CORE_REPOSITORY}/.git/FETCH_HEAD"
if [[ -f "${tap_fetch_head}" &&
-n "$(find "${tap_fetch_head}" -type f -mtime -"${HOMEBREW_AUTO_UPDATE_SECS}"s 2>/dev/null)" ]]
then
@@ -229,6 +219,7 @@ update-preinstall() {
#####
# Colorize output on GitHub Actions.
+# This is set by the user environment.
# shellcheck disable=SC2154
if [[ -n "${GITHUB_ACTIONS}" ]]; then
export HOMEBREW_COLOR="1"
@@ -288,6 +279,7 @@ export USER=${USER:-$(id -un)}
# Higher depths mean this command was invoked by another Homebrew command.
export HOMEBREW_COMMAND_DEPTH=$((HOMEBREW_COMMAND_DEPTH + 1))
+# This is set by the user environment.
# shellcheck disable=SC2154
if [[ -n "${HOMEBREW_FORCE_BREWED_CURL}" &&
-x "${HOMEBREW_PREFIX}/opt/curl/bin/curl" ]] &&
@@ -301,6 +293,7 @@ else
HOMEBREW_CURL="curl"
fi
+# This is set by the user environment.
# shellcheck disable=SC2154
if [[ -n "${HOMEBREW_FORCE_BREWED_GIT}" &&
-x "${HOMEBREW_PREFIX}/opt/git/bin/git" ]] &&
@@ -322,7 +315,6 @@ then
HOMEBREW_USER_AGENT_VERSION="2.X.Y"
fi
-HOMEBREW_CASK_REPOSITORY="${HOMEBREW_LIBRARY}/Taps/homebrew/homebrew-cask"
HOMEBREW_CORE_REPOSITORY="${HOMEBREW_LIBRARY}/Taps/homebrew/homebrew-core"
# Don't need shellcheck to follow these `source`.
@@ -393,6 +385,8 @@ else
[[ -n "${HOMEBREW_LINUX}" ]] && HOMEBREW_OS_VERSION="$(lsb_release -sd 2>/dev/null)"
: "${HOMEBREW_OS_VERSION:=$(uname -r)}"
HOMEBREW_OS_USER_AGENT_VERSION="${HOMEBREW_OS_VERSION}"
+
+ # This is set by the user environment.
# shellcheck disable=SC2154
if [[ -n "${HOMEBREW_FORCE_HOMEBREW_ON_LINUX}" && -n "${HOMEBREW_ON_DEBIAN7}" ]]
then
@@ -459,6 +453,7 @@ fi
# This workaround is necessary for many CI images starting on old version,
# and will only be unnecessary when updating from <3.1.2 is not a concern.
# That will be when macOS 12 is the minimum required version.
+# HOMEBREW_BOTTLE_DOMAIN is set from the user environment
# shellcheck disable=SC2154
if [[ -n "${HOMEBREW_BOTTLE_DEFAULT_DOMAIN}" && "${HOMEBREW_BOTTLE_DOMAIN}" = "${HOMEBREW_BOTTLE_DEFAULT_DOMAIN}" ]]
then
@@ -575,15 +570,6 @@ case "${HOMEBREW_COMMAND}" in
-v) HOMEBREW_COMMAND="--version" ;;
esac
-if [[ "${HOMEBREW_COMMAND}" = "cask" ]]
-then
- HOMEBREW_CASK_COMMAND="$1"
-
- case "${HOMEBREW_CASK_COMMAND}" in
- instal) HOMEBREW_CASK_COMMAND="install" ;; # gem does the same
- esac
-fi
-
# Set HOMEBREW_DEV_CMD_RUN for users who have run a development command.
# This makes them behave like HOMEBREW_DEVELOPERs for brew update.
if [[ -z "${HOMEBREW_DEVELOPER}" ]]
@@ -686,6 +672,7 @@ else
# Unshift command back into argument list (unless argument list was empty).
[[ "${HOMEBREW_ARG_COUNT}" -gt 0 ]] && set -- "${HOMEBREW_COMMAND}" "$@"
+ # HOMEBREW_RUBY_PATH set by utils/ruby.sh
# shellcheck disable=SC2154
{ update-preinstall "$@"; exec "${HOMEBREW_RUBY_PATH}" "${HOMEBREW_RUBY_WARNINGS}" "${RUBY_DISABLE_OPTIONS}" "${HOMEBREW_LIBRARY}/Homebrew/brew.rb" "$@"; }
fi | false |
Other | Homebrew | brew | 1c2d76c4e4903322197c3cf854188e31d5a41838.json | rubocops/patches: remove autocorrection of some URLs | Library/Homebrew/rubocops/patches.rb | @@ -53,24 +53,16 @@ def patch_problems(patch_url_node)
end
if regex_match_group(patch_url_node, %r{https://github.com/[^/]*/[^/]*/commit/[a-fA-F0-9]*\.diff})
- problem "GitHub patches should end with .patch, not .diff: #{patch_url}" do |corrector|
- correct = patch_url_node.source.gsub(/\.diff/, ".patch")
- corrector.replace(patch_url_node.source_range, correct)
- end
+ problem "GitHub patches should end with .patch, not .diff: #{patch_url}"
end
if regex_match_group(patch_url_node, %r{.*gitlab.*/commit/[a-fA-F0-9]*\.diff})
- problem "GitLab patches should end with .patch, not .diff: #{patch_url}" do |corrector|
- correct = patch_url_node.source.gsub(/\.diff/, ".patch")
- corrector.replace(patch_url_node.source_range, correct)
- end
+ problem "GitLab patches should end with .patch, not .diff: #{patch_url}"
end
gh_patch_param_pattern = %r{https?://github\.com/.+/.+/(?:commit|pull)/[a-fA-F0-9]*.(?:patch|diff)}
if regex_match_group(patch_url_node, gh_patch_param_pattern) && !patch_url.match?(/\?full_index=\w+$/)
- problem "GitHub patches should use the full_index parameter: #{patch_url}?full_index=1" do |corrector|
- corrector.replace(patch_url_node.source_range, "\"#{patch_url}?full_index=1\"")
- end
+ problem "GitHub patches should use the full_index parameter: #{patch_url}?full_index=1"
end
gh_patch_patterns = Regexp.union([%r{/raw\.github\.com/}, | false |
Other | Homebrew | brew | a328acc9a109dea01210b0556790728be2023f16.json | rubocops/patches: Fix quoting of the patch `url` when autocorrecting
- The autocorrections here before were leading to changes like:
```
➜ brew style --fix brewsci/science/beetl
Formula/beetl.rb:15:11: C: [Corrected] GitHub patches should use the full_index parameter: https://github.com/BEETL/BEETL/commit/ba47b6f9.patch?full_index=1
url "https://github.com/BEETL/BEETL/commit/ba47b6f9.patch"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
➜ git diff
diff --git a/Formula/beetl.rb b/Formula/beetl.rb
index bbd049aa..7ec6d7bc 100644
--- a/Formula/beetl.rb
+++ b/Formula/beetl.rb
@@ -12,7 +12,7 @@ class Beetl < Formula
# Fixes "error: 'accumulate' is not a member of 'std'"
# Upstream commit "Little fix for compilation on mac"
patch do
- url "https://github.com/BEETL/BEETL/commit/ba47b6f9.patch"
+ url https://github.com/BEETL/BEETL/commit/ba47b6f9.patch?full_index=1
sha256 "63b67f3282893d1f74c66aa98f3bf2684aaba2fa9ce77858427b519f1f02807d"
end
end
```
- This fixes the URLs generated to have quotes:
```
➜ git diff
diff --git a/Formula/beetl.rb b/Formula/beetl.rb
index bbd049aa..7ec6d7bc 100644
--- a/Formula/beetl.rb
+++ b/Formula/beetl.rb
@@ -12,7 +12,7 @@ class Beetl < Formula
# Fixes "error: 'accumulate' is not a member of 'std'"
# Upstream commit "Little fix for compilation on mac"
patch do
- url "https://github.com/BEETL/BEETL/commit/ba47b6f9.patch"
+ url "https://github.com/BEETL/BEETL/commit/ba47b6f9.patch?full_index=1"
sha256 "63b67f3282893d1f74c66aa98f3bf2684aaba2fa9ce77858427b519f1f02807d"
end
end
``` | Library/Homebrew/rubocops/patches.rb | @@ -69,7 +69,7 @@ def patch_problems(patch_url_node)
gh_patch_param_pattern = %r{https?://github\.com/.+/.+/(?:commit|pull)/[a-fA-F0-9]*.(?:patch|diff)}
if regex_match_group(patch_url_node, gh_patch_param_pattern) && !patch_url.match?(/\?full_index=\w+$/)
problem "GitHub patches should use the full_index parameter: #{patch_url}?full_index=1" do |corrector|
- corrector.replace(patch_url_node.source_range, "#{patch_url}?full_index=1")
+ corrector.replace(patch_url_node.source_range, "\"#{patch_url}?full_index=1\"")
end
end
| false |
Other | Homebrew | brew | 4a0b860973a8f7224429943050864ebd61b53331.json | dev-cmd/bottle: improve reproducibility, comment.
Setting a consistent owner/group results in more consistent bottles. | Library/Homebrew/dev-cmd/bottle.rb | @@ -377,6 +377,7 @@ def bottle_formula(f, args:)
end
keg.find do |file|
+ # Set the times for reproducible bottles.
if file.symlink?
File.lutime(tab.source_modified_time, tab.source_modified_time, file)
else
@@ -386,8 +387,11 @@ def bottle_formula(f, args:)
cd cellar do
sudo_purge
- safe_system "tar", "cf", tar_path, "#{f.name}/#{f.pkg_version}"
+ # Unset the owner/group for reproducible bottles.
+ # Tar then gzip for reproducible bottles.
+ safe_system "tar", "--create", "--numeric-owner", "--file", tar_path, "#{f.name}/#{f.pkg_version}"
sudo_purge
+ # Set more times for reproducible bottles.
tar_path.utime(tab.source_modified_time, tab.source_modified_time)
relocatable_tar_path = "#{f}-bottle.tar"
mv tar_path, relocatable_tar_path | false |
Other | Homebrew | brew | a28dda50629de70454d0ad91f966101310ff7074.json | bottle: remove GitHub Packages bulk upload logic. | Library/Homebrew/dev-cmd/bottle.rb | @@ -331,18 +331,6 @@ def bottle_formula(f, args:)
tab_json = Utils.safe_popen_read("tar", "xfO", f.local_bottle_path, tab_path)
tab = Tab.from_file_content(tab_json, tab_path)
- # TODO: most of this logic can be removed when we're done with bulk GitHub Packages bottle uploading
- tap_git_revision = tab["source"]["tap_git_head"]
- if tap.core_tap?
- if bottle_tag.to_s.end_with?("_linux")
- tap_git_remote = "https://github.com/Homebrew/linuxbrew-core"
- formulae_brew_sh_path = "formula-linux"
- else
- tap_git_remote = "https://github.com/Homebrew/homebrew-core"
- formulae_brew_sh_path = "formula"
- end
- end
-
_, _, bottle_cellar = Formula[f.name].bottle_specification.checksum_for(bottle_tag, no_older_versions: true)
relocatable = [:any, :any_skip_relocation].include?(bottle_cellar)
skip_relocation = bottle_cellar == :any_skip_relocation | false |
Other | Homebrew | brew | 7c9053753fb9631ec5ff94b76db8626e6a6bdd39.json | brew.sh: add workaround for old auto-updates | Library/Homebrew/brew.sh | @@ -442,6 +442,17 @@ Your Git executable: $(unset git && type -p $HOMEBREW_GIT)"
unset HOMEBREW_MACOS_SYSTEM_RUBY_NEW_ENOUGH
fi
+# A bug in the auto-update process prior to 3.1.2 means $HOMEBREW_BOTTLE_DOMAIN
+# could be passed down with the default domain.
+# This is problematic as this is will be the old bottle domain.
+# This workaround is necessary for many CI images starting on old version,
+# and will only be unnecessary when updating from <3.1.2 is not a concern.
+# That will be when macOS 12 is the minimum required version.
+if [[ -n "$HOMEBREW_BOTTLE_DEFAULT_DOMAIN" && "$HOMEBREW_BOTTLE_DOMAIN" = "$HOMEBREW_BOTTLE_DEFAULT_DOMAIN" ]]
+then
+ unset HOMEBREW_BOTTLE_DOMAIN
+fi
+
if [[ -n "$HOMEBREW_MACOS" || -n "$HOMEBREW_FORCE_HOMEBREW_ON_LINUX" ]]
then
HOMEBREW_BOTTLE_DEFAULT_DOMAIN="https://ghcr.io/v2/homebrew/core" | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.