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 | 3db65e7ee53039c63e6b570d9881896ee51c5569.json | move tests to own specs file | Library/Homebrew/test/rubocops/lines/generate_completions_spec.rb | @@ -0,0 +1,78 @@
+# typed: false
+# frozen_string_literal: true
+
+require "rubocops/lines"
+
+describe RuboCop::Cop::FormulaAudit do
+ describe RuboCop::Cop::FormulaAudit::GenerateCompletionsDSL do
+ subject(:cop) { described_class.new }
+
+ it "reports an offense when writing to a shell completions file direct... | true |
Other | Homebrew | brew | 3db65e7ee53039c63e6b570d9881896ee51c5569.json | move tests to own specs file | Library/Homebrew/test/rubocops/lines_spec.rb | @@ -3,130 +3,56 @@
require "rubocops/lines"
-describe RuboCop::Cop::FormulaAudit do
- describe RuboCop::Cop::FormulaAudit::Lines do
- subject(:cop) { described_class.new }
+describe RuboCop::Cop::FormulaAudit::Lines do
+ subject(:cop) { described_class.new }
- context "when auditing deprecated special de... | true |
Other | Homebrew | brew | 5b3f5dcbf2c0a10239b530db354da1cd9f6480bb.json | fix whitespace removal, fix string concatenation | Library/Homebrew/rubocops/lines.rb | @@ -519,10 +519,10 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node)
T.must(offenses[0...-1]).each do |node|
offending_node(node)
- problem "Use a single `generate_completions_from_executable` call
- combining all specified shells" do |c... | false |
Other | Homebrew | brew | ab09d15703e897a77f4af9177a92c275973bd0a3.json | remove newlines left behind after correction | Library/Homebrew/rubocops/lines.rb | @@ -519,7 +519,8 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node)
offending_node(node)
problem "Use a single `generate_completions_from_executable` call
combining all specified shells" do |corrector|
- corrector.replace(@offensive_n... | false |
Other | Homebrew | brew | de7ef64f6150806957161fd4b28e6486fd866a88.json | use #inspect instead of wrapping symbols | Library/Homebrew/rubocops/lines.rb | @@ -435,9 +435,9 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node)
shell_parameter_format = if shell_parameter_stripped.empty?
nil
elsif shell_parameter_stripped == "--"
- ":flag"
+ :flag
elsif shell_parameter_stripped... | false |
Other | Homebrew | brew | 06518ec6132d4191daed18ee4352d5746af6573b.json | add RuboCop to combine multiple calls | Library/Homebrew/rubocops/lines.rb | @@ -492,6 +492,56 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node)
EOS
end
+ # This cop makes sure that the `generate_completions_from_executable` DSL is used with only
+ # a single, combined call for all shells.
+ #
+ # @api private
+ class SingleGenera... | false |
Other | Homebrew | brew | 911aa6ab186c5c871b89f22a75ef67178021a79f.json | resource: determine version before freezing | Library/Homebrew/resource.rb | @@ -239,13 +239,13 @@ def url(val = nil, **specs)
@download_strategy = DownloadStrategyDetector.detect(url, using)
@specs.merge!(specs)
@downloader = nil
+ @version = detect_version(@version)
end
def version(val = nil)
- @version ||= begin
- version = detect_version(val)
- version... | false |
Other | Homebrew | brew | 675e80e9aedb104c9a1814d8c1450d8debb3147b.json | formula_auditor: use symbols for spec iteration | Library/Homebrew/formula_auditor.rb | @@ -482,13 +482,10 @@ def audit_homepage
return unless DevelopmentTools.curl_handles_most_https_certificates?
- use_homebrew_curl = false
- %w[Stable HEAD].each do |name|
- spec_name = name.downcase.to_sym
- next unless (spec = formula.send(spec_name))
+ use_homebrew_curl = [:sta... | false |
Other | Homebrew | brew | 15280ba1073afc13f239b9606de8f9623e8bc0a3.json | test: avoid improper, late usage of formula DSL | Library/Homebrew/test/build_environment_spec.rb | @@ -30,11 +30,16 @@
end
describe BuildEnvironment::DSL do
- subject(:build_environment_dsl) { double.extend(described_class) }
+ let(:build_environment_dsl) do
+ klass = described_class
+ Class.new do
+ extend(klass)
+ end
+ end
context "with a single argument" do
- be... | true |
Other | Homebrew | brew | 15280ba1073afc13f239b9606de8f9623e8bc0a3.json | test: avoid improper, late usage of formula DSL | Library/Homebrew/test/cleaner_spec.rb | @@ -7,15 +7,15 @@
describe Cleaner do
include FileUtils
- subject(:cleaner) { described_class.new(f) }
+ describe "#clean" do
+ subject(:cleaner) { described_class.new(f) }
- let(:f) { formula("cleaner_test") { url "foo-1.0" } }
+ let(:f) { formula("cleaner_test") { url "foo-1.0" } }
- before do
- ... | true |
Other | Homebrew | brew | 15280ba1073afc13f239b9606de8f9623e8bc0a3.json | test: avoid improper, late usage of formula DSL | Library/Homebrew/test/formula_spec.rb | @@ -832,15 +832,15 @@
specify "service complicated" do
f = formula do
url "https://brew.sh/test-1.0.tbz"
- end
- f.class.service do
- run [opt_bin/"beanstalkd"]
- run_type :immediate
- error_log_path var/"log/beanstalkd.error.log"
- log_path var/"log/beanstal... | true |
Other | Homebrew | brew | 15280ba1073afc13f239b9606de8f9623e8bc0a3.json | test: avoid improper, late usage of formula DSL | Library/Homebrew/test/livecheck/livecheck_spec.rb | @@ -98,11 +98,15 @@
describe "::livecheck_url_to_string" do
let(:f_livecheck_url) do
+ homepage_url_s = homepage_url
+ stable_url_s = stable_url
+ head_url_s = head_url
+
formula("test_livecheck_url") do
desc "Test Livecheck URL formula"
- homepage "https://brew.sh"
- ... | true |
Other | Homebrew | brew | 15280ba1073afc13f239b9606de8f9623e8bc0a3.json | test: avoid improper, late usage of formula DSL | Library/Homebrew/test/service_spec.rb | @@ -5,26 +5,28 @@
require "service"
describe Homebrew::Service do
- let(:klass) do
- Class.new(Formula) do
+ let(:name) { "formula_name" }
+
+ def stub_formula(&block)
+ formula(name) do
url "https://brew.sh/test-1.0.tbz"
+
+ instance_eval(&block) if block
end
end
- let(:name) { "formu... | true |
Other | Homebrew | brew | 15280ba1073afc13f239b9606de8f9623e8bc0a3.json | test: avoid improper, late usage of formula DSL | Library/Homebrew/test/support/fixtures/failball.rb | @@ -4,13 +4,22 @@
class Failball < Formula
def initialize(name = "failball", path = Pathname.new(__FILE__).expand_path, spec = :stable,
alias_path: nil, force_bottle: false)
- self.class.instance_eval do
- stable.url "file://#{TEST_FIXTURE_DIR}/tarballs/testball-0.1.tbz"
- stable.sha2... | true |
Other | Homebrew | brew | 15280ba1073afc13f239b9606de8f9623e8bc0a3.json | test: avoid improper, late usage of formula DSL | Library/Homebrew/test/support/fixtures/testball.rb | @@ -4,13 +4,22 @@
class Testball < Formula
def initialize(name = "testball", path = Pathname.new(__FILE__).expand_path, spec = :stable,
alias_path: nil, force_bottle: false)
- self.class.instance_eval do
- stable.url "file://#{TEST_FIXTURE_DIR}/tarballs/testball-0.1.tbz"
- stable.sha2... | true |
Other | Homebrew | brew | 15280ba1073afc13f239b9606de8f9623e8bc0a3.json | test: avoid improper, late usage of formula DSL | Library/Homebrew/test/support/fixtures/testball_bottle.rb | @@ -4,16 +4,27 @@
class TestballBottle < Formula
def initialize(name = "testball_bottle", path = Pathname.new(__FILE__).expand_path, spec = :stable,
alias_path: nil, force_bottle: false)
- self.class.instance_eval do
- stable.url "file://#{TEST_FIXTURE_DIR}/tarballs/testball-0.1.tbz"
- ... | true |
Other | Homebrew | brew | 15280ba1073afc13f239b9606de8f9623e8bc0a3.json | test: avoid improper, late usage of formula DSL | Library/Homebrew/test/support/fixtures/testball_bottle_cellar.rb | @@ -4,17 +4,27 @@
class TestballBottleCellar < Formula
def initialize(name = "testball_bottle", path = Pathname.new(__FILE__).expand_path, spec = :stable,
alias_path: nil, force_bottle: false)
- self.class.instance_eval do
- stable.url "file://#{TEST_FIXTURE_DIR}/tarballs/testball-0.1.tbz"... | true |
Other | Homebrew | brew | 76199ddd72900cecc0d9b23c10b5606e1cbbc547.json | utils: prefer BBEdit over TextWrangler | Library/Homebrew/utils.rb | @@ -364,8 +364,8 @@ def which_editor
editor = Homebrew::EnvConfig.editor
return editor if editor
- # Find Atom, Sublime Text, VS Code, Textmate, BBEdit / TextWrangler, or vim
- editor = %w[atom subl code mate edit vim].find do |candidate|
+ # Find Atom, Sublime Text, VS Code, Textmate, BBEdit, or v... | false |
Other | Homebrew | brew | 88a8def34cf617f20ef84c6191a9dbfc7b8790d6.json | formula: add signature for bottle DSL | Library/Homebrew/formula.rb | @@ -2695,6 +2695,7 @@ def stage(interactive: false, debug_symbols: false)
# The methods below define the formula DSL.
class << self
extend Predicable
+ extend T::Sig
include BuildEnvironment::DSL
include OnSystem::MacOSAndLinux
@@ -2903,8 +2904,9 @@ def sha256(val)
#
# Formulae which... | false |
Other | Homebrew | brew | 1c5ba1f6859418f5b0e0b6a0047db00f15f105ab.json | formula: require instances to use a subclass | Library/Homebrew/formula.rb | @@ -181,6 +181,9 @@ class Formula
# @private
def initialize(name, path, spec, alias_path: nil, force_bottle: false)
+ # Only allow instances of subclasses. The base class does not hold any spec information (URLs etc).
+ raise "Do not call `Formula.new' directly without a subclass." unless self.class < For... | false |
Other | Homebrew | brew | 93647e5c987f89f27502b79af4aedda8c917c6e3.json | requirement: require instances to use a subclass | Library/Homebrew/requirement.rb | @@ -20,6 +20,10 @@ class Requirement
attr_reader :tags, :name, :cask, :download
def initialize(tags = [])
+ # Only allow instances of subclasses. This base class enforces no constraints on its own.
+ # Individual subclasses use the `satisfy` DSL to define those constraints.
+ raise "Do not call `Requir... | true |
Other | Homebrew | brew | 93647e5c987f89f27502b79af4aedda8c917c6e3.json | requirement: require instances to use a subclass | Library/Homebrew/test/requirement_spec.rb | @@ -12,7 +12,7 @@
let(:klass) { Class.new(described_class) }
describe "#tags" do
- subject { described_class.new(tags) }
+ subject { klass.new(tags) }
context "with a single tag" do
let(:tags) { ["bar"] }
@@ -149,7 +149,7 @@
describe "#build?" do
context "when the :build tag is spe... | true |
Other | Homebrew | brew | 93647e5c987f89f27502b79af4aedda8c917c6e3.json | requirement: require instances to use a subclass | Library/Homebrew/test/requirements_spec.rb | @@ -12,7 +12,8 @@
end
it "merges duplicate requirements" do
- requirements << Requirement.new << Requirement.new
+ klass = Class.new(Requirement)
+ requirements << klass.new << klass.new
expect(requirements.count).to eq(1)
end
end | true |
Other | Homebrew | brew | f12442cce676bf88fca8dc56c2bd430171c346c6.json | requirement: improve name detection of anonymous subclasses | Library/Homebrew/requirement.rb | @@ -141,9 +141,9 @@ def mktemp(&block)
private
def infer_name
- klass = self.class.name || self.class.to_s
- klass = klass.sub(/(Dependency|Requirement)$/, "")
- .sub(/^(\w+::)*/, "")
+ klass = self.class.name
+ klass = klass&.sub(/(Dependency|Requirement)$/, "")
+ &.... | false |
Other | Homebrew | brew | fd432aa1db286360dab2361714e1e39406531ae0.json | cmd/deps: improve switch names.
The previous `-n` and `--1` made both the code and the help harder to
read and follow.
Co-authored-by: Eric Knibbe <enk3@outlook.com>
Co-Authored-By: Carlo Cabrera <30379873+carlocab@users.noreply.github.com> | Library/Homebrew/cmd/deps.rb | @@ -22,10 +22,10 @@ def deps_args
may be appended to the command. When given multiple formula arguments,
show the intersection of dependencies for each formula.
EOS
- switch "-n",
+ switch "-n", "--topological",
description: "Sort dependencies in topological order."
- ... | true |
Other | Homebrew | brew | fd432aa1db286360dab2361714e1e39406531ae0.json | cmd/deps: improve switch names.
The previous `-n` and `--1` made both the code and the help harder to
read and follow.
Co-authored-by: Eric Knibbe <enk3@outlook.com>
Co-Authored-By: Carlo Cabrera <30379873+carlocab@users.noreply.github.com> | completions/bash/brew | @@ -728,11 +728,11 @@ _brew_deps() {
case "${cur}" in
-*)
__brewcomp "
- --1
--all
--annotate
--cask
--debug
+ --direct
--dot
--for-each
--formula
@@ -746,10 +746,10 @@ _brew_deps() {
--installed
--quiet
--skip-recommended
+ ... | true |
Other | Homebrew | brew | fd432aa1db286360dab2361714e1e39406531ae0.json | cmd/deps: improve switch names.
The previous `-n` and `--1` made both the code and the help harder to
read and follow.
Co-authored-by: Eric Knibbe <enk3@outlook.com>
Co-Authored-By: Carlo Cabrera <30379873+carlocab@users.noreply.github.com> | completions/fish/brew.fish | @@ -565,11 +565,11 @@ __fish_brew_complete_arg 'create' -l verbose -d 'Make some output more verbose'
__fish_brew_complete_cmd 'deps' 'Show dependencies for formula'
-__fish_brew_complete_arg 'deps' -l 1 -d 'Only show dependencies one level down, instead of recursing'
__fish_brew_complete_arg 'deps' -l all -d 'Li... | true |
Other | Homebrew | brew | fd432aa1db286360dab2361714e1e39406531ae0.json | cmd/deps: improve switch names.
The previous `-n` and `--1` made both the code and the help harder to
read and follow.
Co-authored-by: Eric Knibbe <enk3@outlook.com>
Co-Authored-By: Carlo Cabrera <30379873+carlocab@users.noreply.github.com> | completions/zsh/_brew | @@ -695,10 +695,10 @@ _brew_create() {
# brew deps
_brew_deps() {
_arguments \
- '--1[Only show dependencies one level down, instead of recursing]' \
'(--installed)--all[List dependencies for all available formulae]' \
'--annotate[Mark any build, test, optional, or recommended dependencies as such in ... | true |
Other | Homebrew | brew | fd432aa1db286360dab2361714e1e39406531ae0.json | cmd/deps: improve switch names.
The previous `-n` and `--1` made both the code and the help harder to
read and follow.
Co-authored-by: Eric Knibbe <enk3@outlook.com>
Co-Authored-By: Carlo Cabrera <30379873+carlocab@users.noreply.github.com> | docs/Manpage.md | @@ -140,10 +140,10 @@ Show dependencies for *`formula`*. Additional options specific to *`formula`*
may be appended to the command. When given multiple formula arguments,
show the intersection of dependencies for each formula.
-* `-n`:
+* `-n`, `--topological`:
Sort dependencies in topological order.
-* `--1`:
-... | true |
Other | Homebrew | brew | fd432aa1db286360dab2361714e1e39406531ae0.json | cmd/deps: improve switch names.
The previous `-n` and `--1` made both the code and the help harder to
read and follow.
Co-authored-by: Eric Knibbe <enk3@outlook.com>
Co-Authored-By: Carlo Cabrera <30379873+carlocab@users.noreply.github.com> | manpages/brew.1 | @@ -154,12 +154,12 @@ Show Homebrew and system configuration info useful for debugging\. If you file a
Show dependencies for \fIformula\fR\. Additional options specific to \fIformula\fR may be appended to the command\. When given multiple formula arguments, show the intersection of dependencies for each formula\.
.
... | true |
Other | Homebrew | brew | 10304ef5696268b81b043335fc0b171f5ecc4f77.json | util/ruby.sh: fix HOMEBREW_USE_RUBY_FROM_PATH to use user's PATH | Library/Homebrew/utils/ruby.sh | @@ -13,30 +13,54 @@ test_ruby() {
"${HOMEBREW_REQUIRED_RUBY_VERSION}" 2>/dev/null
}
+can_use_ruby_from_path() {
+ if [[ -n "${HOMEBREW_DEVELOPER}" && -n "${HOMEBREW_USE_RUBY_FROM_PATH}" ]]
+ then
+ return 0
+ fi
+
+ return 1
+}
+
+find_first_valid_ruby() {
+ local ruby_exec
+ while IFS= read -r ruby_ex... | false |
Other | Homebrew | brew | d6368806e88b1e3a94c355bb9c1fbe2d65236708.json | os/linux/dependency_collector: install gcc if glibc is too old.
gcc is required for libgcc_s.so.1 if glibc or gcc are too old. | Library/Homebrew/extend/os/linux/dependency_collector.rb | @@ -12,7 +12,8 @@ class DependencyCollector
sig { params(related_formula_names: T::Set[String]).returns(T.nilable(Dependency)) }
def gcc_dep_if_needed(related_formula_names)
- return unless DevelopmentTools.system_gcc_too_old?
+ # gcc is required for libgcc_s.so.1 if glibc or gcc are too old
+ return u... | false |
Other | Homebrew | brew | c6428d9def384358a48eee9fa87e0273e7662b69.json | Add tests for `cleanup_python_site_packages`. | Library/Homebrew/test/cleanup_spec.rb | @@ -364,4 +364,41 @@
end
end
end
+
+ describe "::cleanup_python_site_packages" do
+ context "when cleaning up Python modules" do
+ let(:foo_module) { (HOMEBREW_PREFIX/"lib/python3.99/site-packages/foo") }
+ let(:foo_pycache) { (foo_module/"__pycache__") }
+ let(:foo_pyc) { (foo_pycache... | false |
Other | Homebrew | brew | 155f4d73946c522f3224288546c70085fb0ff44b.json | Fix collection of `unused_pyc_files`. | Library/Homebrew/cleanup.rb | @@ -531,6 +531,7 @@ def cleanup_python_site_packages
unused_pyc_files += pyc_files.reject { |k,| seen_non_pyc_file[k] }
.values
+ .flatten
return if unused_pyc_files.blank?
unused_pyc_files.each do |pyc| | false |
Other | Homebrew | brew | a5f7fc814e8e6452625fde42f958ee3804cb17e7.json | cmd/deps: return failing exit code on circular dependencies.
This makes more sense but will also be useful in `brew test-bot`. | Library/Homebrew/cmd/deps.rb | @@ -286,8 +286,14 @@ def recursive_deps_tree(f, dep_stack:, prefix:, recursive:, args:)
end
display_s = "#{tree_lines} #{dep_display_name(dep, args: args)}"
+
+ # Detect circular dependencies and consider them a failure if present.
is_circular = dep_stack.include?(dep.name)
- display_s ... | false |
Other | Homebrew | brew | 5c2dd5779458b056ce3fb4ed4fc207ef1bb695b5.json | Fix unreachable code. | Library/Homebrew/cask/audit.rb | @@ -585,7 +585,7 @@ def check_signing
next if result.success?
# Only fail if signature is wrong, not when no signature is present at all.
- next result.stderr.include?("not signed at all")
+ next if result.stderr.include?("not signed at all")
add_warning "Signature... | false |
Other | Homebrew | brew | 5c7e7eebe4d779dca0d5aaaec440105fb3e85c83.json | Condense artifact entries
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com> | Library/Homebrew/cask/cask.rb | @@ -283,14 +283,13 @@ def to_hash_with_variations
def artifacts_list
artifacts.map do |artifact|
- if artifact.is_a? Artifact::AbstractFlightBlock
- { type: artifact.summarize }
+ key, value = if artifact.is_a? Artifact::AbstractFlightBlock
+ artifact.summarize
els... | true |
Other | Homebrew | brew | 5c7e7eebe4d779dca0d5aaaec440105fb3e85c83.json | Condense artifact entries
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com> | Library/Homebrew/test/cask/cmd/list_spec.rb | @@ -107,14 +107,12 @@
"sha256": "67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94",
"artifacts": [
{
- "type": "app",
- "args": [
+ "app": [
"Caffeine.app"
]
},
... | true |
Other | Homebrew | brew | f09be9a5f75b44bfd16033af8b9ec456c24081c4.json | formula: try optimise `versioned_formulae_names` | Library/Homebrew/formula.rb | @@ -447,7 +447,17 @@ def versioned_formula?
# Returns any `@`-versioned formulae names for any formula (including versioned formulae).
sig { returns(T::Array[String]) }
def versioned_formulae_names
- Pathname.glob(path.to_s.gsub(/(@[\d.]+)?\.rb$/, "@*.rb")).map do |versioned_path|
+ versioned_paths = if ... | false |
Other | Homebrew | brew | 84f544f08ff280ea1750a647933e4bb6420c5b22.json | Require git log only when not strict | Library/Homebrew/formula_auditor.rb | @@ -411,7 +411,7 @@ def audit_conflicts
def audit_gcc_dependency
return unless @git
return unless @core_tap
- return unless formula.tap.git? # git log is required
+ return if !@strict && !formula.tap.git? # git log is required for non-strict audit
return unless Homebrew::SimulateSyst... | false |
Other | Homebrew | brew | d271614872279cce7cec6344d3262f5a19315787.json | install glibc/gcc automatically if too old.
Right now this is done through the gcc@5 formula.
See https://github.com/Homebrew/homebrew-core/blob/9692318ca653f58857fec12136381c9cec290aa9/Formula/gcc%405.rb#L33
This is fragile because when we will migrate to gcc@11
we have to think about migrating the installation from... | Library/Homebrew/dependency_collector.rb | @@ -28,6 +28,8 @@ class DependencyCollector
def initialize
@deps = Dependencies.new
@requirements = Requirements.new
+
+ init_global_dep_tree_if_needed!
end
def initialize_copy(other)
@@ -68,6 +70,12 @@ def build(spec)
parse_spec(spec, Array(tags))
end
+ sig { params(related_formula_n... | true |
Other | Homebrew | brew | d271614872279cce7cec6344d3262f5a19315787.json | install glibc/gcc automatically if too old.
Right now this is done through the gcc@5 formula.
See https://github.com/Homebrew/homebrew-core/blob/9692318ca653f58857fec12136381c9cec290aa9/Formula/gcc%405.rb#L33
This is fragile because when we will migrate to gcc@11
we have to think about migrating the installation from... | Library/Homebrew/development_tools.rb | @@ -98,6 +98,16 @@ def clear_version_cache
@gcc_version = {}
end
+ sig { returns(T::Boolean) }
+ def build_system_too_old?
+ false
+ end
+
+ sig { returns(T::Boolean) }
+ def system_gcc_too_old?
+ false
+ end
+
sig { returns(T::Boolean) }
def ca_file_handles_most_http... | true |
Other | Homebrew | brew | d271614872279cce7cec6344d3262f5a19315787.json | install glibc/gcc automatically if too old.
Right now this is done through the gcc@5 formula.
See https://github.com/Homebrew/homebrew-core/blob/9692318ca653f58857fec12136381c9cec290aa9/Formula/gcc%405.rb#L33
This is fragile because when we will migrate to gcc@11
we have to think about migrating the installation from... | Library/Homebrew/extend/os/dependency_collector.rb | @@ -1,4 +1,8 @@
# typed: strict
# frozen_string_literal: true
-require "extend/os/mac/dependency_collector" if OS.mac?
+if OS.mac?
+ require "extend/os/mac/dependency_collector"
+elsif OS.linux?
+ require "extend/os/linux/dependency_collector"
+end | true |
Other | Homebrew | brew | d271614872279cce7cec6344d3262f5a19315787.json | install glibc/gcc automatically if too old.
Right now this is done through the gcc@5 formula.
See https://github.com/Homebrew/homebrew-core/blob/9692318ca653f58857fec12136381c9cec290aa9/Formula/gcc%405.rb#L33
This is fragile because when we will migrate to gcc@11
we have to think about migrating the installation from... | Library/Homebrew/extend/os/linux/dependency_collector.rb | @@ -0,0 +1,76 @@
+# typed: true
+# frozen_string_literal: true
+
+require "os/linux/glibc"
+
+class DependencyCollector
+ extend T::Sig
+
+ undef gcc_dep_if_needed
+ undef glibc_dep_if_needed
+ undef init_global_dep_tree_if_needed!
+
+ sig { params(related_formula_names: T::Set[String]).returns(T.nilable(Dependenc... | true |
Other | Homebrew | brew | d271614872279cce7cec6344d3262f5a19315787.json | install glibc/gcc automatically if too old.
Right now this is done through the gcc@5 formula.
See https://github.com/Homebrew/homebrew-core/blob/9692318ca653f58857fec12136381c9cec290aa9/Formula/gcc%405.rb#L33
This is fragile because when we will migrate to gcc@11
we have to think about migrating the installation from... | Library/Homebrew/extend/os/linux/development_tools.rb | @@ -21,6 +21,18 @@ def default_compiler
:gcc
end
+ sig { returns(T::Boolean) }
+ def build_system_too_old?
+ return @build_system_too_old if defined? @build_system_too_old
+
+ @build_system_too_old = (system_gcc_too_old? || OS::Linux::Glibc.below_ci_version?)
+ end
+
+ sig { returns(... | true |
Other | Homebrew | brew | d271614872279cce7cec6344d3262f5a19315787.json | install glibc/gcc automatically if too old.
Right now this is done through the gcc@5 formula.
See https://github.com/Homebrew/homebrew-core/blob/9692318ca653f58857fec12136381c9cec290aa9/Formula/gcc%405.rb#L33
This is fragile because when we will migrate to gcc@11
we have to think about migrating the installation from... | Library/Homebrew/extend/os/linux/formula.rb | @@ -5,6 +5,7 @@ class Formula
undef shared_library
undef loader_path
undef deuniversalize_machos
+ undef add_global_deps_to_spec
sig { params(name: String, version: T.nilable(T.any(String, Integer))).returns(String) }
def shared_library(name, version = nil)
@@ -23,4 +24,20 @@ def loader_path
sig ... | true |
Other | Homebrew | brew | d271614872279cce7cec6344d3262f5a19315787.json | install glibc/gcc automatically if too old.
Right now this is done through the gcc@5 formula.
See https://github.com/Homebrew/homebrew-core/blob/9692318ca653f58857fec12136381c9cec290aa9/Formula/gcc%405.rb#L33
This is fragile because when we will migrate to gcc@11
we have to think about migrating the installation from... | Library/Homebrew/extend/os/linux/linkage_checker.rb | @@ -80,9 +80,5 @@ def check_dylibs(rebuild_cache:)
@unwanted_system_dylibs = @system_dylibs.reject do |s|
SYSTEM_LIBRARY_ALLOWLIST.include? File.basename(s)
end
- # FIXME: Remove this when these dependencies are injected correctly (e.g. through `DependencyCollector`)
- # See discussion at
- # ... | true |
Other | Homebrew | brew | d271614872279cce7cec6344d3262f5a19315787.json | install glibc/gcc automatically if too old.
Right now this is done through the gcc@5 formula.
See https://github.com/Homebrew/homebrew-core/blob/9692318ca653f58857fec12136381c9cec290aa9/Formula/gcc%405.rb#L33
This is fragile because when we will migrate to gcc@11
we have to think about migrating the installation from... | Library/Homebrew/formula.rb | @@ -262,9 +262,13 @@ def spec_eval(name)
return unless spec.url
spec.owner = self
+ add_global_deps_to_spec(spec)
instance_variable_set("@#{name}", spec)
end
+ sig { params(spec: SoftwareSpec).void }
+ def add_global_deps_to_spec(spec); end
+
def determine_active_spec(requested)
spec ... | true |
Other | Homebrew | brew | d271614872279cce7cec6344d3262f5a19315787.json | install glibc/gcc automatically if too old.
Right now this is done through the gcc@5 formula.
See https://github.com/Homebrew/homebrew-core/blob/9692318ca653f58857fec12136381c9cec290aa9/Formula/gcc%405.rb#L33
This is fragile because when we will migrate to gcc@11
we have to think about migrating the installation from... | Library/Homebrew/formula_installer.rb | @@ -581,11 +581,9 @@ def expand_requirements
end
def expand_dependencies_for_formula(formula, inherited_options)
- any_bottle_used = false
-
# Cache for this expansion only. FormulaInstaller has a lot of inputs which can alter expansion.
cache_key = "FormulaInstaller-#{formula.full_name}-#{Time.now... | true |
Other | Homebrew | brew | d271614872279cce7cec6344d3262f5a19315787.json | install glibc/gcc automatically if too old.
Right now this is done through the gcc@5 formula.
See https://github.com/Homebrew/homebrew-core/blob/9692318ca653f58857fec12136381c9cec290aa9/Formula/gcc%405.rb#L33
This is fragile because when we will migrate to gcc@11
we have to think about migrating the installation from... | Library/Homebrew/keg_relocate.rb | @@ -366,17 +366,6 @@ def self.text_matches_in_file(file, string, ignores, linked_libraries, formula_a
def self.file_linked_libraries(_file, _string)
[]
end
-
- def self.bottle_dependencies
- return [] unless Homebrew::SimulateSystem.simulating_or_running_on_linux?
-
- @bottle_dependencies ||= begin
- ... | true |
Other | Homebrew | brew | d271614872279cce7cec6344d3262f5a19315787.json | install glibc/gcc automatically if too old.
Right now this is done through the gcc@5 formula.
See https://github.com/Homebrew/homebrew-core/blob/9692318ca653f58857fec12136381c9cec290aa9/Formula/gcc%405.rb#L33
This is fragile because when we will migrate to gcc@11
we have to think about migrating the installation from... | Library/Homebrew/os/linux/glibc.rb | @@ -44,6 +44,11 @@ def minimum_version
def below_minimum_version?
system_version < minimum_version
end
+
+ sig { returns(T::Boolean) }
+ def below_ci_version?
+ system_version < LINUX_GLIBC_CI_VERSION
+ end
end
end
end | true |
Other | Homebrew | brew | d271614872279cce7cec6344d3262f5a19315787.json | install glibc/gcc automatically if too old.
Right now this is done through the gcc@5 formula.
See https://github.com/Homebrew/homebrew-core/blob/9692318ca653f58857fec12136381c9cec290aa9/Formula/gcc%405.rb#L33
This is fragile because when we will migrate to gcc@11
we have to think about migrating the installation from... | Library/Homebrew/software_spec.rb | @@ -50,6 +50,11 @@ def initialize(flags: [])
@uses_from_macos_elements = []
end
+ def initialize_copy(other)
+ super
+ @dependency_collector = @dependency_collector.dup
+ end
+
def owner=(owner)
@name = owner.name
@full_name = owner.full_name | true |
Other | Homebrew | brew | d271614872279cce7cec6344d3262f5a19315787.json | install glibc/gcc automatically if too old.
Right now this is done through the gcc@5 formula.
See https://github.com/Homebrew/homebrew-core/blob/9692318ca653f58857fec12136381c9cec290aa9/Formula/gcc%405.rb#L33
This is fragile because when we will migrate to gcc@11
we have to think about migrating the installation from... | Library/Homebrew/test/installed_dependents_spec.rb | @@ -6,7 +6,20 @@
describe InstalledDependents do
include FileUtils
- def setup_test_keg(name, version)
+ def stub_formula(name, version = "1.0", &block)
+ f = formula(name) do
+ url "#{name}-#{version}"
+
+ instance_eval(&block) if block
+ end
+ stub_formula_loader f
+ stub_formula_loader ... | true |
Other | Homebrew | brew | be4e926b15ec58ff6273e6bf9377cfc8d11e57f9.json | Fix `"dependencies"` being `nil`. | Library/Homebrew/formula_auditor.rb | @@ -888,11 +888,10 @@ def linux_only_gcc_dep?(formula)
# depends_on "gcc"
# end
# ```
- variations_deps = []
- variations.each_value do |data|
- variations_deps += data["dependencies"]
- end
- variations_deps.uniq!
+ variations_deps = variations.values
+ ... | false |
Other | Homebrew | brew | 4bbcab235b69e44affc31a47179a80a818b50c3e.json | change local variable | Library/Homebrew/install.rb | @@ -322,7 +322,7 @@ def install_formulae(
if dry_run
formulae_name_to_install = formulae_to_install.map(&:name)
if formulae_name_to_install.present?
- plural = "package".pluralize(casks_to_install.count)
+ plural = "package".pluralize(formulae_name_to_install.count)
... | false |
Other | Homebrew | brew | 59692b5bf4410436eec5bddc3c3769a67836496a.json | service: provide formula accessor.
Use `f` because it's generally recognised as a formula and this
shouldn't be widely needed/used. | Library/Homebrew/service.rb | @@ -28,6 +28,11 @@ def initialize(formula, &block)
@service_block = block
end
+ sig { returns(Formula) }
+ def f
+ @formula
+ end
+
sig { params(command: T.nilable(T.any(T::Array[String], String, Pathname))).returns(T.nilable(Array)) }
def run(command = nil)
case T.unsafe(co... | false |
Other | Homebrew | brew | 2de6958a36a4ef3172e2269a5ce11f15e94e57e9.json | build_environment: add proper types to dump() and fix inreplace error | Library/Homebrew/build_environment.rb | @@ -55,22 +55,23 @@ def env(*settings)
].freeze
private_constant :KEYS
- sig { params(env: T.untyped).returns(T::Array[String]) }
+ sig { params(env: T::Hash[String, T.nilable(T.any(String, Pathname))]).returns(T::Array[String]) }
def self.keys(env)
KEYS & env.keys
end
- sig { params(env: T.unty... | true |
Other | Homebrew | brew | 2de6958a36a4ef3172e2269a5ce11f15e94e57e9.json | build_environment: add proper types to dump() and fix inreplace error | Library/Homebrew/cmd/--env.rb | @@ -51,7 +51,7 @@ def __env
if shell.nil?
BuildEnvironment.dump ENV
else
- BuildEnvironment.keys(ENV).each do |key|
+ BuildEnvironment.keys(ENV.to_h).each do |key|
puts Utils::Shell.export_value(key, ENV.fetch(key), shell)
end
end | true |
Other | Homebrew | brew | 2de6958a36a4ef3172e2269a5ce11f15e94e57e9.json | build_environment: add proper types to dump() and fix inreplace error | Library/Homebrew/exceptions.rb | @@ -466,9 +466,19 @@ def initialize(formula)
# Raised when an error occurs during a formula build.
class BuildError < RuntimeError
+ extend T::Sig
+
attr_reader :cmd, :args, :env
attr_accessor :formula, :options
+ sig {
+ params(
+ formula: T.nilable(Formula),
+ cmd: T.any(String, Pathnam... | true |
Other | Homebrew | brew | 2de6958a36a4ef3172e2269a5ce11f15e94e57e9.json | build_environment: add proper types to dump() and fix inreplace error | Library/Homebrew/formula.rb | @@ -2219,7 +2219,7 @@ def install; end
def inreplace(paths, before = nil, after = nil, audit_result = true) # rubocop:disable Style/OptionalBooleanParameter
super(paths, before, after, audit_result)
rescue Utils::Inreplace::Error
- raise BuildError.new(self, "inreplace", paths, nil)
+ raise BuildError.... | true |
Other | Homebrew | brew | 8064a39c18d4425a5f1c1999bbea5359414e45fc.json | Prefer newer versions of Python
Some formulae declare multiple Python dependencies, and they can appear
in any order in the `deps` array. Let's make sure to prefer the newest
one when adding their `libexec/"bin"` directory to `PATH`. | Library/Homebrew/extend/ENV/super.rb | @@ -125,7 +125,10 @@ def determine_cxx
sig { returns(T::Array[Pathname]) }
def homebrew_extra_paths
+ # Reverse sort by version so that we prefer the newest when there are multiple.
deps.select { |d| d.name.match? Version.formula_optionally_versioned_regex(:python) }
+ .sort_by(&:version)
+ ... | false |
Other | Homebrew | brew | ad7e5ccc4451136854296958ffd2d87b31280a62.json | Add additional test | Library/Homebrew/test/rubocops/cask/variables_spec.rb | @@ -76,6 +76,37 @@
include_examples "autocorrects source"
end
+ context "when there is an arch variable that doesn't use strings" do
+ let(:source) do
+ <<-CASK.undent
+ cask 'foo' do
+ arch = Hardware::CPU.intel? ? :darwin : :darwin_arm64
+ end
+ CASK
+ end
+ let(:c... | false |
Other | Homebrew | brew | 74a8e5bb235cfdc476b84863e2eb1847fc3eec3e.json | dev-cmd/rubocop: use bundle check.
It's not reliable enough to just check for the binary. | Library/Homebrew/dev-cmd/rubocop.sh | @@ -13,13 +13,16 @@ homebrew-rubocop() {
GEM_VERSION="$("${HOMEBREW_RUBY_PATH}" "${RUBY_DISABLE_OPTIONS}" -rrbconfig -e 'puts RbConfig::CONFIG["ruby_version"]')"
GEM_HOME="${HOMEBREW_LIBRARY}/Homebrew/vendor/bundle/ruby/${GEM_VERSION}"
+ BUNDLE_GEMFILE="${HOMEBREW_LIBRARY}/Homebrew/Gemfile"
- if ! [[ -f "${... | false |
Other | Homebrew | brew | e90371f8abd188c046692ed4998737cba656e697.json | cask: add audit for incorrect signing | Library/Homebrew/cask/audit.rb | @@ -20,28 +20,31 @@ class Audit
attr_reader :cask, :download
- attr_predicate :appcast?, :new_cask?, :strict?, :online?, :token_conflicts?
+ attr_predicate :appcast?, :new_cask?, :strict?, :signing?, :online?, :token_conflicts?
def initialize(cask, appcast: nil, download: nil, quarantine: nil,
- ... | true |
Other | Homebrew | brew | e90371f8abd188c046692ed4998737cba656e697.json | cask: add audit for incorrect signing | Library/Homebrew/cask/auditor.rb | @@ -15,6 +15,7 @@ def self.audit(
audit_online: nil,
audit_new_cask: nil,
audit_strict: nil,
+ audit_signing: nil,
audit_token_conflicts: nil,
quarantine: nil,
any_named_args: nil,
@@ -29,6 +30,7 @@ def self.audit(
audit_online: audit_online,
aud... | true |
Other | Homebrew | brew | e90371f8abd188c046692ed4998737cba656e697.json | cask: add audit for incorrect signing | Library/Homebrew/cask/cmd/audit.rb | @@ -19,6 +19,8 @@ def self.parser
description: "Audit the appcast"
switch "--[no-]token-conflicts",
description: "Audit for token conflicts"
+ switch "--[no-]signing",
+ description: "Audit for signed apps, which is required on ARM"
swit... | true |
Other | Homebrew | brew | e90371f8abd188c046692ed4998737cba656e697.json | cask: add audit for incorrect signing | Library/Homebrew/test/cask/audit_spec.rb | @@ -411,6 +411,53 @@ def tmp_cask(name, text)
end
end
+ describe "signing checks" do
+ let(:download_double) { instance_double(Cask::Download) }
+ let(:unpack_double) { instance_double(UnpackStrategy::Zip) }
+
+ before do
+ allow(audit).to receive(:download).and_return(download_do... | true |
Other | Homebrew | brew | acf39f8777a825d48b4ca46249c75be13614e2d1.json | add TODO comment | Library/Homebrew/cask/cask.rb | @@ -90,6 +90,7 @@ def versions
end
def os_versions
+ # TODO: use #to_hash_with_variations instead once all casks use on_system blocks
@os_versions ||= begin
version_os_hash = {}
actual_version = MacOS.full_version.to_s | false |
Other | Homebrew | brew | 03a489bf78709f9361109d65817ae8821eeef864.json | brew.rb: tell users to fix head issues with inreplace | Library/Homebrew/formula.rb | @@ -69,9 +69,6 @@ class Formula
extend Cachable
extend Predicable
- # @!method inreplace(paths, before = nil, after = nil)
- # @see Utils::Inreplace.inreplace
-
# The name of this {Formula}.
# e.g. `this-formula`
attr_reader :name
@@ -2169,6 +2166,12 @@ def test_fixtures(file)
# end</pre>
def i... | true |
Other | Homebrew | brew | 03a489bf78709f9361109d65817ae8821eeef864.json | brew.rb: tell users to fix head issues with inreplace | Library/Homebrew/test/formula_spec.rb | @@ -483,6 +483,16 @@
end
end
+ describe "::inreplace" do
+ specify "raises build error on failure" do
+ f = formula do
+ url "https://brew.sh/test-1.0.tbz"
+ end
+
+ expect { f.inreplace([]) }.to raise_error(BuildError)
+ end
+ end
+
describe "::installed_with_alias_path" do
... | true |
Other | Homebrew | brew | 03a489bf78709f9361109d65817ae8821eeef864.json | brew.rb: tell users to fix head issues with inreplace | Library/Homebrew/utils/inreplace.rb | @@ -10,7 +10,7 @@ module Utils
module Inreplace
extend T::Sig
- # Error during replacement.
+ # Error during text replacement.
class Error < RuntimeError
def initialize(errors)
formatted_errors = errors.reduce(+"inreplace failed\n") do |s, (path, errs)|
@@ -70,7 +70,7 @@ def inrepla... | true |
Other | Homebrew | brew | 0acadc857c7c5999ee89e9b18f5d6cace34a60e4.json | repair CaskLoader.load args | Library/Homebrew/cask/cask.rb | @@ -96,7 +96,7 @@ def os_versions
MacOSVersions::SYMBOLS.each do |os_name, os_version|
MacOS.full_version = os_version
- cask = CaskLoader.load(token)
+ cask = CaskLoader.load(full_name)
version_os_hash[os_name] = cask.version if cask.version != version
end
| true |
Other | Homebrew | brew | 0acadc857c7c5999ee89e9b18f5d6cace34a60e4.json | repair CaskLoader.load args | Library/Homebrew/cask/cask_loader.rb | @@ -236,9 +236,7 @@ def self.for(ref)
when 2..Float::INFINITY
loaders = possible_tap_casks.map(&FromTapPathLoader.method(:new))
- raise TapCaskAmbiguityError.new(ref, loaders) if loaders.map(&:tap).map(&:name).uniq.size == 1
-
- return FromTapPathLoader.new(possible_tap_casks.first)
+ ... | true |
Other | Homebrew | brew | ddc23eb268328f45fb88031c7b011981c1266f1e.json | update-report: reset `version_scheme` only for runtime dependents
`recursive_dependencies` includes build and test dependencies as well,
which means that we're doing this for too many formulae. | Library/Homebrew/cmd/update-report.rb | @@ -298,7 +298,14 @@ def migrate_gcc_dependents_if_needed
Formula.installed.each do |formula|
next unless formula.tap&.core_tap?
- next unless formula.recursive_dependencies.map(&:name).include? "gcc"
+
+ recursive_runtime_dependencies = Dependency.expand(
+ formula,
+ cache_key: "... | false |
Other | Homebrew | brew | 2d95b9acda5b56380a3ca603fd2e0a0afbfa91f0.json | linux/keg_relocate: remove patchelf exemption
I don't think this is needed anymore. We probably needed this when we
used `patchelf` to do `RPATH` rewriting, but this is no longer the case. | Library/Homebrew/extend/os/linux/keg_relocate.rb | @@ -8,9 +8,6 @@ def relocate_dynamic_linkage(relocation)
# Patching the dynamic linker of glibc breaks it.
return if name.match? Version.formula_optionally_versioned_regex(:glibc)
- # Patching patchelf fails with "Text file busy" or SIGBUS.
- return if name == "patchelf"
-
old_prefix, new_prefix ... | false |
Other | Homebrew | brew | 61544369e45234e3452eb2c21e67c43736aa08a1.json | pr-pull: fix PRs conflicting with themselves
https://github.com/Homebrew/homebrew-core/pull/106755#issuecomment-1206460655 | Library/Homebrew/dev-cmd/pr-pull.rb | @@ -373,6 +373,8 @@ def pr_check_conflicts(user, repo, pr)
"org:#{user}", repo: repo, state: "open", label: "\"no long build conflict\""
).each_with_object({}) do |long_build_pr, hash|
number = long_build_pr["number"]
+ next if number == pr
+
GitHub.get_pull_request_changed_files("#{user}... | false |
Other | Homebrew | brew | a43633e0948dbbb1fceeebcad965c7ccbdc498cb.json | add uniq to check multiple tap | Library/Homebrew/cask/cask_loader.rb | @@ -236,7 +236,7 @@ def self.for(ref)
when 2..Float::INFINITY
loaders = possible_tap_casks.map(&FromTapPathLoader.method(:new))
- raise TapCaskAmbiguityError.new(ref, loaders) if loaders.map(&:tap).map(&:name).size == 1
+ raise TapCaskAmbiguityError.new(ref, loaders) if loaders.map(&:tap... | false |
Other | Homebrew | brew | 2ce58f9fcba5a9c214d9f56c6101b1c5bab3a304.json | fix removing of previous source | Library/Homebrew/mktemp.rb | @@ -47,11 +47,11 @@ def to_s
def run
prefix_name = @prefix.tr "@", "AT"
- if @retain_in_cache
+ if retain_in_cache?
source_dir = "#{HOMEBREW_CACHE}/Sources/#{prefix_name}"
- chmod_rm_rf(source_dir) # clear out previous (otherwise not sure what happens)
- FileUtils.mkdir_p(source_dir)
... | false |
Other | Homebrew | brew | 71ab2f6e7afee7307471cdd61d828c48b68e4c25.json | Run periodic cleanup after installing all packages | Library/Homebrew/cleanup.rb | @@ -156,15 +156,19 @@ def initialize(*args, dry_run: false, scrub: false, days: nil, cache: HOMEBREW_C
def self.install_formula_clean!(f, dry_run: false)
return if Homebrew::EnvConfig.no_install_cleanup?
+ return unless f.latest_version_installed?
+ return if skip_clean_formula?(f)
- clea... | true |
Other | Homebrew | brew | 71ab2f6e7afee7307471cdd61d828c48b68e4c25.json | Run periodic cleanup after installing all packages | Library/Homebrew/cmd/install.rb | @@ -253,6 +253,8 @@ def install
verbose: args.verbose?,
)
+ Cleanup.periodic_clean!
+
Homebrew.messages.display_messages(display_times: args.display_times?)
rescue FormulaUnreadableError, FormulaClassUnavailableError,
TapFormulaUnreadableError, TapFormulaClassUnavai... | true |
Other | Homebrew | brew | 71ab2f6e7afee7307471cdd61d828c48b68e4c25.json | Run periodic cleanup after installing all packages | Library/Homebrew/cmd/reinstall.rb | @@ -151,6 +151,8 @@ def reinstall
)
end
+ Cleanup.periodic_clean!
+
Homebrew.messages.display_messages(display_times: args.display_times?)
end
end | true |
Other | Homebrew | brew | 71ab2f6e7afee7307471cdd61d828c48b68e4c25.json | Run periodic cleanup after installing all packages | Library/Homebrew/cmd/upgrade.rb | @@ -110,6 +110,8 @@ def upgrade
upgrade_outdated_formulae(formulae, args: args) unless only_upgrade_casks
upgrade_outdated_casks(casks, args: args) unless only_upgrade_formulae
+ Cleanup.periodic_clean!(dry_run: args.dry_run?)
+
Homebrew.messages.display_messages(display_times: args.display_times?)
... | true |
Other | Homebrew | brew | 78bf62ee5d05ca6d1fdaa30f48e2a6728968dce9.json | Apply suggestions from code review
Co-authored-by: Adrian Ho <the.gromgit@gmail.com> | docs/Formula-Cookbook.md | @@ -554,7 +554,7 @@ on_linux do
end
```
-Components can also be declared for specific macOS versions or version ranges. For example, to declare a dependency only on High Sierra, nest the `depends_on` call inside an `on_high_sierra` block. Add an `:or_older` or `:or_newer` parameter to the `on_high_sierra` method to... | false |
Other | Homebrew | brew | 8c762d96879d598eaeb9e78abefadb2b6619f631.json | dev-cmd/contributions: Improve Sorbet typing
Co-authored-by: Rylan Polster <rslpolster@gmail.com> | Library/Homebrew/dev-cmd/contributions.rb | @@ -38,7 +38,7 @@ def contributions_args
end
end
- sig { returns(NilClass) }
+ sig { void }
def contributions
args = contributions_args.parse
| false |
Other | Homebrew | brew | 5ecdf10e27f872d445be9947147071f13b280881.json | dev-cmd/contributions: Start output with the name/email
Co-authored-by: Rylan Polster <rslpolster@gmail.com> | Library/Homebrew/dev-cmd/contributions.rb | @@ -65,7 +65,7 @@ def contributions
coauthorships += git_log_coauthor_cmd(T.must(repo_path), args)
end
- sentence = "Person #{args.named.first} directly authored #{commits} commits " \
+ sentence = "#{args.named.first} directly authored #{commits} commits " \
"and co-authored #{coaut... | false |
Other | Homebrew | brew | 0c7825accd9ad960cc045e503bb4edab3a955b2a.json | dev-cmd/contributions: Make the first arg either a name or email
- This is easier than mapping GitHub usernames to email addresses, when
folks don't have email addresses always public on their GitHub
profiles. Also, the users of this command (PLC members, other
interested parties) don't have to remember folks' e... | Library/Homebrew/dev-cmd/contributions.rb | @@ -17,10 +17,12 @@ module Homebrew
sig { returns(CLI::Parser) }
def contributions_args
Homebrew::CLI::Parser.new do
- usage_banner "`contributions` <email> <repo1,repo2|all>"
+ usage_banner "`contributions` <email|name> <repo1,repo2|all>"
description <<~EOS
Contributions to Homebre... | false |
Other | Homebrew | brew | ae73f28d0fb6ccba90462fd9e0b5660a2c835d6b.json | dev-cmd/contributions: Use a named arg for required `repositories`
- This is apparently "more in-keeping with how we do required arguments
(never requiring flags)" across Homebrew.
- New usage: `brew contributions me@issyl0.co.uk all`, `brew
contributions me@issyl0.co.uk brew,core` | Library/Homebrew/dev-cmd/contributions.rb | @@ -17,9 +17,13 @@ module Homebrew
sig { returns(CLI::Parser) }
def contributions_args
Homebrew::CLI::Parser.new do
- usage_banner "`contributions` [<email>]"
+ usage_banner "`contributions` <email> <repo1,repo2|all>"
description <<~EOS
Contributions to Homebrew repos for a user.
+
... | false |
Other | Homebrew | brew | c02e03a1798c383863ee87b7a14a66a122db6679.json | dev-cmd/contributions: Use methods to get arguments
- I got these with hash syntax because I couldn't figure out Sorbet, but
there's `args.rbi` to add the CLI args methods to. Nice!
- In doing this I realised that `--repositories` is required again, we
no longer infer `--repositories=all` from no `--repositories` ... | Library/Homebrew/cli/args.rbi | @@ -300,6 +300,15 @@ module Homebrew
sig { returns(T.nilable(String)) }
def screen_saverdir; end
+ sig { returns(T::Array[String])}
+ def repositories; end
+
+ sig { returns(T.nilable(String)) }
+ def from; end
+
+ sig { returns(T.nilable(String)) }
+ def to; end
+
s... | true |
Other | Homebrew | brew | c02e03a1798c383863ee87b7a14a66a122db6679.json | dev-cmd/contributions: Use methods to get arguments
- I got these with hash syntax because I couldn't figure out Sorbet, but
there's `args.rbi` to add the CLI args methods to. Nice!
- In doing this I realised that `--repositories` is required again, we
no longer infer `--repositories=all` from no `--repositories` ... | Library/Homebrew/dev-cmd/contributions.rb | @@ -40,12 +40,13 @@ def contributions_args
sig { returns(NilClass) }
def contributions
args = contributions_args.parse
+ return ofail "Please specify `--repositories` to search, or `--repositories=all`." unless args[:repositories].empty?
commits = 0
coauthorships = 0
- all_repos = args[:r... | true |
Other | Homebrew | brew | 63a1a078b9b101fd5654ffcdf099632f3f258851.json | dev-cmd/contributions: Improve `SUPPORTED_REPOS` array syntax
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com> | Library/Homebrew/dev-cmd/contributions.rb | @@ -8,11 +8,11 @@ module Homebrew
module_function
- SUPPORTED_REPOS = (
- %w[brew core cask] +
- OFFICIAL_CMD_TAPS.keys.map { |t| t.delete_prefix("homebrew/") } +
- OFFICIAL_CASK_TAPS
- ).freeze
+ SUPPORTED_REPOS = [
+ %w[brew core cask],
+ OFFICIAL_CMD_TAPS.keys.map { |t| t.delete_pref... | false |
Other | Homebrew | brew | 6f79b5dee292257692148017529f6b25badc47cb.json | Minor change: fix the argument for formulae | Library/Homebrew/livecheck/livecheck.rb | @@ -361,7 +361,7 @@ def run_checks(
end
puts if debug
print_latest_version(info, verbose: verbose, ambiguous_cask: ambiguous_casks.include?(formula_or_cask),
-check_resource: false)
+resource: false)
if check_resources && formula_or_cask.resources.present?
resources_info... | false |
Other | Homebrew | brew | d5f949e60b6d78aa50f0409a2dfb50a63eaa554e.json | Check dependency order in on_system methods | Library/Homebrew/rubocops/components_order.rb | @@ -14,12 +14,6 @@ module FormulaAudit
class ComponentsOrder < FormulaCop
extend AutoCorrector
- def on_system_methods
- @on_system_methods ||= [:intel, :arm, :macos, :linux, :system, *MacOSVersions::SYMBOLS.keys].map do |m|
- :"on_#{m}"
- end
- end
-
... | true |
Other | Homebrew | brew | d5f949e60b6d78aa50f0409a2dfb50a63eaa554e.json | Check dependency order in on_system methods | Library/Homebrew/rubocops/dependency_order.rb | @@ -16,7 +16,7 @@ class DependencyOrder < FormulaCop
def audit_formula(_node, _class_node, _parent_class_node, body_node)
check_dependency_nodes_order(body_node)
check_uses_from_macos_nodes_order(body_node)
- [:head, :stable].each do |block_name|
+ ([:head, :stable] + on... | true |
Other | Homebrew | brew | d5f949e60b6d78aa50f0409a2dfb50a63eaa554e.json | Check dependency order in on_system methods | Library/Homebrew/rubocops/extend/formula.rb | @@ -198,6 +198,12 @@ def file_path_allowed?
@file_path !~ Regexp.union(paths_to_exclude)
end
+
+ def on_system_methods
+ @on_system_methods ||= [:intel, :arm, :macos, :linux, :system, *MacOSVersions::SYMBOLS.keys].map do |m|
+ :"on_#{m}"
+ end
+ end
end
end
en... | true |
Other | Homebrew | brew | fec5b4080a87cb99e1aff19d36afcbbec4f725cf.json | linux/diagnostic: add check for versioned GCC linkage
This complements my other two GCC-on-Linux PRs (#13631, #13633), however
they are both reliant on bottles eventually being (re-)poured.
Let's try to speed that up by returning an error message from `brew doctor`
whenever a user has formulae installed that would be... | Library/Homebrew/extend/os/linux/diagnostic.rb | @@ -139,6 +139,34 @@ def check_linuxbrew_bottle_domain
e.g. by using homebrew instead).
EOS
end
+
+ def check_gcc_dependent_linkage
+ gcc_dependents = Formula.installed.select do |formula|
+ next false unless formula.tap&.core_tap?
+
+ formula.recursive_dependenc... | false |
Other | Homebrew | brew | e1f8fa2c9be199365e25cd1ab490095001c18aa8.json | Improve settings name
This leads to a slightly more readable entry in `.git/config`. | Library/Homebrew/cmd/update-report.rb | @@ -294,7 +294,7 @@ def link_completions_manpages_and_docs(repository = HOMEBREW_REPOSITORY)
def migrate_gcc_dependents_if_needed
return if OS.mac?
- return if Settings.read("gcc.dep.rpaths.migrated") == "true"
+ return if Settings.read("gcc-rpaths.fixed") == "true"
Formula.installed.each do |for... | false |
Other | Homebrew | brew | 023261038192a4f55c95a4d2486873ec1c9a728a.json | official_taps: Refer to`Homebrew/homebrew-cask-versions` properly
- This is needed for https://github.com/Homebrew/brew/pull/13603 because `Homebrew/homebrew-versions` is deprecated (legitimately), but `OFFICIAL_CASK_TAPS` spits out `versions` as a repo, which could then be interpreted as `Homebrew/versions` rather th... | Library/Homebrew/official_taps.rb | @@ -3,7 +3,7 @@
OFFICIAL_CASK_TAPS = %w[
cask
- versions
+ cask-versions
].freeze
OFFICIAL_CMD_TAPS = { | false |
Other | Homebrew | brew | 7326019c93bb271899e379e524c7001e84d9c7eb.json | Add clarification comment | Library/Homebrew/extend/on_system.rb | @@ -32,6 +32,8 @@ def os_condition_met?(os_name, or_condition = nil)
base_os = MacOS::Version.from_symbol(os_name)
current_os = if Homebrew::SimulateSystem.current_os == :macos
+ # Assume the oldest macOS version when simulating a generic macOS version
+ # Version::NULL is always treated as less t... | false |
Other | Homebrew | brew | d04051a9b94553fb4290929f12aeb5c72062d2aa.json | Add integration tests for autoremove cmd | Library/Homebrew/test/cmd/autoremove_spec.rb | @@ -5,4 +5,34 @@
describe "brew autoremove" do
it_behaves_like "parseable arguments"
+
+ describe "integration test" do
+ let(:requested_formula) { Formula["testball1"] }
+ let(:unused_formula) { Formula["testball2"] }
+
+ before do
+ install_test_formula "testball1"
+ install_test_formula "te... | false |
Other | Homebrew | brew | 88a69b3de20e0faa12f8dee2c2298617d76b55ec.json | Restore previous style | Library/Homebrew/build.rb | @@ -78,17 +78,27 @@ def install
ENV.keg_only_deps = keg_only_deps
ENV.deps = formula_deps
ENV.run_time_deps = run_time_deps
- ENV.setup_build_environment(formula: formula, cc: args.cc, build_bottle: args.build_bottle?,
- bottle_arch: args.bottle_arch, debug_sy... | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.