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 | 4381c32524c999fd7de308ef775c66b4f056497d.json | Add test for parsing with `ignore_invalid_options`. | Library/Homebrew/test/cli/parser_spec.rb | @@ -15,6 +15,14 @@
allow(Homebrew::EnvConfig).to receive(:pry?).and_return(true)
end
+ context "when `ignore_invalid_options` is true" do
+ it "passes through invalid options" do
+ args = parser.parse(["-v", "named-arg", "--not-a-valid-option"], ignore_invalid_options: true)
+ expect(args.remaining).to eq ["named-arg", "--not-a-valid-option"]
+ expect(args.named_args).to be_empty
+ end
+ end
+
it "parses short option" do
args = parser.parse(["-v"])
expect(args).to be_verbose | true |
Other | Homebrew | brew | 020ce249eeb96efc992d5aea44705645fbfbdcff.json | bump-formula-pr: handle pypi url version changes | Library/Homebrew/dev-cmd/bump-formula-pr.rb | @@ -183,6 +183,11 @@ def bump_formula_pr
elsif !new_url && !new_version
odie "#{formula}: no --url= or --version= argument specified!"
else
+ new_url ||= if old_url.start_with?(PyPI::PYTHONHOSTED_URL_PREFIX)
+ package_name = File.basename(old_url).match(/^(.+)-[a-z\d.]+$/)[1]
+ _, url = PyPI.get_pypi_info(package_name, new_version)
+ url
+ end
new_url ||= old_url.gsub(old_version, new_version)
if new_url == old_url
odie <<~EOS | false |
Other | Homebrew | brew | a7e692e7bc4d5e6d39910f2bd27e809dd55d19a3.json | dependencies: fix error in recursive_includes | Library/Homebrew/dependencies.rb | @@ -100,7 +100,7 @@ def recursive_includes(klass, root_dependent, includes, ignores)
klass.prune if !includes.include?("optional?") && !dependent.build.with?(dep)
elsif dep.build? || dep.test?
keep = false
- keep ||= dep.test? && includes.include?("test?") && dependent == formula
+ keep ||= dep.test? && includes.include?("test?") && dependent == root_dependent
keep ||= dep.build? && includes.include?("build?")
klass.prune unless keep
end | false |
Other | Homebrew | brew | 633dea1bb12936fcde75926ed41c78692416d600.json | rubocop.yml: cask fixes for new style | Library/.rubocop.yml | @@ -181,7 +181,9 @@ Layout/LineLength:
Max: 118
# ignore manpage comments and long single-line strings
IgnoredPatterns: ['#: ', ' url "', ' mirror "', ' plist_options ',
- ' appcast "', ' executable: "', '#{version.',
+ ' appcast "', ' executable: "', ' font "', ' homepage "', ' name "',
+ ' pkg "', ' pkgutil: "', '#{language}', '#{version.',
+ ' "/Library/Application Support/', '"/Library/Caches/', '"/Library/PreferencePanes/',
' "~/Library/Application Support/', '"~/Library/Caches/', '"~/Application Support',
' was verified as official when first introduced to the cask']
| false |
Other | Homebrew | brew | 1ac470fe7a939c628f8e532e313ae06a11aeca4a.json | bump-revision: handle array of licenses
Allowing multiple licenses meant that `formula.license` returned an
array. This converts that array to the appropriate format for
`bump-revision` | Library/Homebrew/dev-cmd/bump-revision.rb | @@ -42,9 +42,14 @@ def bump_revision
end
old = if formula.license
+ license_string = if formula.license.length > 1
+ formula.license
+ else
+ "\"#{formula.license.first}\""
+ end
# insert replacement revision after license
<<~EOS
- license "#{formula.license}"
+ license #{license_string}
EOS
elsif formula.path.read.include?("stable do\n")
# insert replacement revision after homepage | false |
Other | Homebrew | brew | 17fb1b6dd87b531d26b8bfe606cce55a5106ab2c.json | cmd/deps: add missing require.
Fixes https://github.com/Homebrew/brew/pull/8126#issuecomment-666345260 | Library/Homebrew/cmd/deps.rb | @@ -4,6 +4,7 @@
require "ostruct"
require "cli/parser"
require "cask/caskroom"
+require "cask_dependent"
module Homebrew
extend DependenciesHelpers | false |
Other | Homebrew | brew | 36458b2356388a299d6b4a8b1d1053baf910efae.json | Remove unnecessary check. | Library/Homebrew/patch.rb | @@ -160,8 +160,7 @@ def apply
end
end
rescue ErrorDuringExecution => e
- raise unless (f = resource.owner&.owner)
-
+ f = resource.owner.owner
cmd, *args = e.cmd
raise BuildError.new(f, cmd, args, ENV.to_hash)
end | false |
Other | Homebrew | brew | f96240eec770beb991f29799e73955e880617167.json | deps: Add tests for CaskDependent | Library/Homebrew/cask_dependent.rb | @@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# An adapter for casks to provide dependency information in a formula-like interface
class CaskDependent
def initialize(cask) | true |
Other | Homebrew | brew | f96240eec770beb991f29799e73955e880617167.json | deps: Add tests for CaskDependent | Library/Homebrew/test/cask_dependent_spec.rb | @@ -0,0 +1,63 @@
+# frozen_string_literal: true
+
+require "cask/cask_loader"
+require "cask_dependent"
+
+describe CaskDependent, :needs_macos do
+ subject(:dependent) { described_class.new test_cask }
+
+ let :test_cask do
+ Cask::CaskLoader.load(+<<-RUBY)
+ cask "testing" do
+ depends_on formula: "baz"
+ depends_on cask: "foo-cask"
+ depends_on macos: ">= :mojave"
+ depends_on x11: true
+ end
+ RUBY
+ end
+
+ describe "#deps" do
+ it "is the formula dependencies of the cask" do
+ expect(dependent.deps.map(&:name))
+ .to eq %w[baz]
+ end
+ end
+
+ describe "#requirements" do
+ it "is the requirements of the cask" do
+ expect(dependent.requirements.map(&:name))
+ .to eq %w[foo-cask macos x11]
+ end
+ end
+
+ describe "#recursive_dependencies", :integration_test do
+ it "is all the dependencies of the cask" do
+ setup_test_formula "foo"
+ setup_test_formula "bar"
+ setup_test_formula "baz", <<-RUBY
+ url "https://brew.sh/baz-1.0"
+ depends_on "bar"
+ depends_on :osxfuse
+ RUBY
+
+ expect(dependent.recursive_dependencies.map(&:name))
+ .to eq(%w[foo bar baz])
+ end
+ end
+
+ describe "#recursive_requirements", :integration_test do
+ it "is all the dependencies of the cask" do
+ setup_test_formula "foo"
+ setup_test_formula "bar"
+ setup_test_formula "baz", <<-RUBY
+ url "https://brew.sh/baz-1.0"
+ depends_on "bar"
+ depends_on :osxfuse
+ RUBY
+
+ expect(dependent.recursive_requirements.map(&:name))
+ .to eq(%w[foo-cask macos x11 osxfuse])
+ end
+ end
+end | true |
Other | Homebrew | brew | c1ba64677fdfd53e58af42311ea3a6551786454e.json | create: call update-python-resources for --python | Library/Homebrew/dev-cmd/create.rb | @@ -4,6 +4,7 @@
require "formula_creator"
require "missing_formula"
require "cli/parser"
+require "utils/pypi"
module Homebrew
module_function
@@ -137,6 +138,8 @@ def create
fc.generate!
+ PyPI.update_python_resources! Formula[fc.name], ignore_non_pypi_packages: true if args.python?
+
puts "Please run `brew audit --new-formula #{fc.name}` before submitting, thanks."
exec_editor fc.path
end | true |
Other | Homebrew | brew | c1ba64677fdfd53e58af42311ea3a6551786454e.json | create: call update-python-resources for --python | Library/Homebrew/formula_creator.rb | @@ -134,7 +134,7 @@ class #{Formulary.class_s(name)} < Formula
# depends_on "cmake" => :build
<% end %>
- <% if mode == :perl || mode == :python %>
+ <% if mode == :perl %>
# Additional dependency
# resource "" do
# url "" | true |
Other | Homebrew | brew | 2d99bc39723aeece8533e5b4f4314165a548420a.json | Reword formula up to date message
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com> | Library/Homebrew/dev-cmd/bump.rb | @@ -40,7 +40,7 @@ def bump
end
if requested_formula && outdated_repology_packages.nil?
- ohai "The requested formula, #{requested_formula}, is up-to-date."
+ ohai "#{requested_formula} is up-to-date!"
puts "Current version: #{get_formula_details(requested_formula).version}"
return
end | false |
Other | Homebrew | brew | 537a07b42d1e419cab678d68710ca12ce00a8f0c.json | Remove duplicate line
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com> | Library/Homebrew/utils.rb | @@ -13,7 +13,6 @@
require "utils/repology"
require "utils/svn"
require "utils/tty"
-require "utils/repology"
require "tap_constants"
require "time"
| false |
Other | Homebrew | brew | 8db11ea2d9d948c2434d4a3fa75887e8e274af91.json | Throw error exception when formula not found
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com> | Library/Homebrew/dev-cmd/bump.rb | @@ -29,7 +29,7 @@ def bump
requested_formula&.downcase!
if requested_formula && !get_formula_details(requested_formula)
- ohai "Requested formula #{requested_formula} is not valid Homebrew formula."
+ raise FormulaUnavailableError, requested_formula
return
end
| false |
Other | Homebrew | brew | 4216da7629c21be66e8cf609fdfbf133b1e6bc6f.json | deps: Move CaskDependencies to its own file | Library/Homebrew/cask_dependent.rb | @@ -0,0 +1,57 @@
+# An adapter for casks to provide dependency information in a formula-like interface
+class CaskDependent
+ def initialize(cask)
+ @cask = cask
+ end
+
+ def name
+ @cask.token
+ end
+
+ def full_name
+ @cask.full_name
+ end
+
+ def runtime_dependencies
+ recursive_dependencies
+ end
+
+ def deps
+ @deps ||= begin
+ @cask.depends_on.formula.map do |f|
+ Dependency.new f
+ end
+ end
+ end
+
+ def requirements
+ @requirements ||= begin
+ requirements = []
+ dsl_reqs = @cask.depends_on
+
+ dsl_reqs.arch&.each do |arch|
+ requirements << ArchRequirement.new([:x86_64]) if arch[:bits] == 64
+ requirements << ArchRequirement.new([arch[:type]])
+ end
+ dsl_reqs.cask.each do |cask_ref|
+ requirements << Requirement.new([{ cask: cask_ref }])
+ end
+ requirements << dsl_reqs.macos if dsl_reqs.macos
+ requirements << X11Requirement.new if dsl_reqs.x11
+
+ requirements
+ end
+ end
+
+ def recursive_dependencies(&block)
+ Dependency.expand(self, &block)
+ end
+
+ def recursive_requirements(&block)
+ Requirement.expand(self, &block)
+ end
+
+ def any_version_installed?
+ @cask.installed?
+ end
+end | true |
Other | Homebrew | brew | 4216da7629c21be66e8cf609fdfbf133b1e6bc6f.json | deps: Move CaskDependencies to its own file | Library/Homebrew/cmd/deps.rb | @@ -115,7 +115,7 @@ def dependents(formulae_or_casks)
if formula_or_cask.is_a?(Formula)
formula_or_cask
else
- Dependent.new(formula_or_cask)
+ CaskDependent.new(formula_or_cask)
end
end
end
@@ -229,61 +229,4 @@ def recursive_deps_tree(f, prefix, recursive)
@dep_stack.pop
end
-
- class Dependent
- def initialize(cask)
- @cask = cask
- end
-
- def name
- @cask.token
- end
-
- def full_name
- @cask.full_name
- end
-
- def runtime_dependencies
- recursive_dependencies
- end
-
- def deps
- @deps ||= begin
- @cask.depends_on.formula.map do |f|
- Dependency.new f
- end
- end
- end
-
- def requirements
- @requirements ||= begin
- requirements = []
- dsl_reqs = @cask.depends_on
-
- dsl_reqs.arch&.each do |arch|
- requirements << ArchRequirement.new([:x86_64]) if arch[:bits] == 64
- requirements << ArchRequirement.new([arch[:type]])
- end
- dsl_reqs.cask.each do |cask_ref|
- requirements << Requirement.new([{ cask: cask_ref }])
- end
- requirements << dsl_reqs.macos if dsl_reqs.macos
- requirements << X11Requirement.new if dsl_reqs.x11
-
- requirements
- end
- end
-
- def recursive_dependencies(&block)
- Dependency.expand(self, &block)
- end
-
- def recursive_requirements(&block)
- Requirement.expand(self, &block)
- end
-
- def any_version_installed?
- @cask.installed?
- end
- end
end | true |
Other | Homebrew | brew | 92a39bc49e0dbbd1e766d9262816e48943339498.json | test: add flag to retry.
This should allow better handling flaky tests. | Library/Homebrew/dev-cmd/test.rb | @@ -25,6 +25,8 @@ def test_args
description: "Test the head version of a formula."
switch "--keep-tmp",
description: "Retain the temporary files created for the test."
+ switch "--retry",
+ description: "Retry if a testing fails."
switch :verbose
switch :debug
conflicts "--devel", "--HEAD"
@@ -70,7 +72,7 @@ def test
next
end
- puts "Testing #{f.full_name}"
+ oh1 "Testing #{f.full_name}"
env = ENV.to_hash
@@ -108,11 +110,24 @@ def test
end
end
rescue Exception => e # rubocop:disable Lint/RescueException
+ retry if retry_test?(f)
ofail "#{f.full_name}: failed"
puts e, e.backtrace
ensure
ENV.replace(env)
end
end
end
+
+ def retry_test?(f)
+ @test_failed ||= Set.new
+ if args.retry? && @test_failed.add?(f)
+ oh1 "Testing #{f.full_name} (again)"
+ f.clear_cache
+ true
+ else
+ Homebrew.failed = true
+ false
+ end
+ end
end | true |
Other | Homebrew | brew | 92a39bc49e0dbbd1e766d9262816e48943339498.json | test: add flag to retry.
This should allow better handling flaky tests. | docs/Manpage.md | @@ -1036,6 +1036,8 @@ wrong with the installed formula.
Test the head version of a formula.
* `--keep-tmp`:
Retain the temporary files created for the test.
+* `--retry`:
+ Retry if a testing fails.
### `tests` [*`options`*]
| true |
Other | Homebrew | brew | 92a39bc49e0dbbd1e766d9262816e48943339498.json | test: add flag to retry.
This should allow better handling flaky tests. | manpages/brew.1 | @@ -1351,6 +1351,10 @@ Test the head version of a formula\.
\fB\-\-keep\-tmp\fR
Retain the temporary files created for the test\.
.
+.TP
+\fB\-\-retry\fR
+Retry if a testing fails\.
+.
.SS "\fBtests\fR [\fIoptions\fR]"
Run Homebrew\'s unit and integration tests\.
. | true |
Other | Homebrew | brew | 560681729382916b4a84bc05ab540dd9f13be2a1.json | info: handle license array.
Fixes https://github.com/Homebrew/brew/issues/8132 | Library/Homebrew/cmd/info.rb | @@ -211,7 +211,7 @@ def info_formula(f, args:)
puts "From: #{Formatter.url(github_info(f))}"
- puts "License: #{f.license}" if f.license
+ puts "License: #{f.license.join(", ")}" if f.license
unless f.deps.empty?
ohai "Dependencies" | false |
Other | Homebrew | brew | 6fe56c33ffa51cd0a895099f5d86d691e41d4669.json | pr-upload: use PkgVersion.parse instead of Version.new | Library/Homebrew/dev-cmd/pr-upload.rb | @@ -40,7 +40,7 @@ def check_bottled_formulae(json_files)
hashes.each do |name, hash|
formula_path = HOMEBREW_REPOSITORY/hash["formula"]["path"]
formula_version = Formulary.factory(formula_path).pkg_version
- bottle_version = Version.new hash["formula"]["pkg_version"]
+ bottle_version = PkgVersion.parse hash["formula"]["pkg_version"]
next if formula_version == bottle_version
odie "Bottles are for #{name} #{bottle_version} but formula is version #{formula_version}!" | false |
Other | Homebrew | brew | 3ee158bf16882c1a0c8b83f292ff303e7bef410e.json | pr-upload: fix formula version | Library/Homebrew/dev-cmd/pr-upload.rb | @@ -39,7 +39,7 @@ def check_bottled_formulae(json_files)
hashes.each do |name, hash|
formula_path = HOMEBREW_REPOSITORY/hash["formula"]["path"]
- formula_version = Formulary.factory(formula_path).version
+ formula_version = Formulary.factory(formula_path).pkg_version
bottle_version = Version.new hash["formula"]["pkg_version"]
next if formula_version == bottle_version
| false |
Other | Homebrew | brew | 41bc670abbf116e90e54ed6b4e5aa8d7285b765f.json | update patchelf.rb to 1.2.0 in Gemfile.lock. | Library/Homebrew/Gemfile.lock | @@ -55,7 +55,7 @@ GEM
parallel
parser (2.7.1.4)
ast (~> 2.4.1)
- patchelf (1.1.1)
+ patchelf (1.2.0)
elftools (~> 1.1)
plist (3.5.0)
rainbow (3.0.0) | false |
Other | Homebrew | brew | 2822a7b0c3276fcab8335374bc305d048c10feba.json | adapt output to adjust for single-formula queries | Library/Homebrew/dev-cmd/bump.rb | @@ -39,12 +39,19 @@ def bump
Repology.parse_api_response
end
+ if requested_formula && outdated_repology_packages.nil?
+ ohai "The requested formula, #{requested_formula}, is up-to-date."
+ puts "Current version: #{get_formula_details(requested_formula).version}"
+ return
+ end
+
outdated_packages = validate_and_format_packages(outdated_repology_packages)
display(outdated_packages)
end
def validate_and_format_packages(outdated_repology_packages)
- ohai "Verifying outdated repology packages as Homebrew formulae"
+ ohai "Verifying outdated repology #{"package".pluralize(outdated_repology_packages.size)} " \
+ "as Homebrew #{"formula".pluralize(outdated_repology_packages.size)}"
packages = {}
outdated_repology_packages.each do |_name, repositories|
@@ -118,7 +125,7 @@ def parse_livecheck_response(response)
end
def display(outdated_packages)
- ohai "Outdated formulae"
+ ohai "Outdated #{"formula".pluralize(outdated_packages.size)}"
puts
outdated_packages.each do |formula, package_details|
ohai formula | true |
Other | Homebrew | brew | 2822a7b0c3276fcab8335374bc305d048c10feba.json | adapt output to adjust for single-formula queries | Library/Homebrew/utils/repology.rb | @@ -19,7 +19,13 @@ def single_package_query(name)
url = "https://repology.org/api/v1/project/#{name}"
output, _errors, _status = curl_output(url.to_s)
- { name: JSON.parse(output) }
+ data = JSON.parse(output)
+
+ outdated_homebrew = data.select do |repo|
+ repo["repo"] == "homebrew" && repo["status"] == "outdated"
+ end
+
+ outdated_homebrew.empty? ? nil : { name: data }
end
def parse_api_response | true |
Other | Homebrew | brew | 4bd6c343d0906c3ae7c93926ea41fc64f1b05e46.json | dev-cmd/audit: enforce uses_from_macos only if core tap | Library/Homebrew/dev-cmd/audit.rb | @@ -388,7 +388,8 @@ def audit_deps
"use the canonical name '#{dep.to_formula.full_name}'."
end
- if @new_formula &&
+ if @core_tap &&
+ @new_formula &&
dep_f.keg_only? &&
dep_f.keg_only_reason.provided_by_macos? &&
dep_f.keg_only_reason.applicable? && | true |
Other | Homebrew | brew | 4bd6c343d0906c3ae7c93926ea41fc64f1b05e46.json | dev-cmd/audit: enforce uses_from_macos only if core tap | Library/Homebrew/test/dev-cmd/audit_spec.rb | @@ -343,7 +343,7 @@ class Foo < Formula
subject { fa }
let(:fa) do
- formula_auditor "foo", <<~RUBY, new_formula: true
+ formula_auditor "foo", <<~RUBY, new_formula: true, core_tap: true
class Foo < Formula
url "https://brew.sh/foo-1.0.tgz"
homepage "https://brew.sh" | true |
Other | Homebrew | brew | 67a974455be98319deb2f384750c98e19f9d0571.json | Apply suggestions from code review
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com> | Library/Homebrew/formula_installer.rb | @@ -1123,7 +1123,7 @@ def forbidden_license_check
next if @ignore_deps
dep_f = dep.to_formula
- next unless dep_f.license.all? { |lic| forbidden_licenses.include? lic }
+ next unless dep_f.license.all? { |license| forbidden_licenses.include? license }
raise CannotInstallFormulaError, <<~EOS
The installation of #{formula.name} has a dependency on #{dep.name} where all its licenses are forbidden: #{dep_f.license}. | false |
Other | Homebrew | brew | 52321b4fcdf4bea64ca5c57e0171a5d36f37085f.json | Apply suggestions from code review
Code review changes
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com> | Library/Homebrew/dev-cmd/audit.rb | @@ -331,14 +331,14 @@ def audit_formula_name
def audit_license
if formula.license.present?
non_standard_licenses = []
- formula.license.each do |lic|
- next if @spdx_data["licenses"].any? { |standard_lic| standard_lic["licenseId"] == lic }
+ formula.license.each do |license|
+ next if @spdx_data["licenses"].any? { |spdx| spdx["licenseId"] == license }
- non_standard_licenses << lic
+ non_standard_licenses << license
end
if non_standard_licenses.present?
- problem "Formula #{formula.name} contains non standard SPDX license: #{non_standard_licenses}."
+ problem "Formula #{formula.name} contains non-standard SPDX licenses: #{non_standard_licenses}."
end
return unless @online | true |
Other | Homebrew | brew | 52321b4fcdf4bea64ca5c57e0171a5d36f37085f.json | Apply suggestions from code review
Code review changes
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com> | Library/Homebrew/formula.rb | @@ -2215,7 +2215,7 @@ def license(args = nil)
if args.nil?
@licenses
else
- @licenses = Array(args) unless args == ""
+ @licenses = Array(args)
end
end
| true |
Other | Homebrew | brew | 52321b4fcdf4bea64ca5c57e0171a5d36f37085f.json | Apply suggestions from code review
Code review changes
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com> | Library/Homebrew/formula_installer.rb | @@ -1131,7 +1131,7 @@ def forbidden_license_check
end
return if @only_deps
- return unless formula.license.all? { |lic| forbidden_licenses.include? lic }
+ return unless formula.license.all? { |license| forbidden_licenses.include? license }
raise CannotInstallFormulaError, <<~EOS
#{formula.name}'s licenses are all forbidden: #{formula.license}. | true |
Other | Homebrew | brew | 557b1d09a2c228a38d9c0792e5685541d0b8a6cc.json | correct logic for standard license checking | Library/Homebrew/dev-cmd/audit.rb | @@ -330,7 +330,16 @@ def audit_formula_name
def audit_license
if formula.license.present?
- if formula.license.any? { |lic| @spdx_data["licenses"].any? { |standard_lic| standard_lic["licenseId"] == lic } }
+ non_standard_licenses = []
+ formula.license.each do |lic|
+ next if @spdx_data["licenses"].any? { |standard_lic| standard_lic["licenseId"] == lic }
+ non_standard_licenses << lic
+ end
+
+ if non_standard_licenses.present?
+ problem "Formula #{formula.name} contains non standard SPDX license: #{non_standard_licenses} "
+ end
+
return unless @online
user, repo = get_repo_data(%r{https?://github\.com/([^/]+)/([^/]+)/?.*}) if @new_formula
@@ -341,9 +350,8 @@ def audit_license
problem "License mismatch - GitHub license is: #{Array(github_license)}, "\
"but Formulae license states: #{formula.license}."
- else
- problem "#{formula.license} is not a standard SPDX license."
- end
+
+
elsif @new_formula
problem "No license specified for package."
end | false |
Other | Homebrew | brew | b91587d1716636b345f13e6829e04ab3a684d5ed.json | audit-license: adapt code to use Array of licenses | Library/Homebrew/dev-cmd/audit.rb | @@ -330,16 +330,16 @@ def audit_formula_name
def audit_license
if formula.license.present?
- if @spdx_data["licenses"].any? { |lic| lic["licenseId"] == formula.license }
+ if formula.license.any? { |lic| @spdx_data["licenses"].any? { |standard_lic| standard_lic["licenseId"] == lic } }
return unless @online
user, repo = get_repo_data(%r{https?://github\.com/([^/]+)/([^/]+)/?.*}) if @new_formula
return if user.blank?
github_license = GitHub.get_repo_license(user, repo)
- return if github_license && [formula.license, "NOASSERTION"].include?(github_license)
+ return if github_license && (formula.license + ["NOASSERTION"]).include?(github_license)
- problem "License mismatch - GitHub license is: #{github_license}, "\
+ problem "License mismatch - GitHub license is: #{Array(github_license)}, "\
"but Formulae license states: #{formula.license}."
else
problem "#{formula.license} is not a standard SPDX license." | false |
Other | Homebrew | brew | 9a2f84d4a553b79e5f08e7c440a3d2108033a946.json | Modify to_hash output | Library/Homebrew/formula.rb | @@ -1682,7 +1682,7 @@ def to_hash
"aliases" => aliases.sort,
"versioned_formulae" => versioned_formulae.map(&:name),
"desc" => desc,
- "license" => license.class == String ? [license] : license,
+ "license" => license,
"homepage" => homepage,
"versions" => {
"stable" => stable&.version&.to_s, | false |
Other | Homebrew | brew | 3d27894015962a780dc3624ea6284eb303824bef.json | Apply suggestions from code review
Code review changes
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com> | Library/Homebrew/formula.rb | @@ -2208,13 +2208,15 @@ def method_added(method)
# @!attribute [w]
# The SPDX ID of the open-source license that the formula uses.
# Shows when running `brew info`.
+ # Multiple licenses means that the software is licensed under multiple licenses.
+ # Do not use multiple licenses if e.g. different parts are under different licenses.
#
# <pre>license "BSD-2-Clause"</pre>
- def license args=nil
- if args.blank?
+ def license(args = nil)
+ if args.nil?
return @licenses
else
- @licenses = args.class == String ? [args] : args
+ @licenses = Array(args)
puts @licenses
# license.
end | false |
Other | Homebrew | brew | 23340403c15c4ff814eb7a66d77a71bb57a35d09.json | Fix `effective_arch` on Linux. | Library/Homebrew/extend/os/linux/extend/ENV/shared.rb | @@ -3,9 +3,9 @@
module SharedEnvExtension
# @private
def effective_arch
- if @args&.build_bottle? && @args&.bottle_arch
- @args.bottle_arch.to_sym
- elsif @args&.build_bottle?
+ if @build_bottle && @bottle_arch
+ @bottle_arch.to_sym
+ elsif @build_bottle
Hardware.oldest_cpu
else
:native | false |
Other | Homebrew | brew | 0be15fc4b731850e1f519c7936182842bbd40de4.json | Run `brew update` before `brew bundle`.
This should help with cases like
https://github.com/Homebrew/homebrew-bundle/issues/751
and is good practise in general.
Also, document the `brew update --preinstall` flag that is being used
here so others can run it manually e.g. as part of CI if needed. | Library/Homebrew/brew.sh | @@ -518,6 +518,7 @@ update-preinstall() {
if [[ "$HOMEBREW_COMMAND" = "install" || "$HOMEBREW_COMMAND" = "upgrade" ||
"$HOMEBREW_COMMAND" = "bump-formula-pr" ||
+ "$HOMEBREW_COMMAND" = "bundle" ||
"$HOMEBREW_COMMAND" = "tap" && $HOMEBREW_ARG_COUNT -gt 1 ||
"$HOMEBREW_CASK_COMMAND" = "install" || "$HOMEBREW_CASK_COMMAND" = "upgrade" ]]
then | true |
Other | Homebrew | brew | 0be15fc4b731850e1f519c7936182842bbd40de4.json | Run `brew update` before `brew bundle`.
This should help with cases like
https://github.com/Homebrew/homebrew-bundle/issues/751
and is good practise in general.
Also, document the `brew update --preinstall` flag that is being used
here so others can run it manually e.g. as part of CI if needed. | Library/Homebrew/cmd/update.sh | @@ -1,8 +1,9 @@
-#: * `update`, `up` [<options>]
+#: * `update` [<options>]
#:
#: Fetch the newest version of Homebrew and all formulae from GitHub using `git`(1) and perform any necessary migrations.
#:
#: --merge Use `git merge` to apply updates (rather than `git rebase`).
+#: --preinstall Run on auto-updates (e.g. before `brew install`). Skips some slower steps.
#: -f, --force Always do a slower, full update check (even if unnecessary).
#: -v, --verbose Print the directories checked and `git` operations performed.
#: -d, --debug Display a trace of all shell commands as they are executed. | true |
Other | Homebrew | brew | 0be15fc4b731850e1f519c7936182842bbd40de4.json | Run `brew update` before `brew bundle`.
This should help with cases like
https://github.com/Homebrew/homebrew-bundle/issues/751
and is good practise in general.
Also, document the `brew update --preinstall` flag that is being used
here so others can run it manually e.g. as part of CI if needed. | docs/Manpage.md | @@ -517,12 +517,14 @@ also `pin`.
Remove a tapped formula repository.
-### `update`, `up` [*`options`*]
+### `update` [*`options`*]
Fetch the newest version of Homebrew and all formulae from GitHub using `git`(1) and perform any necessary migrations.
* `--merge`:
Use `git merge` to apply updates (rather than `git rebase`).
+* `--preinstall`:
+ Run on auto-updates (e.g. before `brew install`). Skips some slower steps.
### `update-reset` [*`repository`*]
| true |
Other | Homebrew | brew | 0be15fc4b731850e1f519c7936182842bbd40de4.json | Run `brew update` before `brew bundle`.
This should help with cases like
https://github.com/Homebrew/homebrew-bundle/issues/751
and is good practise in general.
Also, document the `brew update --preinstall` flag that is being used
here so others can run it manually e.g. as part of CI if needed. | manpages/brew.1 | @@ -671,13 +671,17 @@ Unpin \fIformula\fR, allowing them to be upgraded by \fBbrew upgrade\fR \fIformu
.SS "\fBuntap\fR \fItap\fR"
Remove a tapped formula repository\.
.
-.SS "\fBupdate\fR, \fBup\fR [\fIoptions\fR]"
+.SS "\fBupdate\fR [\fIoptions\fR]"
Fetch the newest version of Homebrew and all formulae from GitHub using \fBgit\fR(1) and perform any necessary migrations\.
.
.TP
\fB\-\-merge\fR
Use \fBgit merge\fR to apply updates (rather than \fBgit rebase\fR)\.
.
+.TP
+\fB\-\-preinstall\fR
+Run on auto\-updates (e\.g\. before \fBbrew install\fR)\. Skips some slower steps\.
+.
.SS "\fBupdate\-reset\fR [\fIrepository\fR]"
Fetch and reset Homebrew and all tap repositories (or any specified \fIrepository\fR) using \fBgit\fR(1) to their latest \fBorigin/master\fR\.
. | true |
Other | Homebrew | brew | 7d7b80774e5aa59b531fd6bcc6655d857cee75a8.json | pr-publish: use workflow_dispatch trigger | Library/Homebrew/dev-cmd/pr-publish.rb | @@ -16,6 +16,8 @@ def pr_publish_args
EOS
flag "--tap=",
description: "Target tap repository (default: `homebrew/core`)."
+ flag "--workflow=",
+ description: "Target workflow filename (default: `publish-commit-bottles.yml`)."
switch :verbose
min_named 1
end
@@ -25,6 +27,8 @@ def pr_publish
pr_publish_args.parse
tap = Tap.fetch(Homebrew.args.tap || CoreTap.instance.name)
+ workflow = Homebrew.args.workflow || "publish-commit-bottles.yml"
+ ref = "master"
args.named.uniq.each do |arg|
arg = "#{tap.default_remote}/pull/#{arg}" if arg.to_i.positive?
@@ -36,7 +40,7 @@ def pr_publish
end
ohai "Dispatching #{tap} pull request ##{issue}"
- GitHub.dispatch_event(user, repo, "Publish ##{issue}", pull_request: issue)
+ GitHub.workflow_dispatch_event(user, repo, workflow, ref, pull_request: issue)
end
end
end | true |
Other | Homebrew | brew | 7d7b80774e5aa59b531fd6bcc6655d857cee75a8.json | pr-publish: use workflow_dispatch trigger | docs/Manpage.md | @@ -901,6 +901,8 @@ the repository.
* `--tap`:
Target tap repository (default: `homebrew/core`).
+* `--workflow`:
+ Target workflow filename (default: `publish-commit-bottles.yml`).
### `pr-pull` [*`options`*] *`pull_request`* [*`pull_request`* ...]
| true |
Other | Homebrew | brew | 7d7b80774e5aa59b531fd6bcc6655d857cee75a8.json | pr-publish: use workflow_dispatch trigger | manpages/brew.1 | @@ -1175,6 +1175,10 @@ Publish bottles for a pull request with GitHub Actions\. Requires write access t
\fB\-\-tap\fR
Target tap repository (default: \fBhomebrew/core\fR)\.
.
+.TP
+\fB\-\-workflow\fR
+Target workflow filename (default: \fBpublish\-commit\-bottles\.yml\fR)\.
+.
.SS "\fBpr\-pull\fR [\fIoptions\fR] \fIpull_request\fR [\fIpull_request\fR \.\.\.]"
Download and publish bottles, and apply the bottle commit from a pull request with artifacts generated by GitHub Actions\. Requires write access to the repository\.
. | true |
Other | Homebrew | brew | bf9659423a0954482a0bd62f5130e41fe9831c39.json | Increase timeout for some integration tests. | Library/Homebrew/test/cmd/reinstall_spec.rb | @@ -7,7 +7,7 @@
it_behaves_like "parseable arguments"
end
-describe "brew reinstall", :integration_test do
+describe "brew reinstall", :integration_test, timeout: 120 do
it "reinstalls a Formula" do
install_test_formula "testball"
foo_dir = HOMEBREW_CELLAR/"testball/0.1/bin" | true |
Other | Homebrew | brew | bf9659423a0954482a0bd62f5130e41fe9831c39.json | Increase timeout for some integration tests. | Library/Homebrew/test/dev-cmd/test_spec.rb | @@ -7,7 +7,7 @@
end
# randomly segfaults on Linux with portable-ruby.
-describe "brew test", :integration_test, :needs_macos do
+describe "brew test", :integration_test, :needs_macos, timeout: 120 do
it "tests a given Formula" do
install_test_formula "testball", <<~'RUBY'
test do | true |
Other | Homebrew | brew | 367de3523ae7ae1146b092dbaca3720df9e336c2.json | pr-automerge: fix variable name | Library/Homebrew/dev-cmd/pr-automerge.rb | @@ -40,7 +40,7 @@ def pr_automerge
query = "is:pr is:open repo:#{tap.full_name}"
query += Homebrew.args.ignore_failures? ? " -status:pending" : " status:success"
query += " review:approved" unless Homebrew.args.without_approval?
- query += " label:\"#{with_label}\"" if Homebrew.args.with_label
+ query += " label:\"#{args.with_label}\"" if Homebrew.args.with_label
without_labels&.each { |label| query += " -label:\"#{label}\"" }
odebug "Searching: #{query}"
| false |
Other | Homebrew | brew | a8e524d3345271dc350093ed54be008fa436cb0b.json | bottle: fix inreplace string | Library/Homebrew/dev-cmd/bottle.rb | @@ -484,7 +484,7 @@ def merge
update_or_add = "update"
if args.keep_old?
mismatches = []
- bottle_block_contents = s[/ bottle do(.+?)end\n/m, 1]
+ bottle_block_contents = s.inreplace_string[/ bottle do(.+?)end\n/m, 1]
bottle_block_contents.lines.each do |line|
line = line.strip
next if line.empty? | false |
Other | Homebrew | brew | cff79348c91cc9060eab33840b18a8a54c51fbf4.json | dev-cmd/bump-formula-pr.rb: fix StringInreplaceExtension usage | Library/Homebrew/dev-cmd/bump-formula-pr.rb | @@ -445,8 +445,8 @@ def forked_repo_info(formula, tap_full_name, old_contents)
def inreplace_pairs(path, replacement_pairs)
if args.dry_run?
- contents = path.open("r") { |f| Formulary.ensure_utf8_encoding(f).read }
- contents.extend(StringInreplaceExtension)
+ str = path.open("r") { |f| Formulary.ensure_utf8_encoding(f).read }
+ contents = StringInreplaceExtension.new(str)
replacement_pairs.each do |old, new|
ohai "replace #{old.inspect} with #{new.inspect}" unless args.quiet?
raise "No old value for new value #{new}! Did you pass the wrong arguments?" unless old
@@ -455,8 +455,8 @@ def inreplace_pairs(path, replacement_pairs)
end
raise Utils::InreplaceError, path => contents.errors unless contents.errors.empty?
- path.atomic_write(contents) if args.write?
- contents
+ path.atomic_write(contents.inreplace_string) if args.write?
+ contents.inreplace_string
else
Utils::Inreplace.inreplace(path) do |s|
replacement_pairs.each do |old, new| | false |
Other | Homebrew | brew | f8708ae80c38bff2b5c2ca76d509abe0cc6f3df6.json | Add todo for --json=v1 deprecation | Library/Homebrew/cmd/outdated.rb | @@ -46,7 +46,8 @@ def outdated
case json_version
when :v1
- odeprecated "brew outdated --json=v1", "brew outdated --json=v2"
+ # TODO: enable for next major/minor release
+ # odeprecated "brew outdated --json=v1", "brew outdated --json=v2"
outdated = if args.formula? || !args.cask?
outdated_formulae | false |
Other | Homebrew | brew | 09dcdc2a6b86df92409c7c5865f48063d4680a90.json | README.md: Add link to Homebrew blog
Inspired by https://github.com/Homebrew/brew/issues/8096 and https://github.com/Homebrew/brew/pull/8098. I think the blog is an important way for regular users to keep up-to-date with Homebrew evolution, so it deserves an entry in the main docs page.
Update docs/README.md
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com> | docs/README.md | @@ -3,6 +3,7 @@
## Users
- [`brew` man-page (command documentation)](Manpage.md)
+- [Homebrew Blog (news on major updates)](https://brew.sh/blog/)
- [Troubleshooting](Troubleshooting.md)
- [Installation](Installation.md)
- [Frequently Asked Questions](FAQ.md) | false |
Other | Homebrew | brew | 95cef86f885cf40f791769ef903cc2b43d4941a1.json | Add link to Homebrew blog in CHANGELOG.md | CHANGELOG.md | @@ -1 +1,3 @@
See Homebrew's [releases on GitHub](https://github.com/Homebrew/brew/releases) for the changelog.
+
+Release notes for major and minor releases can also be found in the [Homebrew blog](https://brew.sh/blog/). | false |
Other | Homebrew | brew | 2188b268de15935b848a6a5ac8ee4efa1cea4d60.json | Apply suggestions from code review
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com> | Library/Homebrew/cmd/commands.rb | @@ -33,18 +33,19 @@ def commands
prepend_separator = false
- { "Built-in commands" => Commands.internal_commands,
+ {
+ "Built-in commands" => Commands.internal_commands,
"Built-in developer commands" => Commands.internal_developer_commands,
"External commands" => Commands.external_commands,
"Cask commands" => Commands.cask_internal_commands,
- "External cask commands" => Commands.cask_external_commands }
- .each do |title, commands|
- next if commands.blank?
+ "External cask commands" => Commands.cask_external_commands,
+ }.each do |title, commands|
+ next if commands.blank?
puts if prepend_separator
ohai title, Formatter.columns(commands)
- prepend_separator = true
+ prepend_separator ||= true
end
end
end | false |
Other | Homebrew | brew | 791774691a7543f1fd7f046e1df058045d136f86.json | sorbet: update hidden definitions | Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi | @@ -6840,6 +6840,130 @@ module Docile
def self.dsl_eval_with_block_return(dsl, *args, &block); end
end
+module ELFTools
+ VERSION = ::T.let(nil, ::T.untyped)
+end
+
+class ELFTools::Structs::ELF32_PhdrBe
+end
+
+class ELFTools::Structs::ELF32_PhdrBe
+end
+
+class ELFTools::Structs::ELF32_PhdrLe
+end
+
+class ELFTools::Structs::ELF32_PhdrLe
+end
+
+class ELFTools::Structs::ELF32_symBe
+end
+
+class ELFTools::Structs::ELF32_symBe
+end
+
+class ELFTools::Structs::ELF32_symLe
+end
+
+class ELFTools::Structs::ELF32_symLe
+end
+
+class ELFTools::Structs::ELF64_PhdrBe
+end
+
+class ELFTools::Structs::ELF64_PhdrBe
+end
+
+class ELFTools::Structs::ELF64_PhdrLe
+end
+
+class ELFTools::Structs::ELF64_PhdrLe
+end
+
+class ELFTools::Structs::ELF64_symBe
+end
+
+class ELFTools::Structs::ELF64_symBe
+end
+
+class ELFTools::Structs::ELF64_symLe
+end
+
+class ELFTools::Structs::ELF64_symLe
+end
+
+class ELFTools::Structs::ELF_DynBe
+end
+
+class ELFTools::Structs::ELF_DynBe
+end
+
+class ELFTools::Structs::ELF_DynLe
+end
+
+class ELFTools::Structs::ELF_DynLe
+end
+
+class ELFTools::Structs::ELF_EhdrBe
+end
+
+class ELFTools::Structs::ELF_EhdrBe
+end
+
+class ELFTools::Structs::ELF_EhdrLe
+end
+
+class ELFTools::Structs::ELF_EhdrLe
+end
+
+class ELFTools::Structs::ELF_NhdrBe
+end
+
+class ELFTools::Structs::ELF_NhdrBe
+end
+
+class ELFTools::Structs::ELF_NhdrLe
+end
+
+class ELFTools::Structs::ELF_NhdrLe
+end
+
+class ELFTools::Structs::ELF_RelBe
+end
+
+class ELFTools::Structs::ELF_RelBe
+end
+
+class ELFTools::Structs::ELF_RelLe
+end
+
+class ELFTools::Structs::ELF_RelLe
+end
+
+class ELFTools::Structs::ELF_RelaBe
+end
+
+class ELFTools::Structs::ELF_RelaBe
+end
+
+class ELFTools::Structs::ELF_RelaLe
+end
+
+class ELFTools::Structs::ELF_RelaLe
+end
+
+class ELFTools::Structs::ELF_ShdrBe
+end
+
+class ELFTools::Structs::ELF_ShdrBe
+end
+
+class ELFTools::Structs::ELF_ShdrLe
+end
+
+class ELFTools::Structs::ELF_ShdrLe
+end
+
class ERB
def def_method(mod, methodname, fname=T.unsafe(nil)); end
| false |
Other | Homebrew | brew | f6cdd6b37bea286dc8a58af6035b8ef72bb57cf7.json | sorbet/files.yaml: add new file | Library/Homebrew/sorbet/files.yaml | @@ -604,6 +604,7 @@ false:
- ./test/options_spec.rb
- ./test/os/linux/diagnostic_spec.rb
- ./test/os/linux/formula_spec.rb
+ - ./test/os/linux/pathname_spec.rb
- ./test/os/mac/dependency_collector_spec.rb
- ./test/os/mac/java_requirement_spec.rb
- ./test/os/mac/keg_spec.rb | false |
Other | Homebrew | brew | c27916cd8723b279b0c36d3d7f3ec01c76823990.json | srb/inreplace.rbi: add method signatures | Library/Homebrew/sorbet/rbi/utils/inreplace.rbi | @@ -16,12 +16,15 @@ class StringInreplaceExtension
sig { params(before: T.nilable(String), after: T.nilable(String), audit_result: T::Boolean).returns(T.nilable(String)) }
def gsub!(before, after, audit_result = true); end
+ sig {params(flag: String, new_value: String).void}
def change_make_var!(flag, new_value)
end
+ sig {params(flags: T::Array[String]).void}
def remove_make_var!(flags)
end
+ sig {params(flag: String).returns(String)}
def get_make_var(flag)
end
end | false |
Other | Homebrew | brew | c56f47c1ee2ae208dd8333095f45d18acceaa58d.json | use main branch for setup-ruby action | .github/workflows/tests.yml | @@ -53,7 +53,7 @@ jobs:
- name: Set up Ruby
if: matrix.os == 'ubuntu-latest'
- uses: actions/setup-ruby@master
+ uses: actions/setup-ruby@main
with:
ruby-version: '2.6'
| false |
Other | Homebrew | brew | ec81d43519e9d334f994c8dc10fdba17779def82.json | increase readall test timeout | Library/Homebrew/test/cmd/readall_spec.rb | @@ -6,7 +6,7 @@
it_behaves_like "parseable arguments"
end
-describe "brew readall", :integration_test, timeout: 180 do
+describe "brew readall", :integration_test, timeout: 240 do
it "imports all Formulae for a given Tap" do
formula_file = setup_test_formula "testball"
| false |
Other | Homebrew | brew | 9f296aa6ac308a32f4602de4421fd2a0f561c103.json | bintray: Fix "uninitialized constant EnvConfig" errors
- This fix was suggested by Sorbet when I ran `HOMEBREW_SORBET=1 bundle
exec srb tc` on the latest `master` while playing around with the
latest changes post-GSoC meeting.
- Then I noticed it was actually a bug, introduced in
adc36a05ffeadb54b94c87d86f62fba9dbb86795, found by us not being able to
publish bottles for [this build of the `n`
formula](https://github.com/Homebrew/homebrew-core/runs/910309641?check_suite_focus=true)
in https://github.com/Homebrew/homebrew-core/pull/58606:
```
[master 31d32307bd] n: update 6.7.0 bottle.
1 file changed, 3 insertions(+), 3 deletions(-)
curl: (22) The requested URL returned error: 404 Not Found
Error: uninitialized constant Bintray::EnvConfig
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/bintray.rb:28:in `open_api'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/bintray.rb:43:in `upload'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/bintray.rb:186:in `block (2 levels) in upload_bottle_json'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/bintray.rb:158:in `each'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/bintray.rb:158:in `block in upload_bottle_json'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/bintray.rb:153:in `each'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/bintray.rb:153:in `upload_bottle_json'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/dev-cmd/pr-upload.rb:54:in `pr_upload'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb:111:in `<main>'
Error: Failure while executing; `/home/linuxbrew/.linuxbrew/bin/brew pr-upload --verbose --bintray-org=homebrew` exited with 1.
``` | Library/Homebrew/bintray.rb | @@ -25,8 +25,8 @@ def open_api(url, *extra_curl_args, auth: true)
args = extra_curl_args
if auth
- raise UsageError, "HOMEBREW_BINTRAY_USER is unset." unless (user = EnvConfig.bintray_user)
- raise UsageError, "HOMEBREW_BINTRAY_KEY is unset." unless (key = EnvConfig.bintray_key)
+ raise UsageError, "HOMEBREW_BINTRAY_USER is unset." unless (user = Homebrew::EnvConfig.bintray_user)
+ raise UsageError, "HOMEBREW_BINTRAY_KEY is unset." unless (key = Homebrew::EnvConfig.bintray_key)
args += ["--user", "#{user}:#{key}"]
end | false |
Other | Homebrew | brew | ad4fd55b78772d456b3c8ed84436a6c86212a8f7.json | audit: add gitless and telegram-cli to prerelease list
In support of #8075. Both formulae been on prerelease up till now. | Library/Homebrew/dev-cmd/audit.rb | @@ -632,7 +632,10 @@ def get_repo_data(regex)
"libepoxy" => "1.5",
}.freeze
- GITHUB_PRERELEASE_ALLOWLIST = %w[].freeze
+ GITHUB_PRERELEASE_ALLOWLIST = {
+ "gitless" => "0.8.8",
+ "telegram-cli" => "1.3.1",
+ }.freeze
# version_prefix = stable_version_string.sub(/\d+$/, "")
# version_prefix = stable_version_string.split(".")[0..1].join(".") | false |
Other | Homebrew | brew | 62ca046390ef3da606c50db4a27d79455f23aacf.json | pr-automerge: pass proper tap variable
Co-authored-by: Jonathan Chang <jchang641@gmail.com> | Library/Homebrew/dev-cmd/pr-automerge.rb | @@ -59,7 +59,7 @@ def pr_automerge
if args.publish?
publish_args = ["pr-publish"]
- publish_args << "--tap=#{args.tap}" if args.tap
+ publish_args << "--tap=#{tap}" if tap
safe_system HOMEBREW_BREW_FILE, *publish_args, *pr_urls
else
ohai "Now run:", " brew pr-publish \\\n #{pr_urls.join " \\\n "}" | false |
Other | Homebrew | brew | a895f398edae9da096950bcd68eefa2d233fa137.json | Use `BuildError#formula` instead of `args`. | Library/Homebrew/brew.rb | @@ -150,7 +150,7 @@ def output_unsupported_error
Utils::Analytics.report_build_error(e)
e.dump
- output_unsupported_error if Homebrew.args.HEAD? || e.formula.deprecated? || e.formula.disabled?
+ output_unsupported_error if e.formula.head? || e.formula.deprecated? || e.formula.disabled?
exit 1
rescue RuntimeError, SystemCallError => e | false |
Other | Homebrew | brew | bf13db3367fc474d9f012984ddd482ae06a01ad8.json | Make `Parser#parse` return `args`. | Library/Homebrew/cli/parser.rb | @@ -171,7 +171,7 @@ def parse(argv = @argv, allow_no_named_args: false)
Homebrew.args = @args
@args_parsed = true
- @parser
+ @args
end
def global_option?(name, desc) | true |
Other | Homebrew | brew | bf13db3367fc474d9f012984ddd482ae06a01ad8.json | Make `Parser#parse` return `args`. | Library/Homebrew/dev-cmd/mirror.rb | @@ -27,7 +27,7 @@ def mirror_args
end
def mirror
- mirror_args.parse
+ args = mirror_args.parse
bintray_org = args.bintray_org || "homebrew"
bintray_repo = args.bintray_repo || "mirror" | true |
Other | Homebrew | brew | bf13db3367fc474d9f012984ddd482ae06a01ad8.json | Make `Parser#parse` return `args`. | Library/Homebrew/dev-cmd/pr-upload.rb | @@ -33,7 +33,7 @@ def pr_upload_args
end
def pr_upload
- pr_upload_args.parse
+ args = pr_upload_args.parse
bintray_org = args.bintray_org || "homebrew"
bintray = Bintray.new(org: bintray_org) | true |
Other | Homebrew | brew | 3d0a68cf5445c54d95fb1a7933085c45fdb21ad5.json | sorbet: add cli/args.rb to true | Library/Homebrew/sorbet/files.yaml | @@ -82,7 +82,6 @@ false:
- ./cask/verify.rb
- ./caveats.rb
- ./cleanup.rb
- - ./cli/args.rb
- ./cli/parser.rb
- ./cmd/--cache.rb
- ./cmd/--cellar.rb
@@ -836,6 +835,7 @@ true:
- ./cask/url.rb
- ./checksum.rb
- ./cleaner.rb
+ - ./cli/args.rb
- ./compat/extend/nil.rb
- ./compat/extend/string.rb
- ./compat/formula.rb | true |
Other | Homebrew | brew | 3d0a68cf5445c54d95fb1a7933085c45fdb21ad5.json | sorbet: add cli/args.rb to true | Library/Homebrew/sorbet/rbi/cli.rbi | @@ -0,0 +1,19 @@
+# typed: strict
+
+module Homebrew::CLI
+ class Args < OpenStruct
+ def devel?; end
+
+ def HEAD?; end
+
+ def include_test?; end
+
+ def build_bottle?; end
+
+ def build_universal?; end
+
+ def build_from_source?; end
+
+ def named_args; end
+ end
+end | true |
Other | Homebrew | brew | 33f1c3164b1c6a9ef2d3de0e7cb139b259808bad.json | commands: Use a hash instead of nested arrays | Library/Homebrew/cmd/commands.rb | @@ -31,18 +31,20 @@ def commands
return
end
- first = true
+ prepend_separator = false
- [["Built-in commands", Commands.internal_commands],
- ["Built-in developer commands", Commands.internal_developer_commands],
- ["External commands", Commands.external_commands],
- ["Cask commands", Commands.cask_internal_commands],
- ["External cask commands", Commands.cask_external_commands]]
+ { "Built-in commands" => Commands.internal_commands,
+ "Built-in developer commands" => Commands.internal_developer_commands,
+ "External commands" => Commands.external_commands,
+ "Cask commands" => Commands.cask_internal_commands,
+ "External cask commands" => Commands.cask_external_commands }
.each do |title, commands|
- if commands.present?
- first = !first && puts
- ohai title, Formatter.columns(commands)
- end
+ next if commands.blank?
+
+ puts if prepend_separator
+ ohai title, Formatter.columns(commands)
+
+ prepend_separator = true
end
end
end | false |
Other | Homebrew | brew | ef8af4b0707997d38d3146c45c4cc4c5b2fa3017.json | add limit flag to reduce response size | Library/Homebrew/dev-cmd/bump.rb | @@ -12,6 +12,8 @@ def bump_args
Display out-of-date brew formulae, the latest version available, and whether a pull request has been opened.
EOS
+ flag "--limit=",
+ description: "Limit number of package results returned."
switch :verbose
switch :debug
end
@@ -40,8 +42,12 @@ def validate_and_format_packages(outdated_repology_packages)
latest_version = repositories.find { |repo| repo["status"] == "newest" }["version"]
srcname = repology_homebrew_repo["srcname"]
- packages[srcname] = format_package(srcname, latest_version)
+ package_details = format_package(srcname, latest_version)
+ packages[srcname] = package_details unless package_details.nil?
+
+ break if packages.size == Homebrew.args.limit.to_i
end
+
packages
end
@@ -103,8 +109,8 @@ def display(outdated_packages)
ohai formula
puts "Current formula version: #{package_details[:current_formula_version]}"
puts "Latest repology version: #{package_details[:repology_latest_version]}"
- puts "Latest livecheck version: #{package_details[:livecheck_latest_version]}"
- puts "Open pull requests: #{package_details[:open_pull_requests]}"
+ puts "Latest livecheck version: #{package_details[:livecheck_latest_version] || "Not found."}"
+ puts "Open pull requests: #{package_details[:open_pull_requests] || "None."}"
end
end
end | false |
Other | Homebrew | brew | 4f119ad85ff77386312b4a5c3289ec53a6f29769.json | linkage_checker.rb: Use ||= instead of "return ... if ... "
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com> | Library/Homebrew/linkage_checker.rb | @@ -95,9 +95,7 @@ def unexpected_broken_dylibs
end
def unexpected_present_dylibs
- return @unexpected_present_dylibs if @unexpected_present_dylibs
-
- @unexpected_present_dylibs = @formula.class.allowed_missing_libraries.reject do |allowed_missing_lib|
+ @unexpected_present_dylibs ||= @formula.class.allowed_missing_libraries.reject do |allowed_missing_lib|
@broken_dylibs.any? do |broken_lib|
case allowed_missing_lib
when Regexp | false |
Other | Homebrew | brew | 2918f92b89b83f1c730dbbd032fe32837add43dd.json | linkage_checker.rb: fix indentation in `display_items`
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com> | Library/Homebrew/linkage_checker.rb | @@ -311,7 +311,7 @@ def display_items(label, things, puts_output: true)
else
things.sort.each do |item|
output += if item.is_a? Regexp
- "\n #{item.inspect}"
+ "\n #{item.inspect}"
else
"\n #{item}"
end | false |
Other | Homebrew | brew | 95fe35d5b6e30fcf4c512a1a393ce9cb014e9666.json | sorbet: add dependable.rb to true | Library/Homebrew/sorbet/files.yaml | @@ -842,6 +842,7 @@ true:
- ./compat/os/mac.rb
- ./compilers.rb
- ./config.rb
+ - ./dependable.rb
- ./dependency_collector.rb
- ./description_cache_store.rb
- ./descriptions.rb | false |
Other | Homebrew | brew | 637de8b48e0d6bb10de6ed74c2599d7a6bd57e65.json | sorbet: add compat files to true
Set the following files to true in sorbet/files.yaml:
- ./compat/extend/nil.rb
- ./compat/extend/string.rb
- ./compat/formula.rb
- ./compat/os/mac.rb | Library/Homebrew/sorbet/files.yaml | @@ -457,13 +457,8 @@ false:
- ./cask/dsl/version.rb
- ./cask/topological_hash.rb
- ./cmd/cask.rb
- - ./compat/extend/nil.rb
- - ./compat/extend/string.rb
- - ./compat/formula.rb
- ./compat/language/haskell.rb
- ./compat/language/java.rb
- - ./compat/os/mac.rb
- - ./dependable.rb
- ./extend/git_repository.rb
- ./extend/hash_validator.rb
- ./extend/io.rb
@@ -841,6 +836,10 @@ true:
- ./cask/url.rb
- ./checksum.rb
- ./cleaner.rb
+ - ./compat/extend/nil.rb
+ - ./compat/extend/string.rb
+ - ./compat/formula.rb
+ - ./compat/os/mac.rb
- ./compilers.rb
- ./config.rb
- ./dependency_collector.rb | true |
Other | Homebrew | brew | 637de8b48e0d6bb10de6ed74c2599d7a6bd57e65.json | sorbet: add compat files to true
Set the following files to true in sorbet/files.yaml:
- ./compat/extend/nil.rb
- ./compat/extend/string.rb
- ./compat/formula.rb
- ./compat/os/mac.rb | Library/Homebrew/sorbet/rbi/homebrew.rbi | @@ -12,3 +12,32 @@ module Language::Perl::Shebang
include Kernel
end
+module Dependable
+ def tags; end
+end
+
+class Formula
+ module Compat
+ include Kernel
+
+ def latest_version_installed?; end
+
+ def active_spec; end
+
+ def patches; end
+ end
+end
+
+class NilClass
+ module Compat
+ include Kernel
+ end
+end
+
+class String
+ module Compat
+ include Kernel
+
+ def chomp; end
+ end
+end | true |
Other | Homebrew | brew | 637de8b48e0d6bb10de6ed74c2599d7a6bd57e65.json | sorbet: add compat files to true
Set the following files to true in sorbet/files.yaml:
- ./compat/extend/nil.rb
- ./compat/extend/string.rb
- ./compat/formula.rb
- ./compat/os/mac.rb | Library/Homebrew/sorbet/rbi/os.rbi | @@ -12,3 +12,11 @@ module OS
include Kernel
end
end
+
+module OS::Mac
+ class << self
+ module Compat
+ include Kernel
+ end
+ end
+end | true |
Other | Homebrew | brew | 6d4bce4baafcb34c11cbca12b0d75458a0111ed9.json | fix syntactical issues | Library/Homebrew/dev-cmd/bump.rb | @@ -97,8 +97,8 @@ def parse_livecheck_response(response)
end
def display(outdated_packages)
- ohai "Outdated formulae\n"
-
+ ohai "Outdated formulae"
+ puts
outdated_packages.each do |formula, package_details|
ohai formula
puts "Current formula version: #{package_details[:current_formula_version]}" | true |
Other | Homebrew | brew | 6d4bce4baafcb34c11cbca12b0d75458a0111ed9.json | fix syntactical issues | Library/Homebrew/diagnostic.rb | @@ -671,7 +671,9 @@ def check_git_status
next if status.blank?
# these will result in uncommitted gems.
- next if path == HOMEBREW_REPOSITORY && (ENV["HOMEBREW_SORBET"] || ENV["HOMEBREW_PATCHELF_RB"])
+ if path == HOMEBREW_REPOSITORY
+ next if ENV["HOMEBREW_SORBET"] || ENV["HOMEBREW_PATCHELF_RB"]
+ end
message ||= ""
message += "\n" unless message.empty? | true |
Other | Homebrew | brew | b4efb2c258a3e1735f46a6874ccf67bdd40516a1.json | notability: fix variable names | Library/Homebrew/utils/notability.rb | @@ -9,7 +9,7 @@ def github_repo_data(user, repo)
@github_repo_data ||= {}
@github_repo_data["#{user}/#{repo}"] ||= GitHub.repository(user, repo)
- @github_data["#{user}/#{repo}"]
+ @github_repo_data["#{user}/#{repo}"]
rescue GitHub::HTTPNotFoundError
nil
end
@@ -23,7 +23,7 @@ def gitlab_repo_data(user, repo)
JSON.parse(out)
end
- @gitlab_data["#{user}/#{repo}"]
+ @gitlab_repo_data["#{user}/#{repo}"]
end
def github(user, repo) | false |
Other | Homebrew | brew | 8d82aa8c3a308c7d39d21b918dff6d561171e1a3.json | sorbet: set multiple files to true
Set the following files to true in sorbet/files.yaml:
- ./fetch.rb
- ./formula_pin.rb
- ./hardware.rb
- ./help.rb
- ./language/go.rb
- ./language/java.rb
- ./language/perl.rb
- ./messages.rb | Library/Homebrew/sorbet/files.yaml | @@ -212,11 +212,8 @@ false:
- ./formula_versions.rb
- ./formulary.rb
- ./global.rb
- - ./help.rb
- ./install.rb
- ./keg.rb
- - ./language/go.rb
- - ./language/java.rb
- ./language/node.rb
- ./language/python.rb
- ./linkage_checker.rb
@@ -484,12 +481,7 @@ false:
- ./extend/os/mac/requirements/osxfuse_requirement.rb
- ./extend/predicable.rb
- ./extend/string.rb
- - ./fetch.rb
- - ./formula_pin.rb
- - ./hardware.rb
- ./keg_relocate.rb
- - ./language/perl.rb
- - ./messages.rb
- ./mktemp.rb
- ./options.rb
- ./os/linux/elf.rb
@@ -865,14 +857,22 @@ true:
- ./extend/os/mac/keg.rb
- ./extend/os/mac/resource.rb
- ./extend/os/mac/utils/analytics.rb
+ - ./fetch.rb
- ./formula_free_port.rb
+ - ./formula_pin.rb
- ./formula_support.rb
+ - ./hardware.rb
+ - ./help.rb
- ./install_renamed.rb
+ - ./language/go.rb
+ - ./language/java.rb
+ - ./language/perl.rb
- ./lazy_object.rb
- ./linkage_cache_store.rb
- ./livecheck.rb
- ./load_path.rb
- ./locale.rb
+ - ./messages.rb
- ./metafiles.rb
- ./official_taps.rb
- ./os.rb | true |
Other | Homebrew | brew | 8d82aa8c3a308c7d39d21b918dff6d561171e1a3.json | sorbet: set multiple files to true
Set the following files to true in sorbet/files.yaml:
- ./fetch.rb
- ./formula_pin.rb
- ./hardware.rb
- ./help.rb
- ./language/go.rb
- ./language/java.rb
- ./language/perl.rb
- ./messages.rb | Library/Homebrew/sorbet/rbi/homebrew.rbi | @@ -0,0 +1,14 @@
+# typed: strict
+
+module Homebrew
+ include Kernel
+end
+
+module Homebrew::Help
+ include Kernel
+end
+
+module Language::Perl::Shebang
+ include Kernel
+end
+ | true |
Other | Homebrew | brew | abaf9c40aec2cc91314b7e86fcb2d9b205c45c4d.json | Fix code style. | Library/Homebrew/cask/cmd.rb | @@ -199,9 +199,7 @@ def process_options(*args)
begin
arg = all_args[i]
- unless process_arguments([arg]).empty?
- remaining << arg
- end
+ remaining << arg unless process_arguments([arg]).empty?
rescue OptionParser::MissingArgument
raise if i + 1 >= all_args.count
| true |
Other | Homebrew | brew | abaf9c40aec2cc91314b7e86fcb2d9b205c45c4d.json | Fix code style. | Library/Homebrew/cask/dsl.rb | @@ -139,10 +139,10 @@ def language_eval
locales = cask.config.languages
.map do |language|
- Locale.parse(language)
- rescue Locale::ParserError
- nil
- end
+ Locale.parse(language)
+ rescue Locale::ParserError
+ nil
+ end
.compact
locales.each do |locale| | true |
Other | Homebrew | brew | 365d2b214e681626b2f6203ff7fe4419ae3f76c8.json | Remove useless spec. | Library/Homebrew/test/cask/cmd_spec.rb | @@ -15,12 +15,6 @@
])
end
- it "ignores the `--language` option, which is handled in `OS::Mac`" do
- cli = described_class.new("--language=en")
- expect(cli).to receive(:detect_internal_command).with(no_args)
- cli.run
- end
-
context "when given no arguments" do
it "exits successfully" do
expect(subject).not_to receive(:exit).with(be_nonzero) | false |
Other | Homebrew | brew | 4bc174cc628010daac0a9605f0e62363042583b0.json | Add timeout for all specs. | Library/Homebrew/test/spec_helper.rb | @@ -29,6 +29,7 @@
require "rubocop/rspec/support"
require "find"
require "byebug"
+require "timeout"
$LOAD_PATH.push(File.expand_path("#{ENV["HOMEBREW_LIBRARY"]}/Homebrew/test/support/lib"))
@@ -181,7 +182,19 @@ def find_files
$stderr.reopen(File::NULL)
end
- example.run
+ begin
+ timeout = example.metadata.fetch(:timeout, 60)
+ inner_timeout = nil
+ Timeout.timeout(timeout) do
+ example.run
+ rescue Timeout::Error => e
+ inner_timeout = e
+ end
+ rescue Timeout::Error
+ raise "Example exceeded maximum runtime of #{timeout} seconds."
+ end
+
+ raise inner_timeout if inner_timeout
rescue SystemExit => e
raise "Unexpected exit with status #{e.status}."
ensure | false |
Other | Homebrew | brew | ab4e956390aceacb96b40a78b49458b9617e2ade.json | sorbet: update hidden definitions | Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi | @@ -5621,6 +5621,10 @@ class Cask::Cmd::List
def full_name?(); end
+ def json=(value); end
+
+ def json?(); end
+
def one=(value); end
def one?(); end
@@ -6243,6 +6247,48 @@ module CodeRay
def self.scanner(lang, options=T.unsafe(nil), &block); end
end
+module Colorize
+end
+
+module Colorize::ClassMethods
+ def color_codes(); end
+
+ def color_matrix(_=T.unsafe(nil)); end
+
+ def color_methods(); end
+
+ def color_samples(); end
+
+ def colors(); end
+
+ def disable_colorization(value=T.unsafe(nil)); end
+
+ def disable_colorization=(value); end
+
+ def mode_codes(); end
+
+ def modes(); end
+
+ def modes_methods(); end
+end
+
+module Colorize::ClassMethods
+end
+
+module Colorize::InstanceMethods
+ def colorize(params); end
+
+ def colorized?(); end
+
+ def uncolorize(); end
+end
+
+module Colorize::InstanceMethods
+end
+
+module Colorize
+end
+
class CompilerSelector::Compiler
def self.[](*_); end
@@ -7969,6 +8015,8 @@ module Homebrew::EnvConfig
def self.fail_log_lines(); end
+ def self.forbidden_licenses(); end
+
def self.force_brewed_curl?(); end
def self.force_brewed_git?(); end
@@ -12951,6 +12999,8 @@ end
class Net::HTTPAlreadyReported
end
+Net::HTTPClientError::EXCEPTION_TYPE = Net::HTTPServerException
+
Net::HTTPClientErrorCode = Net::HTTPClientError
Net::HTTPClientException = Net::HTTPServerException
@@ -13021,6 +13071,8 @@ end
class Net::HTTPRangeNotSatisfiable
end
+Net::HTTPRedirection::EXCEPTION_TYPE = Net::HTTPRetriableError
+
Net::HTTPRedirectionCode = Net::HTTPRedirection
class Net::HTTPRequestTimeout
@@ -13036,6 +13088,8 @@ Net::HTTPResponceReceiver = Net::HTTPResponse
Net::HTTPRetriableCode = Net::HTTPRedirection
+Net::HTTPServerError::EXCEPTION_TYPE = Net::HTTPFatalError
+
Net::HTTPServerErrorCode = Net::HTTPServerError
Net::HTTPSession = Net::HTTP
@@ -19415,6 +19469,10 @@ class RuboCop::Cop::FormulaAudit::Miscellaneous
def languageNodeModule?(node0); end
end
+class RuboCop::Cop::FormulaAudit::OptionDeclarations
+ def depends_on_build_with(node0); end
+end
+
class RuboCop::Cop::FormulaAudit::Patches
def patch_data?(node0); end
end
@@ -19423,6 +19481,16 @@ class RuboCop::Cop::FormulaAudit::Test
def test_calls(node0); end
end
+class RuboCop::Cop::FormulaAudit::Text
+ def prefix_path(node0); end
+end
+
+class RuboCop::Cop::FormulaAuditStrict::Text
+ def interpolated_share_path_starts_with(node0, param1); end
+
+ def share_path_starts_with(node0, param1); end
+end
+
class RuboCop::Cop::FormulaCop
def dependency_name_hash_match?(node0, param1); end
@@ -19446,11 +19514,20 @@ module RuboCop::RSpec::ExpectOffense
end
class RuboCop::RSpec::ExpectOffense::AnnotatedSource
+ def ==(other); end
+
+ def annotations(); end
+
def initialize(lines, annotations); end
+ def lines(); end
+
+ def match_annotations?(other); end
+
def plain_source(); end
def with_offense_annotations(offenses); end
+ ABBREV = ::T.let(nil, ::T.untyped)
ANNOTATION_PATTERN = ::T.let(nil, ::T.untyped)
end
@@ -20756,13 +20833,25 @@ end
class SimpleCov::Formatter::Codecov
def build_params(ci); end
+ def create_report(report); end
+
def detect_ci(); end
def display_header(); end
- def format(result); end
+ def format(result, disable_net_blockers=T.unsafe(nil)); end
+
+ def gzip_report(report); end
+
+ def handle_report_response(report); end
+
+ def retry_request(req, https); end
+
+ def upload_to_codecov(ci, report); end
- def upload_to_codecov(req, https); end
+ def upload_to_v2(url, report, query, query_without_token); end
+
+ def upload_to_v4(url, report, query, query_without_token); end
APPVEYOR = ::T.let(nil, ::T.untyped)
AZUREPIPELINES = ::T.let(nil, ::T.untyped)
BITBUCKET = ::T.let(nil, ::T.untyped)
@@ -21389,11 +21478,20 @@ module Stdenv
end
class String
+ include ::Colorize::InstanceMethods
include ::String::Compat
def acts_like_string?(); end
def at(position); end
+ def black(); end
+
+ def blink(); end
+
+ def blue(); end
+
+ def bold(); end
+
def camelcase(first_letter=T.unsafe(nil)); end
def camelize(first_letter=T.unsafe(nil)); end
@@ -21402,6 +21500,8 @@ class String
def constantize(); end
+ def cyan(); end
+
def dasherize(); end
def deconstantize(); end
@@ -21418,6 +21518,10 @@ class String
def from(position); end
+ def green(); end
+
+ def hide(); end
+
def html_safe(); end
def humanize(capitalize: T.unsafe(nil), keep_id_suffix: T.unsafe(nil)); end
@@ -21432,16 +21536,70 @@ class String
def isutf8(); end
+ def italic(); end
+
def kconv(to_enc, from_enc=T.unsafe(nil)); end
def last(limit=T.unsafe(nil)); end
+ def light_black(); end
+
+ def light_blue(); end
+
+ def light_cyan(); end
+
+ def light_green(); end
+
+ def light_magenta(); end
+
+ def light_red(); end
+
+ def light_white(); end
+
+ def light_yellow(); end
+
+ def magenta(); end
+
def mb_chars(); end
+ def on_black(); end
+
+ def on_blue(); end
+
+ def on_cyan(); end
+
+ def on_green(); end
+
+ def on_light_black(); end
+
+ def on_light_blue(); end
+
+ def on_light_cyan(); end
+
+ def on_light_green(); end
+
+ def on_light_magenta(); end
+
+ def on_light_red(); end
+
+ def on_light_white(); end
+
+ def on_light_yellow(); end
+
+ def on_magenta(); end
+
+ def on_red(); end
+
+ def on_white(); end
+
+ def on_yellow(); end
+
def parameterize(separator: T.unsafe(nil), preserve_case: T.unsafe(nil), locale: T.unsafe(nil)); end
def pluralize(count=T.unsafe(nil), locale=T.unsafe(nil)); end
+ def red(); end
+
def remove(*patterns); end
def remove!(*patterns); end
@@ -21460,6 +21618,8 @@ class String
def starts_with?(*_); end
+ def swap(); end
+
def tableize(); end
def titlecase(keep_id_suffix: T.unsafe(nil)); end
@@ -21502,13 +21662,23 @@ class String
def truncate_words(words_count, options=T.unsafe(nil)); end
+ def underline(); end
+
def underscore(); end
def upcase_first(); end
+
+ def white(); end
+
+ def yellow(); end
BLANK_RE = ::T.let(nil, ::T.untyped)
ENCODED_BLANKS = ::T.let(nil, ::T.untyped)
end
+class String
+ extend ::Colorize::ClassMethods
+end
+
class StringScanner
def bol?(); end
@@ -23158,209 +23328,35 @@ module URI
end
class URL
- def =~(reg); end
-
- def [](*args, &block); end
-
- def []=(*args, &block); end
-
- def add_to_path(val); end
-
def branch(); end
def cookies(); end
def data(); end
- def delete(*args); end
-
- def domain(); end
-
- def domain=(domain); end
-
- def format(); end
-
- def format=(format); end
-
- def get(*args); end
-
- def hash=(hash); end
-
- def host(); end
-
- def host_with_port(); end
-
- def params(); end
-
- def params=(p); end
-
def path(*args, &block); end
- def path=(str); end
-
- def port(); end
-
- def port=(port); end
-
- def post(*args); end
-
- def put(*args); end
-
def referer(); end
- def req_handler(); end
-
- def req_handler=(r); end
-
def revision(); end
def revisions(); end
def scheme(*args, &block); end
- def scheme=(scheme); end
-
def specs(); end
- def string(); end
-
- def subdomain(); end
-
- def subdomain=(s); end
-
- def subdomains(); end
-
- def subdomains=(s); end
-
def tag(); end
def to_s(*args, &block); end
- def to_uri(); end
-
def trust_cert(); end
def uri(); end
def user_agent(); end
def using(); end
- VERSION = ::T.let(nil, ::T.untyped)
-end
-
-class URL::ASJSONHandler
-end
-
-class URL::ASJSONHandler
-end
-
-class URL::BaseJSONHandler
-end
-
-class URL::BaseJSONHandler
-end
-
-class URL::JSONHandler
- def initialize(str); end
-
- def parse(); end
-
- def str(); end
-end
-
-class URL::JSONHandler
-end
-
-class URL::Mash
- def [](k); end
-
- def []=(k, v); end
-end
-
-class URL::Mash
-end
-
-class URL::NetHandler
-end
-
-class URL::NetHandler
-end
-
-class URL::ParamsHash
- def reverse_merge!(other); end
-
- def to_s(questionmark=T.unsafe(nil)); end
-
- def |(other); end
-end
-
-class URL::ParamsHash
- def self.from_string(str); end
-end
-
-class URL::RequestHandler
- def delete(args=T.unsafe(nil)); end
-
- def get(args=T.unsafe(nil)); end
-
- def initialize(url); end
-
- def post(args=T.unsafe(nil)); end
-
- def put(args=T.unsafe(nil)); end
-
- def url(); end
-end
-
-class URL::RequestHandler
-end
-
-class URL::Response
- def code(); end
-
- def connection_refused(); end
-
- def initialize(str, args=T.unsafe(nil)); end
-
- def json(); end
-
- def response(); end
-
- def success?(); end
-
- def successful?(); end
-
- def time(); end
-
- def url(); end
-
- def url_obj(); end
-end
-
-class URL::Response
-end
-
-class URL::TyHandler
- def head(args=T.unsafe(nil)); end
-end
-
-class URL::TyHandler
-end
-
-class URL::YajlHandler
-end
-
-class URL::YajlHandler
-end
-
-class URL
- def self.json_handler(); end
-
- def self.json_handler=(r); end
-
- def self.req_handler(); end
-
- def self.req_handler=(r); end
end
class UnboundMethod
@@ -23496,7 +23492,7 @@ class Zeitwerk::Loader
def preloads(); end
- def push_dir(path); end
+ def push_dir(path, namespace: T.unsafe(nil)); end
def reload(); end
| false |
Other | Homebrew | brew | 1a6467eeeab8887ff404ff87b8b15d6c50c0525c.json | Gemfile: set sorbet version | Library/Homebrew/Gemfile | @@ -14,8 +14,8 @@ gem "rspec-wait", require: false
gem "rubocop"
gem "simplecov", require: false
if ENV["HOMEBREW_SORBET"]
- gem "sorbet"
- gem "sorbet-runtime"
+ gem "sorbet", "0.5.5823"
+ gem "sorbet-runtime", "0.5.5823"
gem "tapioca"
end
| false |
Other | Homebrew | brew | 73495c4959fb614f7cb434b482599fb8821fb824.json | formula.rb [extend/Linux]: add missing comma | Library/Homebrew/extend/os/linux/formula.rb | @@ -9,7 +9,7 @@ def shared_library(name, version = nil)
undef allowed_missing_lib?
def allowed_missing_lib?(lib)
- raise TypeError "Library must be a string; got a #{lib.class} (#{lib})" unless lib.is_a? String
+ raise TypeError, "Library must be a string; got a #{lib.class} (#{lib})" unless lib.is_a? String
# lib: Full path to the missing library
# Ex.: /home/linuxbrew/.linuxbrew/lib/libsomething.so.1 | false |
Other | Homebrew | brew | 68ebf8866ab14334aa6aab8d0672d804c632035d.json | extend/os/linux/formula.rb: allowed_missing_lib: check input class | Library/Homebrew/extend/os/linux/formula.rb | @@ -9,6 +9,8 @@ def shared_library(name, version = nil)
undef allowed_missing_lib?
def allowed_missing_lib?(lib)
+ raise TypeError "Library must be a string; got a #{lib.class} (#{lib})" unless lib.is_a? String
+
# lib: Full path to the missing library
# Ex.: /home/linuxbrew/.linuxbrew/lib/libsomething.so.1
# x - Name of or a pattern for a library, linkage to which is allowed to be missing.
@@ -19,7 +21,7 @@ def allowed_missing_lib?(lib)
when Regexp
x.match? lib
when String
- lib.to_s.include? x
+ lib.include? x
end
end
end | false |
Other | Homebrew | brew | 28227bd26b592d3c4ecb669a662750200938d734.json | linkage_checker.rb: replace conditional assignment with an if-else | Library/Homebrew/linkage_checker.rb | @@ -81,7 +81,11 @@ def unexpected_broken_libs
def broken_dylibs_with_expectations
output = {}
@broken_dylibs.each do |lib|
- output[lib] = (unexpected_broken_libs.include? lib) ? ["unexpected"] : ["expected"]
+ output[lib] = if unexpected_broken_libs.include? lib
+ ["unexpected"]
+ else
+ ["expected"]
+ end
end
output
end | false |
Other | Homebrew | brew | ff6653424270aeceb6a863ad0f32472c9f99863a.json | add patchelf to Gemfile | Library/Homebrew/Gemfile | @@ -23,7 +23,7 @@ end
gem "activesupport"
gem "concurrent-ruby"
gem "mechanize"
-gem "patchelf" if ENV["HOMEBREW_PATCHELF_RB"]
+gem "patchelf"
gem "plist"
gem "rubocop-performance"
gem "rubocop-rspec" | false |
Other | Homebrew | brew | ad735d6ed2b4a80483dea3486660560fedb44a2f.json | Change the default locale to C.UTF-8 on Linux
Change the default locale from en_US.UTF-8 to C.UTF-8 on Linux.
The former locale is not included by default in common Docker images,
whereas the latter locale is included by default.
The default locale remains en_US.UTF-8 on macOS. | Library/Homebrew/brew.sh | @@ -1,7 +1,19 @@
+HOMEBREW_PROCESSOR="$(uname -m)"
+HOMEBREW_SYSTEM="$(uname -s)"
+case "$HOMEBREW_SYSTEM" in
+ Darwin) HOMEBREW_MACOS="1" ;;
+ Linux) HOMEBREW_LINUX="1" ;;
+esac
+
# Force UTF-8 to avoid encoding issues for users with broken locale settings.
if [[ "$(locale charmap 2>/dev/null)" != "UTF-8" ]]
then
- export LC_ALL="en_US.UTF-8"
+ if [[ -n "$HOMEBREW_MACOS" ]]
+ then
+ export LC_ALL="en_US.UTF-8"
+ else
+ export LC_ALL="C.UTF-8"
+ fi
fi
# USER isn't always set so provide a fall back for `brew` and subprocesses.
@@ -87,13 +99,6 @@ then
odie "Cowardly refusing to continue at this prefix: $HOMEBREW_PREFIX"
fi
-HOMEBREW_PROCESSOR="$(uname -m)"
-HOMEBREW_SYSTEM="$(uname -s)"
-case "$HOMEBREW_SYSTEM" in
- Darwin) HOMEBREW_MACOS="1" ;;
- Linux) HOMEBREW_LINUX="1" ;;
-esac
-
if [[ -n "$HOMEBREW_FORCE_BREWED_CURL" &&
-x "$HOMEBREW_PREFIX/opt/curl/bin/curl" ]] &&
"$HOMEBREW_PREFIX/opt/curl/bin/curl" --version >/dev/null | false |
Other | Homebrew | brew | 92953aa8e8431391697cf93f58200fc0f6e41910.json | commands: Add unstable commands to cask commands | Library/Homebrew/commands.rb | @@ -140,19 +140,12 @@ def external_commands
def cask_commands(aliases: false)
cmds = cask_internal_commands
cmds += cask_internal_command_aliases if aliases
- cmds += cask_unstable_internal_commands
cmds += cask_external_commands
cmds
end
def cask_internal_commands
- Cask::Cmd.commands - cask_unstable_internal_commands
- end
-
- def cask_unstable_internal_commands
- Cask::Cmd.commands.select do |command|
- command.start_with? "_"
- end
+ Cask::Cmd.commands
end
def cask_internal_command_aliases | false |
Other | Homebrew | brew | b4f8e23ee1050d3794974fbe93861c5fa4b421a0.json | outdated: Fix documentation style
Co-authored-by: Eric Knibbe <enk3@outlook.com> | Library/Homebrew/cmd/outdated.rb | @@ -30,11 +30,11 @@ def outdated_args
"formula is outdated. Otherwise, the repository's HEAD will only be checked for "\
"updates when a new stable or development version has been released."
switch "--greedy",
- description: "Print outdated casks with `auto_updates` or `version :latest`"
+ description: "Print outdated casks with `auto_updates` or `version :latest`."
switch "--formula",
- description: "Treat all arguments as formulae"
+ description: "Treat all arguments as formulae."
switch "--cask",
- description: "Treat all arguments as casks"
+ description: "Treat all arguments as casks."
switch :debug
conflicts "--quiet", "--verbose", "--json"
conflicts "--formula", "--cask"
@@ -46,7 +46,7 @@ def outdated
case json_version
when :v1
- opoo "JSON v1 has been deprecated. Please use --json=v2"
+ opoo "JSON v1 has been deprecated; please use --json=v2"
outdated = if args.formula? || !args.cask?
outdated_formulae | true |
Other | Homebrew | brew | b4f8e23ee1050d3794974fbe93861c5fa4b421a0.json | outdated: Fix documentation style
Co-authored-by: Eric Knibbe <enk3@outlook.com> | docs/Manpage.md | @@ -360,11 +360,11 @@ otherwise.
* `--fetch-HEAD`:
Fetch the upstream repository to detect if the HEAD installation of the formula is outdated. Otherwise, the repository's HEAD will only be checked for updates when a new stable or development version has been released.
* `--greedy`:
- Print outdated casks with `auto_updates` or `version :latest`
+ Print outdated casks with `auto_updates` or `version :latest`.
* `--formula`:
- Treat all arguments as formulae
+ Treat all arguments as formulae.
* `--cask`:
- Treat all arguments as casks
+ Treat all arguments as casks.
### `pin` *`formula`*
| true |
Other | Homebrew | brew | b4f8e23ee1050d3794974fbe93861c5fa4b421a0.json | outdated: Fix documentation style
Co-authored-by: Eric Knibbe <enk3@outlook.com> | manpages/brew.1 | @@ -485,15 +485,15 @@ Fetch the upstream repository to detect if the HEAD installation of the formula
.
.TP
\fB\-\-greedy\fR
-Print outdated casks with \fBauto_updates\fR or \fBversion :latest\fR
+Print outdated casks with \fBauto_updates\fR or \fBversion :latest\fR\.
.
.TP
\fB\-\-formula\fR
-Treat all arguments as formulae
+Treat all arguments as formulae\.
.
.TP
\fB\-\-cask\fR
-Treat all arguments as casks
+Treat all arguments as casks\.
.
.SS "\fBpin\fR \fIformula\fR"
Pin the specified \fIformula\fR, preventing them from being upgraded when issuing the \fBbrew upgrade\fR \fIformula\fR command\. See also \fBunpin\fR\. | true |
Other | Homebrew | brew | 45368c81194379f1baeee86e82eeeb237610003f.json | Add a default back to INFOPATH
It looks like #7738 removed the default unintentionally. This adds it back.
For scripts that `set -u`, this will fail if $INFOPATH is not already set (`INFOPATH: unbound variable`). This provides an empty default, but one that will still satisfy the trailing colon requirement. | Library/Homebrew/cmd/shellenv.sh | @@ -29,7 +29,7 @@ homebrew-shellenv() {
echo "export HOMEBREW_REPOSITORY=\"$HOMEBREW_REPOSITORY\";"
echo "export PATH=\"$HOMEBREW_PREFIX/bin:$HOMEBREW_PREFIX/sbin\${PATH+:\$PATH}\";"
echo "export MANPATH=\"$HOMEBREW_PREFIX/share/man\${MANPATH+:\$MANPATH}:\";"
- echo "export INFOPATH=\"$HOMEBREW_PREFIX/share/info:\${INFOPATH}\";"
+ echo "export INFOPATH=\"$HOMEBREW_PREFIX/share/info:\${INFOPATH:-}\";"
;;
esac
} | false |
Other | Homebrew | brew | 25b7d28f91d88dc2ac431cebba9a9c2998b365f1.json | dev-cmd/audit: add libressl to uses_from_macos allow list | Library/Homebrew/dev-cmd/audit.rb | @@ -323,6 +323,7 @@ def audit_formula_name
USES_FROM_MACOS_ALLOWLIST = %w[
apr
apr-util
+ libressl
openblas
openssl@1.1
].freeze | false |
Other | Homebrew | brew | 70dfaf3b42f263a83edf35934f6b360a6bf927cd.json | Add link to pypi downloads page to problem message | Library/Homebrew/rubocops/urls.rb | @@ -292,16 +292,22 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node)
# Check pypi urls
pypi_pattern = %r{^https?://pypi.python.org/}
- audit_urls(urls, pypi_pattern) do
- problem "use the `files.pythonhosted.org` url found on the pypi downloads page"
+ audit_urls(urls, pypi_pattern) do |_, url|
+ problem "use the `Source` url found on PyPI downloads page (`#{get_pypi_url(url)}`)"
end
# Require long files.pythonhosted.org urls
pythonhosted_pattern = %r{^https?://files.pythonhosted.org/packages/source/}
- audit_urls(urls, pythonhosted_pattern) do
- problem "use the url found on the pypi downloads page"
+ audit_urls(urls, pythonhosted_pattern) do |_, url|
+ problem "use the `Source` url found on PyPI downloads page (`#{get_pypi_url(url)}`)"
end
end
+
+ def get_pypi_url(url)
+ package_file = File.basename(url)
+ package_name = package_file.match(/^(.+)-[a-z0-9.]+$/)[1]
+ "https://pypi.org/project/#{package_name}/#files"
+ end
end
end
end | true |
Other | Homebrew | brew | 70dfaf3b42f263a83edf35934f6b360a6bf927cd.json | Add link to pypi downloads page to problem message | Library/Homebrew/test/rubocops/urls_spec.rb | @@ -251,7 +251,7 @@ class Foo < Formula
class Foo < Formula
desc "foo"
url "https://pypi.python.org/packages/source/foo/foo-0.1.tar.gz"
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ use the `files.pythonhosted.org` url found on the pypi downloads page
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ use the `Source` url found on PyPI downloads page (`https://pypi.org/project/foo/#files`)
end
RUBY
end
@@ -261,7 +261,7 @@ class Foo < Formula
class Foo < Formula
desc "foo"
url "https://files.pythonhosted.org/packages/source/f/foo/foo-0.1.tar.gz"
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ use the url found on the pypi downloads page
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ use the `Source` url found on PyPI downloads page (`https://pypi.org/project/foo/#files`)
end
RUBY
end | true |
Other | Homebrew | brew | 5f3f7d010b4f816e740ca740bab976d9b6836038.json | Require long urls for pypi and pythonhosted urls | Library/Homebrew/rubocops/urls.rb | @@ -291,20 +291,15 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node)
urls += mirrors
# Check pypi urls
- @pypi_pattern = %r{^https?://pypi.python.org/(.*)}
- audit_urls(urls, @pypi_pattern) do |match, url|
- problem "#{url} should be `https://files.pythonhosted.org/#{match[1]}`"
+ pypi_pattern = %r{^https?://pypi.python.org/}
+ audit_urls(urls, pypi_pattern) do
+ problem "use the `files.pythonhosted.org` url found on the pypi downloads page"
end
- end
- def autocorrect(node)
- lambda do |corrector|
- url_string_node = parameters(node).first
- url = string_content(url_string_node)
- match = regex_match_group(url_string_node, @pypi_pattern)
- correction = node.source.sub(url, "https://files.pythonhosted.org/#{match[1]}")
- corrector.insert_before(node.source_range, correction)
- corrector.remove(node.source_range)
+ # Require long files.pythonhosted.org urls
+ pythonhosted_pattern = %r{^https?://files.pythonhosted.org/packages/source/}
+ audit_urls(urls, pythonhosted_pattern) do
+ problem "use the url found on the pypi downloads page"
end
end
end | true |
Other | Homebrew | brew | 5f3f7d010b4f816e740ca740bab976d9b6836038.json | Require long urls for pypi and pythonhosted urls | Library/Homebrew/test/rubocops/urls_spec.rb | @@ -245,29 +245,32 @@ class Foo < Formula
describe RuboCop::Cop::FormulaAudit::PyPiUrls do
subject(:cop) { described_class.new }
- context "when a pypi.python.org URL is used" do
- it "reports an offense" do
+ context "when a pypi URL is used" do
+ it "reports an offense for pypi.python.org urls" do
expect_offense(<<~RUBY)
class Foo < Formula
desc "foo"
url "https://pypi.python.org/packages/source/foo/foo-0.1.tar.gz"
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ https://pypi.python.org/packages/source/foo/foo-0.1.tar.gz should be `https://files.pythonhosted.org/packages/source/foo/foo-0.1.tar.gz`
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ use the `files.pythonhosted.org` url found on the pypi downloads page
end
RUBY
end
- it "support auto-correction" do
- corrected = autocorrect_source(<<~RUBY)
+ it "reports an offense for short file.pythonhosted.org urls" do
+ expect_offense(<<~RUBY)
class Foo < Formula
desc "foo"
- url "https://pypi.python.org/packages/source/foo/foo-0.1.tar.gz"
+ url "https://files.pythonhosted.org/packages/source/f/foo/foo-0.1.tar.gz"
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ use the url found on the pypi downloads page
end
RUBY
+ end
- expect(corrected).to eq <<~RUBY
+ it "reports no offenses for long file.pythonhosted.org urls" do
+ expect_no_offenses(<<~RUBY)
class Foo < Formula
desc "foo"
- url "https://files.pythonhosted.org/packages/source/foo/foo-0.1.tar.gz"
+ url "https://files.pythonhosted.org/packages/a0/b1/a01b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f/foo-0.1.tar.gz"
end
RUBY
end | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.