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
75e2f1a2a9cd3d09aeae7a5fbbae81c1edc2045e.json
sorbet: Update RBI files. Autogenerated by the [sorbet](https://github.com/Homebrew/brew/blob/master/.github/workflows/sorbet.yml) workflow.
Library/Homebrew/sorbet/rbi/gems/simplecov@0.19.1.rbi
@@ -0,0 +1,8 @@ +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `simplecov` gem. +# Please instead update this file by running `tapioca sync`. + +# typed: true + +# THIS IS AN EMPTY RBI FILE. +# see https://github.com/Shopify/tapioca/blob/master/README.md#manual-gem-requires
true
Other
Homebrew
brew
1702b34f18f1244d913482d848fd64bb7a771009.json
update-test: improve debugging output. Output more information about the refs and commit message for the start, expected and actual end commits to ease debugging.
Library/Homebrew/dev-cmd/update-test.rb
@@ -114,11 +114,14 @@ def update_test safe_system "brew", "update", "--verbose" actual_end_commit = Utils.popen_read("git", "rev-parse", branch).chomp if actual_end_commit != end_commit + start_log = Utils.popen_read("git", "log", "-1", "--decorate", "--oneline", start_commit).chomp + end_log = Utils.popen_read("git", "log", "-1", "--decorate", "--oneline", end_commit).chomp + actual_log = Utils.popen_read("git", "log", "-1", "--decorate", "--oneline", actual_end_commit).chomp raise <<~EOS brew update didn't update #{branch}! - Start commit: #{start_commit} - Expected end commit: #{end_commit} - Actual end commit: #{actual_end_commit} + Start commit: #{start_log} + Expected end commit: #{end_log} + Actual end commit: #{actual_log} EOS end end
false
Other
Homebrew
brew
be4723fac8d2d6b317d5b1eaf2149de74299a3d5.json
Allow both python@3.8 and python@3.9
Library/Homebrew/dev-cmd/audit.rb
@@ -582,6 +582,7 @@ def audit_postgresql lua@5.1 numpy@1.16 openssl@1.1 + python@3.8 python@3.9 ].freeze
false
Other
Homebrew
brew
a176c3f75ba60ecca3701ceb219de6592dbe66d6.json
shared_audits: add nuclear to GITHUB_PRERELEASE_ALLOWLIST
Library/Homebrew/utils/shared_audits.rb
@@ -39,6 +39,7 @@ def github_release_data(user, repo, tag) "gitless" => "0.8.8", "home-assistant" => :all, "infrakit" => "0.5", + "nuclear" => :all, "pock" => :all, "riff" => "0.5.0", "telegram-cli" => "1.3.1",
false
Other
Homebrew
brew
35a7e336bef8b972495ef135571feceb46c3c57c.json
node: add support for npm 7 Co-Authored-By: Mike McQuaid <mike@mikemcquaid.com>
Library/Homebrew/language/node.rb
@@ -44,6 +44,9 @@ def self.std_npm_install_args(libexec) pack = pack_for_installation + # npm 7 requires that these dirs exist before install + (libexec/"lib").mkpath + # npm install args for global style module format installed into libexec args = %W[ -ddd
true
Other
Homebrew
brew
35a7e336bef8b972495ef135571feceb46c3c57c.json
node: add support for npm 7 Co-Authored-By: Mike McQuaid <mike@mikemcquaid.com>
Library/Homebrew/test/language/node_spec.rb
@@ -25,7 +25,7 @@ end describe "#std_npm_install_args" do - npm_install_arg = "libexec" + npm_install_arg = Pathname("libexec") npm_pack_cmd = "npm pack --ignore-scripts" it "raises error with non zero exitstatus" do
true
Other
Homebrew
brew
42d75c2787e3e68d81b23865a67111c48a670d9e.json
formula_installer: fix forbidden license check Convert forbidden licenses to a string before duplicating to have empty strings instead of `nil`.
Library/Homebrew/formula_installer.rb
@@ -1139,7 +1139,7 @@ def puts_requirement_messages end def forbidden_license_check - forbidden_licenses = Homebrew::EnvConfig.forbidden_licenses.dup + forbidden_licenses = Homebrew::EnvConfig.forbidden_licenses.to_s.dup SPDX::ALLOWED_LICENSE_SYMBOLS.each do |s| pattern = /#{s.to_s.tr("_", " ")}/i forbidden_licenses.sub!(pattern, s.to_s)
false
Other
Homebrew
brew
b06bcf3db154cfb27fc7ce240136719284e95b09.json
formula_installer: unfreeze forbidden licenses string
Library/Homebrew/formula_installer.rb
@@ -1139,10 +1139,10 @@ def puts_requirement_messages end def forbidden_license_check - forbidden_licenses = Homebrew::EnvConfig.forbidden_licenses.to_s + forbidden_licenses = Homebrew::EnvConfig.forbidden_licenses.dup SPDX::ALLOWED_LICENSE_SYMBOLS.each do |s| pattern = /#{s.to_s.tr("_", " ")}/i - forbidden_licenses = forbidden_licenses.sub(pattern, s.to_s) + forbidden_licenses.sub!(pattern, s.to_s) end forbidden_licenses = forbidden_licenses.split(" ").to_h do |license| [license, SPDX.license_version_info(license)]
false
Other
Homebrew
brew
24523f82250787e243fd2fc2ec9854ed43bd0d73.json
utils/spdx: allow other license symbols
Library/Homebrew/formula_installer.rb
@@ -1139,11 +1139,12 @@ def puts_requirement_messages end def forbidden_license_check - forbidden_licenses = Homebrew::EnvConfig.forbidden_licenses - .to_s - .sub("Public Domain", "public_domain") - .split(" ") - .to_h do |license| + forbidden_licenses = Homebrew::EnvConfig.forbidden_licenses.to_s + SPDX::ALLOWED_LICENSE_SYMBOLS.each do |s| + pattern = /#{s.to_s.tr("_", " ")}/i + forbidden_licenses = forbidden_licenses.sub(pattern, s.to_s) + end + forbidden_licenses = forbidden_licenses.split(" ").to_h do |license| [license, SPDX.license_version_info(license)] end
true
Other
Homebrew
brew
24523f82250787e243fd2fc2ec9854ed43bd0d73.json
utils/spdx: allow other license symbols
Library/Homebrew/test/utils/spdx_spec.rb
@@ -91,6 +91,10 @@ it "returns :public_domain" do expect(described_class.parse_license_expression(:public_domain).first).to eq [:public_domain] end + + it "returns :cannot_represent" do + expect(described_class.parse_license_expression(:cannot_represent).first).to eq [:cannot_represent] + end end describe ".valid_license?" do @@ -113,6 +117,14 @@ it "returns true for :public_domain" do expect(described_class.valid_license?(:public_domain)).to eq true end + + it "returns true for :cannot_represent" do + expect(described_class.valid_license?(:cannot_represent)).to eq true + end + + it "returns false for invalid symbol" do + expect(described_class.valid_license?(:invalid_symbol)).to eq false + end end describe ".deprecated_license?" do @@ -131,6 +143,10 @@ it "returns false for :public_domain" do expect(described_class.deprecated_license?(:public_domain)).to eq false end + + it "returns false for :cannot_represent" do + expect(described_class.deprecated_license?(:cannot_represent)).to eq false + end end describe ".valid_license_exception?" do @@ -187,9 +203,13 @@ it "returns :public_domain" do expect(described_class.license_expression_to_string(:public_domain)).to eq "Public Domain" end + + it "returns :cannot_represent" do + expect(described_class.license_expression_to_string(:cannot_represent)).to eq "Cannot Represent" + end end - describe ".license_version_info_info" do + describe ".license_version_info" do it "returns license without version" do expect(described_class.license_version_info("MIT")).to eq ["MIT"] end
true
Other
Homebrew
brew
24523f82250787e243fd2fc2ec9854ed43bd0d73.json
utils/spdx: allow other license symbols
Library/Homebrew/utils/spdx.rb
@@ -15,6 +15,10 @@ module SPDX DATA_PATH = (HOMEBREW_DATA_PATH/"spdx").freeze API_URL = "https://api.github.com/repos/spdx/license-list-data/releases/latest" + ALLOWED_LICENSE_SYMBOLS = [ + :public_domain, + :cannot_represent, + ].freeze def license_data @license_data ||= JSON.parse (DATA_PATH/"spdx_licenses.json").read @@ -64,14 +68,14 @@ def parse_license_expression(license_expression) end def valid_license?(license) - return true if license == :public_domain + return ALLOWED_LICENSE_SYMBOLS.include? license if license.is_a? Symbol license = license.delete_suffix "+" license_data["licenses"].any? { |spdx_license| spdx_license["licenseId"] == license } end def deprecated_license?(license) - return false if license == :public_domain + return false if ALLOWED_LICENSE_SYMBOLS.include? license return false unless valid_license?(license) license_data["licenses"].none? do |spdx_license| @@ -89,8 +93,8 @@ def license_expression_to_string(license_expression, bracket: false, hash_type: case license_expression when String license_expression - when :public_domain - "Public Domain" + when Symbol + license_expression.to_s.tr("_", " ").titleize when Hash expressions = [] @@ -125,7 +129,7 @@ def license_expression_to_string(license_expression, bracket: false, hash_type: end def license_version_info(license) - return [license] if license == :public_domain + return [license] if ALLOWED_LICENSE_SYMBOLS.include? license match = license.match(/-(?<version>[0-9.]+)(?:-.*?)??(?<or_later>\+|-only|-or-later)?$/) return [license] if match.blank?
true
Other
Homebrew
brew
1648011189a8b300b955fd7ec4b2e4eab40d7c0a.json
rubocops: permit openjdk@8 to bootstrap
Library/Homebrew/rubocops/urls.rb
@@ -44,6 +44,7 @@ class Urls < FormulaCop mlton openjdk openjdk@11 + openjdk@8 pypy sbcl rust
false
Other
Homebrew
brew
392f2e3a5c36cb5b551a8dc7dcef6ce513c89833.json
sorbet: Update RBI files. Autogenerated by the [sorbet](https://github.com/Homebrew/brew/blob/master/.github/workflows/sorbet.yml) workflow.
Library/Homebrew/sorbet/rbi/gems/rubocop-rspec@1.44.1.rbi
@@ -1,6 +1,6 @@ # DO NOT EDIT MANUALLY # This is an autogenerated file for types exported from the `rubocop-rspec` gem. -# Please instead update this file by running `tapioca sync --exclude json`. +# Please instead update this file by running `tapioca sync`. # typed: true @@ -74,15 +74,15 @@ end RuboCop::Cop::RSpec::AlignRightLetBrace::MSG = T.let(T.unsafe(nil), String) class RuboCop::Cop::RSpec::AnyInstance < ::RuboCop::Cop::RSpec::Base - def disallowed_stub(node = T.unsafe(nil)); end + def disallowed_stub(param0 = T.unsafe(nil)); end def on_send(node); end end RuboCop::Cop::RSpec::AnyInstance::MSG = T.let(T.unsafe(nil), String) class RuboCop::Cop::RSpec::AroundBlock < ::RuboCop::Cop::RSpec::Base - def find_arg_usage(node0); end - def hook(node = T.unsafe(nil)); end + def find_arg_usage(param0); end + def hook(param0 = T.unsafe(nil)); end def on_block(node); end private @@ -119,7 +119,7 @@ RuboCop::Cop::RSpec::Base::DEFAULT_CONFIGURATION = T.let(T.unsafe(nil), Hash) RuboCop::Cop::RSpec::Base::DEFAULT_PATTERN_RE = T.let(T.unsafe(nil), Regexp) class RuboCop::Cop::RSpec::Be < ::RuboCop::Cop::RSpec::Base - def be_without_args(node = T.unsafe(nil)); end + def be_without_args(param0 = T.unsafe(nil)); end def on_send(node); end end @@ -128,14 +128,14 @@ RuboCop::Cop::RSpec::Be::MSG = T.let(T.unsafe(nil), String) class RuboCop::Cop::RSpec::BeEql < ::RuboCop::Cop::RSpec::Base extend(::RuboCop::Cop::AutoCorrector) - def eql_type_with_identity(node = T.unsafe(nil)); end + def eql_type_with_identity(param0 = T.unsafe(nil)); end def on_send(node); end end RuboCop::Cop::RSpec::BeEql::MSG = T.let(T.unsafe(nil), String) class RuboCop::Cop::RSpec::BeforeAfterAll < ::RuboCop::Cop::RSpec::Base - def before_or_after_all(node = T.unsafe(nil)); end + def before_or_after_all(param0 = T.unsafe(nil)); end def on_send(node); end end @@ -147,10 +147,10 @@ end class RuboCop::Cop::RSpec::Capybara::CurrentPathExpectation < ::RuboCop::Cop::RSpec::Base extend(::RuboCop::Cop::AutoCorrector) - def as_is_matcher(node = T.unsafe(nil)); end - def expectation_set_on_current_path(node = T.unsafe(nil)); end + def as_is_matcher(param0 = T.unsafe(nil)); end + def expectation_set_on_current_path(param0 = T.unsafe(nil)); end def on_send(node); end - def regexp_str_matcher(node = T.unsafe(nil)); end + def regexp_str_matcher(param0 = T.unsafe(nil)); end private @@ -165,11 +165,11 @@ RuboCop::Cop::RSpec::Capybara::CurrentPathExpectation::MSG = T.let(T.unsafe(nil) class RuboCop::Cop::RSpec::Capybara::FeatureMethods < ::RuboCop::Cop::RSpec::Base extend(::RuboCop::Cop::AutoCorrector) - def capybara_speak(node = T.unsafe(nil)); end - def feature_method(node = T.unsafe(nil)); end + def capybara_speak(param0 = T.unsafe(nil)); end + def feature_method(param0 = T.unsafe(nil)); end def message(range); end def on_block(node); end - def spec?(node = T.unsafe(nil)); end + def spec?(param0 = T.unsafe(nil)); end private @@ -186,8 +186,8 @@ RuboCop::Cop::RSpec::Capybara::FeatureMethods::MSG = T.let(T.unsafe(nil), String class RuboCop::Cop::RSpec::Capybara::VisibilityMatcher < ::RuboCop::Cop::RSpec::Base def on_send(node); end - def visible_false?(node = T.unsafe(nil)); end - def visible_true?(node = T.unsafe(nil)); end + def visible_false?(param0 = T.unsafe(nil)); end + def visible_true?(param0 = T.unsafe(nil)); end private @@ -203,7 +203,7 @@ RuboCop::Cop::RSpec::Capybara::VisibilityMatcher::MSG_TRUE = T.let(T.unsafe(nil) class RuboCop::Cop::RSpec::ContextMethod < ::RuboCop::Cop::RSpec::Base extend(::RuboCop::Cop::AutoCorrector) - def context_method(node = T.unsafe(nil)); end + def context_method(param0 = T.unsafe(nil)); end def on_block(node); end private @@ -214,7 +214,7 @@ end RuboCop::Cop::RSpec::ContextMethod::MSG = T.let(T.unsafe(nil), String) class RuboCop::Cop::RSpec::ContextWording < ::RuboCop::Cop::RSpec::Base - def context_wording(node = T.unsafe(nil)); end + def context_wording(param0 = T.unsafe(nil)); end def on_block(node); end private @@ -231,13 +231,15 @@ RuboCop::Cop::RSpec::Cop = RuboCop::Cop::RSpec::Base class RuboCop::Cop::RSpec::DescribeClass < ::RuboCop::Cop::RSpec::Base include(::RuboCop::RSpec::TopLevelGroup) - def example_group_with_rails_metadata?(node = T.unsafe(nil)); end - def not_a_const_described(node = T.unsafe(nil)); end - def on_top_level_group(top_level_node); end - def rails_metadata?(node = T.unsafe(nil)); end + def example_group_with_ignored_metadata?(param0 = T.unsafe(nil)); end + def not_a_const_described(param0 = T.unsafe(nil)); end + def on_top_level_group(node); end + def sym_pair(param0 = T.unsafe(nil)); end private + def ignored_metadata; end + def ignored_metadata?(node); end def string_constant?(described); end end @@ -247,13 +249,13 @@ class RuboCop::Cop::RSpec::DescribeMethod < ::RuboCop::Cop::RSpec::Base include(::RuboCop::RSpec::TopLevelGroup) def on_top_level_group(node); end - def second_argument(node = T.unsafe(nil)); end + def second_argument(param0 = T.unsafe(nil)); end end RuboCop::Cop::RSpec::DescribeMethod::MSG = T.let(T.unsafe(nil), String) class RuboCop::Cop::RSpec::DescribeSymbol < ::RuboCop::Cop::RSpec::Base - def describe_symbol?(node = T.unsafe(nil)); end + def describe_symbol?(param0 = T.unsafe(nil)); end def on_send(node); end end @@ -263,12 +265,12 @@ class RuboCop::Cop::RSpec::DescribedClass < ::RuboCop::Cop::RSpec::Base include(::RuboCop::Cop::ConfigurableEnforcedStyle) extend(::RuboCop::Cop::AutoCorrector) - def common_instance_exec_closure?(node = T.unsafe(nil)); end - def contains_described_class?(node0); end - def described_constant(node = T.unsafe(nil)); end + def common_instance_exec_closure?(param0 = T.unsafe(nil)); end + def contains_described_class?(param0); end + def described_constant(param0 = T.unsafe(nil)); end def on_block(node); end - def rspec_block?(node = T.unsafe(nil)); end - def scope_changing_syntax?(node = T.unsafe(nil)); end + def rspec_block?(param0 = T.unsafe(nil)); end + def scope_changing_syntax?(param0 = T.unsafe(nil)); end private @@ -291,7 +293,7 @@ RuboCop::Cop::RSpec::DescribedClass::DESCRIBED_CLASS = T.let(T.unsafe(nil), Stri RuboCop::Cop::RSpec::DescribedClass::MSG = T.let(T.unsafe(nil), String) class RuboCop::Cop::RSpec::DescribedClassModuleWrapping < ::RuboCop::Cop::RSpec::Base - def find_rspec_blocks(node0); end + def find_rspec_blocks(param0); end def on_module(node); end end @@ -302,23 +304,26 @@ class RuboCop::Cop::RSpec::Dialect < ::RuboCop::Cop::RSpec::Base extend(::RuboCop::Cop::AutoCorrector) def on_send(node); end - def rspec_method?(node = T.unsafe(nil)); end + def rspec_method?(param0 = T.unsafe(nil)); end end RuboCop::Cop::RSpec::Dialect::MSG = T.let(T.unsafe(nil), String) class RuboCop::Cop::RSpec::EmptyExampleGroup < ::RuboCop::Cop::RSpec::Base - def example_group_body(node = T.unsafe(nil)); end - def example_or_group_or_include?(node = T.unsafe(nil)); end - def examples?(node = T.unsafe(nil)); end - def examples_directly_or_in_block?(node = T.unsafe(nil)); end - def examples_inside_block?(node = T.unsafe(nil)); end + def example_group_body(param0 = T.unsafe(nil)); end + def example_or_group_or_include?(param0 = T.unsafe(nil)); end + def examples?(param0 = T.unsafe(nil)); end + def examples_directly_or_in_block?(param0 = T.unsafe(nil)); end + def examples_inside_block?(param0 = T.unsafe(nil)); end def on_block(node); end private + def conditionals_with_examples?(body); end def custom_include?(method_name); end def custom_include_methods; end + def examples_in_branches?(if_node); end + def offensive?(body); end end RuboCop::Cop::RSpec::EmptyExampleGroup::MSG = T.let(T.unsafe(nil), String) @@ -327,7 +332,7 @@ class RuboCop::Cop::RSpec::EmptyHook < ::RuboCop::Cop::RSpec::Base include(::RuboCop::Cop::RangeHelp) extend(::RuboCop::Cop::AutoCorrector) - def empty_hook?(node = T.unsafe(nil)); end + def empty_hook?(param0 = T.unsafe(nil)); end def on_block(node); end end @@ -414,7 +419,7 @@ RuboCop::Cop::RSpec::ExampleLength::MSG = T.let(T.unsafe(nil), String) class RuboCop::Cop::RSpec::ExampleWithoutDescription < ::RuboCop::Cop::RSpec::Base include(::RuboCop::Cop::ConfigurableEnforcedStyle) - def example_description(node = T.unsafe(nil)); end + def example_description(param0 = T.unsafe(nil)); end def on_block(node); end private @@ -430,7 +435,7 @@ RuboCop::Cop::RSpec::ExampleWithoutDescription::MSG_DEFAULT_ARGUMENT = T.let(T.u class RuboCop::Cop::RSpec::ExampleWording < ::RuboCop::Cop::RSpec::Base extend(::RuboCop::Cop::AutoCorrector) - def it_description(node = T.unsafe(nil)); end + def it_description(param0 = T.unsafe(nil)); end def on_block(node); end private @@ -454,7 +459,7 @@ RuboCop::Cop::RSpec::ExampleWording::SHOULD_PREFIX = T.let(T.unsafe(nil), Regexp class RuboCop::Cop::RSpec::ExpectActual < ::RuboCop::Cop::RSpec::Base extend(::RuboCop::Cop::AutoCorrector) - def expect_literal(node = T.unsafe(nil)); end + def expect_literal(param0 = T.unsafe(nil)); end def on_send(node); end private @@ -477,8 +482,8 @@ class RuboCop::Cop::RSpec::ExpectChange < ::RuboCop::Cop::RSpec::Base include(::RuboCop::Cop::ConfigurableEnforcedStyle) extend(::RuboCop::Cop::AutoCorrector) - def expect_change_with_arguments(node = T.unsafe(nil)); end - def expect_change_with_block(node = T.unsafe(nil)); end + def expect_change_with_arguments(param0 = T.unsafe(nil)); end + def expect_change_with_block(param0 = T.unsafe(nil)); end def on_block(node); end def on_send(node); end end @@ -488,7 +493,7 @@ RuboCop::Cop::RSpec::ExpectChange::MSG_BLOCK = T.let(T.unsafe(nil), String) RuboCop::Cop::RSpec::ExpectChange::MSG_CALL = T.let(T.unsafe(nil), String) class RuboCop::Cop::RSpec::ExpectInHook < ::RuboCop::Cop::RSpec::Base - def expectation(node0); end + def expectation(param0); end def on_block(node); end private @@ -512,8 +517,8 @@ module RuboCop::Cop::RSpec::ExplicitHelper include(::RuboCop::RSpec::Language) extend(::RuboCop::AST::NodePattern::Macros) - def predicate_matcher?(node = T.unsafe(nil)); end - def predicate_matcher_block?(node = T.unsafe(nil)); end + def predicate_matcher?(param0 = T.unsafe(nil)); end + def predicate_matcher_block?(param0 = T.unsafe(nil)); end private @@ -537,10 +542,10 @@ end class RuboCop::Cop::RSpec::FactoryBot::AttributeDefinedStatically < ::RuboCop::Cop::RSpec::Base extend(::RuboCop::Cop::AutoCorrector) - def association?(node = T.unsafe(nil)); end - def factory_attributes(node = T.unsafe(nil)); end + def association?(param0 = T.unsafe(nil)); end + def factory_attributes(param0 = T.unsafe(nil)); end def on_block(node); end - def value_matcher(node = T.unsafe(nil)); end + def value_matcher(param0 = T.unsafe(nil)); end private @@ -562,9 +567,9 @@ class RuboCop::Cop::RSpec::FactoryBot::CreateList < ::RuboCop::Cop::RSpec::Base include(::RuboCop::Cop::ConfigurableEnforcedStyle) extend(::RuboCop::Cop::AutoCorrector) - def factory_call(node = T.unsafe(nil)); end - def factory_list_call(node = T.unsafe(nil)); end - def n_times_block_without_arg?(node = T.unsafe(nil)); end + def factory_call(param0 = T.unsafe(nil)); end + def factory_list_call(param0 = T.unsafe(nil)); end + def n_times_block_without_arg?(param0 = T.unsafe(nil)); end def on_block(node); end def on_send(node); end @@ -620,7 +625,7 @@ end class RuboCop::Cop::RSpec::FactoryBot::FactoryClassName < ::RuboCop::Cop::RSpec::Base extend(::RuboCop::Cop::AutoCorrector) - def class_name(node = T.unsafe(nil)); end + def class_name(param0 = T.unsafe(nil)); end def on_send(node); end private @@ -635,9 +640,9 @@ RuboCop::Cop::RSpec::FactoryBot::FactoryClassName::MSG = T.let(T.unsafe(nil), St class RuboCop::Cop::RSpec::FilePath < ::RuboCop::Cop::RSpec::Base include(::RuboCop::RSpec::TopLevelGroup) - def const_described(node = T.unsafe(nil)); end + def const_described(param0 = T.unsafe(nil)); end def on_top_level_example_group(node); end - def routing_metadata?(node0); end + def routing_metadata?(param0); end private @@ -658,9 +663,9 @@ end RuboCop::Cop::RSpec::FilePath::MSG = T.let(T.unsafe(nil), String) class RuboCop::Cop::RSpec::Focus < ::RuboCop::Cop::RSpec::Base - def focusable_selector?(node = T.unsafe(nil)); end - def focused_block?(node = T.unsafe(nil)); end - def metadata(node = T.unsafe(nil)); end + def focusable_selector?(param0 = T.unsafe(nil)); end + def focused_block?(param0 = T.unsafe(nil)); end + def metadata(param0 = T.unsafe(nil)); end def on_send(node); end private @@ -674,10 +679,10 @@ class RuboCop::Cop::RSpec::HookArgument < ::RuboCop::Cop::RSpec::Base include(::RuboCop::Cop::ConfigurableEnforcedStyle) extend(::RuboCop::Cop::AutoCorrector) - def hook?(node = T.unsafe(nil)); end + def hook?(param0 = T.unsafe(nil)); end def on_block(node); end - def scoped_hook(node = T.unsafe(nil)); end - def unscoped_hook(node = T.unsafe(nil)); end + def scoped_hook(param0 = T.unsafe(nil)); end + def unscoped_hook(param0 = T.unsafe(nil)); end private @@ -695,7 +700,7 @@ RuboCop::Cop::RSpec::HookArgument::IMPLICIT_MSG = T.let(T.unsafe(nil), String) class RuboCop::Cop::RSpec::HooksBeforeExamples < ::RuboCop::Cop::RSpec::Base extend(::RuboCop::Cop::AutoCorrector) - def example_or_group?(node = T.unsafe(nil)); end + def example_or_group?(param0 = T.unsafe(nil)); end def on_block(node); end private @@ -709,9 +714,9 @@ end RuboCop::Cop::RSpec::HooksBeforeExamples::MSG = T.let(T.unsafe(nil), String) class RuboCop::Cop::RSpec::ImplicitBlockExpectation < ::RuboCop::Cop::RSpec::Base - def implicit_expect(node = T.unsafe(nil)); end - def lambda?(node = T.unsafe(nil)); end - def lambda_subject?(node = T.unsafe(nil)); end + def implicit_expect(param0 = T.unsafe(nil)); end + def lambda?(param0 = T.unsafe(nil)); end + def lambda_subject?(param0 = T.unsafe(nil)); end def on_send(node); end private @@ -727,7 +732,7 @@ class RuboCop::Cop::RSpec::ImplicitExpect < ::RuboCop::Cop::RSpec::Base include(::RuboCop::Cop::ConfigurableEnforcedStyle) extend(::RuboCop::Cop::AutoCorrector) - def implicit_expect(node = T.unsafe(nil)); end + def implicit_expect(param0 = T.unsafe(nil)); end def on_send(node); end private @@ -746,7 +751,7 @@ class RuboCop::Cop::RSpec::ImplicitSubject < ::RuboCop::Cop::RSpec::Base include(::RuboCop::Cop::ConfigurableEnforcedStyle) extend(::RuboCop::Cop::AutoCorrector) - def implicit_subject?(node = T.unsafe(nil)); end + def implicit_subject?(param0 = T.unsafe(nil)); end def on_send(node); end private @@ -762,9 +767,9 @@ module RuboCop::Cop::RSpec::InflectedHelper include(::RuboCop::RSpec::Language) extend(::RuboCop::AST::NodePattern::Macros) - def be_bool?(node = T.unsafe(nil)); end - def be_boolthy?(node = T.unsafe(nil)); end - def predicate_in_actual?(node = T.unsafe(nil)); end + def be_bool?(param0 = T.unsafe(nil)); end + def be_boolthy?(param0 = T.unsafe(nil)); end + def predicate_in_actual?(param0 = T.unsafe(nil)); end private @@ -783,8 +788,8 @@ RuboCop::Cop::RSpec::InflectedHelper::MSG_INFLECTED = T.let(T.unsafe(nil), Strin class RuboCop::Cop::RSpec::InstanceSpy < ::RuboCop::Cop::RSpec::Base extend(::RuboCop::Cop::AutoCorrector) - def have_received_usage(node0); end - def null_double(node0); end + def have_received_usage(param0); end + def null_double(param0); end def on_block(node); end private @@ -797,10 +802,10 @@ RuboCop::Cop::RSpec::InstanceSpy::MSG = T.let(T.unsafe(nil), String) class RuboCop::Cop::RSpec::InstanceVariable < ::RuboCop::Cop::RSpec::Base include(::RuboCop::RSpec::TopLevelGroup) - def custom_matcher?(node = T.unsafe(nil)); end - def dynamic_class?(node = T.unsafe(nil)); end - def ivar_assigned?(node0, param1); end - def ivar_usage(node0); end + def custom_matcher?(param0 = T.unsafe(nil)); end + def dynamic_class?(param0 = T.unsafe(nil)); end + def ivar_assigned?(param0, param1); end + def ivar_usage(param0); end def on_top_level_group(node); end private @@ -812,7 +817,7 @@ end RuboCop::Cop::RSpec::InstanceVariable::MSG = T.let(T.unsafe(nil), String) class RuboCop::Cop::RSpec::InvalidPredicateMatcher < ::RuboCop::Cop::RSpec::Base - def invalid_predicate_matcher?(node = T.unsafe(nil)); end + def invalid_predicate_matcher?(param0 = T.unsafe(nil)); end def on_send(node); end private @@ -826,7 +831,7 @@ class RuboCop::Cop::RSpec::ItBehavesLike < ::RuboCop::Cop::RSpec::Base include(::RuboCop::Cop::ConfigurableEnforcedStyle) extend(::RuboCop::Cop::AutoCorrector) - def example_inclusion_offense(node = T.unsafe(nil), param1); end + def example_inclusion_offense(param0 = T.unsafe(nil), param1); end def on_send(node); end private @@ -837,8 +842,8 @@ end RuboCop::Cop::RSpec::ItBehavesLike::MSG = T.let(T.unsafe(nil), String) class RuboCop::Cop::RSpec::IteratedExpectation < ::RuboCop::Cop::RSpec::Base - def each?(node = T.unsafe(nil)); end - def expectation?(node = T.unsafe(nil), param1); end + def each?(param0 = T.unsafe(nil)); end + def expectation?(param0 = T.unsafe(nil), param1); end def on_block(node); end private @@ -885,7 +890,7 @@ RuboCop::Cop::RSpec::LeakyConstantDeclaration::MSG_MODULE = T.let(T.unsafe(nil), class RuboCop::Cop::RSpec::LetBeforeExamples < ::RuboCop::Cop::RSpec::Base extend(::RuboCop::Cop::AutoCorrector) - def example_or_group?(node = T.unsafe(nil)); end + def example_or_group?(param0 = T.unsafe(nil)); end def on_block(node); end private @@ -899,9 +904,9 @@ end RuboCop::Cop::RSpec::LetBeforeExamples::MSG = T.let(T.unsafe(nil), String) class RuboCop::Cop::RSpec::LetSetup < ::RuboCop::Cop::RSpec::Base - def example_or_shared_group_or_including?(node = T.unsafe(nil)); end - def let_bang(node = T.unsafe(nil)); end - def method_called?(node0, param1); end + def example_or_shared_group_or_including?(param0 = T.unsafe(nil)); end + def let_bang(param0 = T.unsafe(nil)); end + def method_called?(param0, param1); end def on_block(node); end private @@ -913,7 +918,7 @@ end RuboCop::Cop::RSpec::LetSetup::MSG = T.let(T.unsafe(nil), String) class RuboCop::Cop::RSpec::MessageChain < ::RuboCop::Cop::RSpec::Base - def message_chain(node = T.unsafe(nil)); end + def message_chain(param0 = T.unsafe(nil)); end def on_send(node); end end @@ -922,9 +927,9 @@ RuboCop::Cop::RSpec::MessageChain::MSG = T.let(T.unsafe(nil), String) class RuboCop::Cop::RSpec::MessageExpectation < ::RuboCop::Cop::RSpec::Base include(::RuboCop::Cop::ConfigurableEnforcedStyle) - def message_expectation(node = T.unsafe(nil)); end + def message_expectation(param0 = T.unsafe(nil)); end def on_send(node); end - def receive_message?(node0); end + def receive_message?(param0); end private @@ -938,9 +943,9 @@ RuboCop::Cop::RSpec::MessageExpectation::SUPPORTED_STYLES = T.let(T.unsafe(nil), class RuboCop::Cop::RSpec::MessageSpies < ::RuboCop::Cop::RSpec::Base include(::RuboCop::Cop::ConfigurableEnforcedStyle) - def message_expectation(node = T.unsafe(nil)); end + def message_expectation(param0 = T.unsafe(nil)); end def on_send(node); end - def receive_message(node0); end + def receive_message(param0); end private @@ -972,9 +977,9 @@ RuboCop::Cop::RSpec::MultipleDescribes::MSG = T.let(T.unsafe(nil), String) class RuboCop::Cop::RSpec::MultipleExpectations < ::RuboCop::Cop::RSpec::Base include(::RuboCop::Cop::ConfigurableMax) - def aggregate_failures?(node = T.unsafe(nil), param1); end - def aggregate_failures_block?(node = T.unsafe(nil)); end - def expect?(node = T.unsafe(nil)); end + def aggregate_failures?(param0 = T.unsafe(nil), param1); end + def aggregate_failures_block?(param0 = T.unsafe(nil)); end + def expect?(param0 = T.unsafe(nil)); end def on_block(node); end private @@ -1030,9 +1035,9 @@ RuboCop::Cop::RSpec::MultipleSubjects::MSG = T.let(T.unsafe(nil), String) class RuboCop::Cop::RSpec::NamedSubject < ::RuboCop::Cop::RSpec::Base def ignored_shared_example?(node); end def on_block(node); end - def rspec_block?(node = T.unsafe(nil)); end - def shared_example?(node = T.unsafe(nil)); end - def subject_usage(node0); end + def rspec_block?(param0 = T.unsafe(nil)); end + def shared_example?(param0 = T.unsafe(nil)); end + def subject_usage(param0); end end RuboCop::Cop::RSpec::NamedSubject::MSG = T.let(T.unsafe(nil), String) @@ -1061,7 +1066,7 @@ class RuboCop::Cop::RSpec::NotToNot < ::RuboCop::Cop::RSpec::Base include(::RuboCop::Cop::ConfigurableEnforcedStyle) extend(::RuboCop::Cop::AutoCorrector) - def not_to_not_offense(node = T.unsafe(nil), param1); end + def not_to_not_offense(param0 = T.unsafe(nil), param1); end def on_send(node); end private @@ -1072,9 +1077,9 @@ end RuboCop::Cop::RSpec::NotToNot::MSG = T.let(T.unsafe(nil), String) class RuboCop::Cop::RSpec::OverwritingSetup < ::RuboCop::Cop::RSpec::Base - def first_argument_name(node = T.unsafe(nil)); end + def first_argument_name(param0 = T.unsafe(nil)); end def on_block(node); end - def setup?(node = T.unsafe(nil)); end + def setup?(param0 = T.unsafe(nil)); end private @@ -1086,10 +1091,10 @@ RuboCop::Cop::RSpec::OverwritingSetup::MSG = T.let(T.unsafe(nil), String) class RuboCop::Cop::RSpec::Pending < ::RuboCop::Cop::RSpec::Base def on_send(node); end - def pending_block?(node = T.unsafe(nil)); end - def skip_or_pending?(node = T.unsafe(nil)); end - def skippable?(node = T.unsafe(nil)); end - def skipped_in_metadata?(node = T.unsafe(nil)); end + def pending_block?(param0 = T.unsafe(nil)); end + def skip_or_pending?(param0 = T.unsafe(nil)); end + def skippable?(param0 = T.unsafe(nil)); end + def skipped_in_metadata?(param0 = T.unsafe(nil)); end private @@ -1121,8 +1126,8 @@ class RuboCop::Cop::RSpec::ReceiveCounts < ::RuboCop::Cop::RSpec::Base extend(::RuboCop::Cop::AutoCorrector) def on_send(node); end - def receive_counts(node = T.unsafe(nil)); end - def stub?(node0); end + def receive_counts(param0 = T.unsafe(nil)); end + def stub?(param0); end private @@ -1137,7 +1142,7 @@ RuboCop::Cop::RSpec::ReceiveCounts::MSG = T.let(T.unsafe(nil), String) class RuboCop::Cop::RSpec::ReceiveNever < ::RuboCop::Cop::RSpec::Base extend(::RuboCop::Cop::AutoCorrector) - def method_on_stub?(node0); end + def method_on_stub?(param0); end def on_send(node); end private @@ -1170,12 +1175,12 @@ end RuboCop::Cop::RSpec::RepeatedExample::MSG = T.let(T.unsafe(nil), String) class RuboCop::Cop::RSpec::RepeatedExampleGroupBody < ::RuboCop::Cop::RSpec::Base - def body(node = T.unsafe(nil)); end - def const_arg(node = T.unsafe(nil)); end - def metadata(node = T.unsafe(nil)); end + def body(param0 = T.unsafe(nil)); end + def const_arg(param0 = T.unsafe(nil)); end + def metadata(param0 = T.unsafe(nil)); end def on_begin(node); end - def several_example_groups?(node = T.unsafe(nil)); end - def skip_or_pending?(node = T.unsafe(nil)); end + def several_example_groups?(param0 = T.unsafe(nil)); end + def skip_or_pending?(param0 = T.unsafe(nil)); end private @@ -1188,11 +1193,11 @@ end RuboCop::Cop::RSpec::RepeatedExampleGroupBody::MSG = T.let(T.unsafe(nil), String) class RuboCop::Cop::RSpec::RepeatedExampleGroupDescription < ::RuboCop::Cop::RSpec::Base - def doc_string_and_metadata(node = T.unsafe(nil)); end - def empty_description?(node = T.unsafe(nil)); end + def doc_string_and_metadata(param0 = T.unsafe(nil)); end + def empty_description?(param0 = T.unsafe(nil)); end def on_begin(node); end - def several_example_groups?(node = T.unsafe(nil)); end - def skip_or_pending?(node = T.unsafe(nil)); end + def several_example_groups?(param0 = T.unsafe(nil)); end + def skip_or_pending?(param0 = T.unsafe(nil)); end private @@ -1203,15 +1208,32 @@ end RuboCop::Cop::RSpec::RepeatedExampleGroupDescription::MSG = T.let(T.unsafe(nil), String) +class RuboCop::Cop::RSpec::RepeatedIncludeExample < ::RuboCop::Cop::RSpec::Base + def include_examples?(param0 = T.unsafe(nil)); end + def on_begin(node); end + def several_include_examples?(param0 = T.unsafe(nil)); end + def shared_examples_name(param0 = T.unsafe(nil)); end + + private + + def add_repeated_lines(items); end + def literal_include_examples?(node); end + def message(item, repeats); end + def repeated_include_examples(node); end + def signature_keys(item); end +end + +RuboCop::Cop::RSpec::RepeatedIncludeExample::MSG = T.let(T.unsafe(nil), String) + class RuboCop::Cop::RSpec::ReturnFromStub < ::RuboCop::Cop::RSpec::Base include(::RuboCop::Cop::ConfigurableEnforcedStyle) extend(::RuboCop::Cop::AutoCorrector) - def and_return_value(node0); end - def contains_stub?(node0); end + def and_return_value(param0); end + def contains_stub?(param0); end def on_block(node); end def on_send(node); end - def stub_with_block?(node = T.unsafe(nil)); end + def stub_with_block?(param0 = T.unsafe(nil)); end private @@ -1279,11 +1301,11 @@ RuboCop::Cop::RSpec::ScatteredSetup::MSG = T.let(T.unsafe(nil), String) class RuboCop::Cop::RSpec::SharedContext < ::RuboCop::Cop::RSpec::Base extend(::RuboCop::Cop::AutoCorrector) - def context?(node0); end - def examples?(node0); end + def context?(param0); end + def examples?(param0); end def on_block(node); end - def shared_context(node = T.unsafe(nil)); end - def shared_example(node = T.unsafe(nil)); end + def shared_context(param0 = T.unsafe(nil)); end + def shared_example(param0 = T.unsafe(nil)); end private @@ -1299,7 +1321,7 @@ class RuboCop::Cop::RSpec::SharedExamples < ::RuboCop::Cop::RSpec::Base extend(::RuboCop::Cop::AutoCorrector) def on_send(node); end - def shared_examples(node = T.unsafe(nil)); end + def shared_examples(param0 = T.unsafe(nil)); end end class RuboCop::Cop::RSpec::SharedExamples::Checker @@ -1320,9 +1342,9 @@ RuboCop::Cop::RSpec::SharedExamples::Checker::MSG = T.let(T.unsafe(nil), String) class RuboCop::Cop::RSpec::SingleArgumentMessageChain < ::RuboCop::Cop::RSpec::Base extend(::RuboCop::Cop::AutoCorrector) - def message_chain(node = T.unsafe(nil)); end + def message_chain(param0 = T.unsafe(nil)); end def on_send(node); end - def single_key_hash?(node = T.unsafe(nil)); end + def single_key_hash?(param0 = T.unsafe(nil)); end private @@ -1337,13 +1359,32 @@ end RuboCop::Cop::RSpec::SingleArgumentMessageChain::MSG = T.let(T.unsafe(nil), String) +class RuboCop::Cop::RSpec::StubbedMock < ::RuboCop::Cop::RSpec::Base + def configured_response?(param0 = T.unsafe(nil)); end + def expectation(param0 = T.unsafe(nil)); end + def matcher_with_blockpass(param0 = T.unsafe(nil)); end + def matcher_with_configured_response(param0 = T.unsafe(nil)); end + def matcher_with_hash(param0 = T.unsafe(nil)); end + def matcher_with_return_block(param0 = T.unsafe(nil)); end + def message_expectation?(param0 = T.unsafe(nil)); end + def on_send(node); end + + private + + def msg(method_name); end + def on_expectation(expectation, method_name, matcher); end + def replacement(method_name); end +end + +RuboCop::Cop::RSpec::StubbedMock::MSG = T.let(T.unsafe(nil), String) + class RuboCop::Cop::RSpec::SubjectStub < ::RuboCop::Cop::RSpec::Base include(::RuboCop::RSpec::TopLevelGroup) - def message_expectation?(node = T.unsafe(nil), param1); end - def message_expectation_matcher?(node0); end + def message_expectation?(param0 = T.unsafe(nil), param1); end + def message_expectation_matcher?(param0); end def on_top_level_group(node); end - def subject(node = T.unsafe(nil)); end + def subject(param0 = T.unsafe(nil)); end private @@ -1356,7 +1397,7 @@ RuboCop::Cop::RSpec::SubjectStub::MSG = T.let(T.unsafe(nil), String) class RuboCop::Cop::RSpec::UnspecifiedException < ::RuboCop::Cop::RSpec::Base def block_with_args?(node); end def empty_exception_matcher?(node); end - def empty_raise_error_or_exception(node = T.unsafe(nil)); end + def empty_raise_error_or_exception(param0 = T.unsafe(nil)); end def on_send(node); end end @@ -1395,7 +1436,7 @@ RuboCop::Cop::RSpec::VariableName::MSG = T.let(T.unsafe(nil), String) class RuboCop::Cop::RSpec::VerifiedDoubles < ::RuboCop::Cop::RSpec::Base def on_send(node); end - def unverified_double(node = T.unsafe(nil)); end + def unverified_double(param0 = T.unsafe(nil)); end private @@ -1405,8 +1446,8 @@ end RuboCop::Cop::RSpec::VerifiedDoubles::MSG = T.let(T.unsafe(nil), String) class RuboCop::Cop::RSpec::VoidExpect < ::RuboCop::Cop::RSpec::Base - def expect?(node = T.unsafe(nil)); end - def expect_block?(node = T.unsafe(nil)); end + def expect?(param0 = T.unsafe(nil)); end + def expect_block?(param0 = T.unsafe(nil)); end def on_block(node); end def on_send(node); end @@ -1422,9 +1463,9 @@ class RuboCop::Cop::RSpec::Yield < ::RuboCop::Cop::RSpec::Base include(::RuboCop::Cop::RangeHelp) extend(::RuboCop::Cop::AutoCorrector) - def block_arg(node = T.unsafe(nil)); end - def block_call?(node = T.unsafe(nil), param1); end - def method_on_stub?(node0); end + def block_arg(param0 = T.unsafe(nil)); end + def block_call?(param0 = T.unsafe(nil), param1); end + def method_on_stub?(param0); end def on_block(node); end private @@ -1518,9 +1559,9 @@ end class RuboCop::RSpec::Example < ::RuboCop::RSpec::Concept def definition; end def doc_string; end - def extract_doc_string(node = T.unsafe(nil)); end - def extract_implementation(node = T.unsafe(nil)); end - def extract_metadata(node = T.unsafe(nil)); end + def extract_doc_string(param0 = T.unsafe(nil)); end + def extract_implementation(param0 = T.unsafe(nil)); end + def extract_metadata(param0 = T.unsafe(nil)); end def implementation; end def metadata; end end @@ -1529,7 +1570,7 @@ class RuboCop::RSpec::ExampleGroup < ::RuboCop::RSpec::Concept def examples; end def hooks; end def lets; end - def scope_change?(node = T.unsafe(nil)); end + def scope_change?(param0 = T.unsafe(nil)); end def subjects; end private @@ -1551,7 +1592,7 @@ end class RuboCop::RSpec::Hook < ::RuboCop::RSpec::Concept def example?; end - def extract_metadata(node = T.unsafe(nil)); end + def extract_metadata(param0 = T.unsafe(nil)); end def knowable_scope?; end def metadata; end def name; end @@ -1633,16 +1674,16 @@ RuboCop::RSpec::Language::Includes::EXAMPLES = T.let(T.unsafe(nil), RuboCop::RSp module RuboCop::RSpec::Language::NodePattern extend(::RuboCop::AST::NodePattern::Macros) - def example?(node = T.unsafe(nil)); end - def example_group?(node = T.unsafe(nil)); end - def example_group_with_body?(node = T.unsafe(nil)); end - def hook?(node = T.unsafe(nil)); end - def include?(node = T.unsafe(nil)); end - def let?(node = T.unsafe(nil)); end - def rspec?(node = T.unsafe(nil)); end - def shared_group?(node = T.unsafe(nil)); end - def spec_group?(node = T.unsafe(nil)); end - def subject?(node = T.unsafe(nil)); end + def example?(param0 = T.unsafe(nil)); end + def example_group?(param0 = T.unsafe(nil)); end + def example_group_with_body?(param0 = T.unsafe(nil)); end + def hook?(param0 = T.unsafe(nil)); end + def include?(param0 = T.unsafe(nil)); end + def let?(param0 = T.unsafe(nil)); end + def rspec?(param0 = T.unsafe(nil)); end + def shared_group?(param0 = T.unsafe(nil)); end + def spec_group?(param0 = T.unsafe(nil)); end + def subject?(param0 = T.unsafe(nil)); end end module RuboCop::RSpec::Language::Runners @@ -1663,6 +1704,7 @@ class RuboCop::RSpec::Language::SelectorSet def node_pattern_union; end def send_or_block_or_block_pass_pattern; end def send_pattern; end + def to_a; end protected @@ -1705,7 +1747,7 @@ module RuboCop::RSpec::TopLevelGroup include(::RuboCop::RSpec::Language) extend(::RuboCop::AST::NodePattern::Macros) - def example_or_shared_group?(node = T.unsafe(nil)); end + def example_or_shared_group?(param0 = T.unsafe(nil)); end def on_new_investigation; end def top_level_groups; end @@ -1722,7 +1764,7 @@ module RuboCop::RSpec::Variable include(::RuboCop::RSpec::Language) extend(::RuboCop::AST::NodePattern::Macros) - def variable_definition?(node = T.unsafe(nil)); end + def variable_definition?(param0 = T.unsafe(nil)); end end module RuboCop::RSpec::Version
true
Other
Homebrew
brew
392f2e3a5c36cb5b551a8dc7dcef6ce513c89833.json
sorbet: Update RBI files. Autogenerated by the [sorbet](https://github.com/Homebrew/brew/blob/master/.github/workflows/sorbet.yml) workflow.
Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi
@@ -22364,9 +22364,12 @@ class RuboCop::AST::NodePattern::Parser end module RuboCop::AST::NodePattern::Sets + SET_AND_RETURN_AND_RAISE_AND_THROW_ETC = ::T.let(nil, ::T.untyped) SET_BUILD_RECOMMENDED_TEST_OPTIONAL = ::T.let(nil, ::T.untyped) SET_DEPENDS_ON_USES_FROM_MACOS = ::T.let(nil, ::T.untyped) SET_INCLUDE_WITH_WITHOUT = ::T.let(nil, ::T.untyped) + SET_PROC_LAMBDA = ::T.let(nil, ::T.untyped) + SET_RECEIVE_RECEIVE_MESSAGE_CHAIN = ::T.let(nil, ::T.untyped) SET_SYSTEM_SHELL_OUTPUT_PIPE_OUTPUT = ::T.let(nil, ::T.untyped) SET_WITH_WITHOUT = ::T.let(nil, ::T.untyped) end
true
Other
Homebrew
brew
e54980efd8d2a409b2267d318182134b9a37b396.json
docs/typechecking: Titlecase the word "With" - I don't necessarily agree with this, but it's AP style that words with four or more letters should start with a capital when in titles.
docs/Typechecking.md
@@ -1,4 +1,4 @@ -# Type Checking with Sorbet +# Type Checking With Sorbet The majority of the code in Homebrew is written in Ruby which is a dynamic language. To avail the benefits of static type checking, we have set up Sorbet in
false
Other
Homebrew
brew
c0642e1b84ed17a9ed9e3ef503ed13c7230c165b.json
vale-styles: Upgrade all checks to "error" level - I added these all the way back in December 2019 in #6826, but only today realised that things have been failing unnoticeably because "warning" level exits with status code 0, so doesn't fail CI. - Upgrading to "error" level will enable us to see the style errors in our docs and fix them faster. - My editor also auto-formatted the YAML to have double quotes instead of single.
docs/vale-styles/Homebrew/Abbreviations.yml
@@ -2,7 +2,7 @@ extends: substitution message: Use '%s' ignorecase: false -link: 'https://github.com/Homebrew/brew/blob/HEAD/docs/Prose-Style-Guidelines.md#style-and-usage' +link: "https://github.com/Homebrew/brew/blob/HEAD/docs/Prose-Style-Guidelines.md#style-and-usage" level: error nonword: true swap:
true
Other
Homebrew
brew
c0642e1b84ed17a9ed9e3ef503ed13c7230c165b.json
vale-styles: Upgrade all checks to "error" level - I added these all the way back in December 2019 in #6826, but only today realised that things have been failing unnoticeably because "warning" level exits with status code 0, so doesn't fail CI. - Upgrading to "error" level will enable us to see the style errors in our docs and fix them faster. - My editor also auto-formatted the YAML to have double quotes instead of single.
docs/vale-styles/Homebrew/OxfordComma.yml
@@ -1,8 +1,8 @@ --- extends: existence -message: 'No Oxford commas!' -link: 'https://github.com/Homebrew/brew/blob/HEAD/docs/Prose-Style-Guidelines.md#typographical-conventions' +message: "No Oxford commas!" +link: "https://github.com/Homebrew/brew/blob/HEAD/docs/Prose-Style-Guidelines.md#typographical-conventions" scope: sentence -level: warning +level: error tokens: - '(?:[^,]+,){1,}\s\w+,\sand'
true
Other
Homebrew
brew
c0642e1b84ed17a9ed9e3ef503ed13c7230c165b.json
vale-styles: Upgrade all checks to "error" level - I added these all the way back in December 2019 in #6826, but only today realised that things have been failing unnoticeably because "warning" level exits with status code 0, so doesn't fail CI. - Upgrading to "error" level will enable us to see the style errors in our docs and fix them faster. - My editor also auto-formatted the YAML to have double quotes instead of single.
docs/vale-styles/Homebrew/Pronouns.yml
@@ -1,8 +1,8 @@ --- extends: existence message: Avoid gender-specific language when not necessary. -link: 'https://github.com/Homebrew/brew/blob/HEAD/docs/Prose-Style-Guidelines.md#personal-pronouns' -level: warning +link: "https://github.com/Homebrew/brew/blob/HEAD/docs/Prose-Style-Guidelines.md#personal-pronouns" +level: error ignorecase: true tokens: - him
true
Other
Homebrew
brew
c0642e1b84ed17a9ed9e3ef503ed13c7230c165b.json
vale-styles: Upgrade all checks to "error" level - I added these all the way back in December 2019 in #6826, but only today realised that things have been failing unnoticeably because "warning" level exits with status code 0, so doesn't fail CI. - Upgrading to "error" level will enable us to see the style errors in our docs and fix them faster. - My editor also auto-formatted the YAML to have double quotes instead of single.
docs/vale-styles/Homebrew/Spacing.yml
@@ -1,9 +1,9 @@ --- extends: existence message: "'%s' should have one space." -link: 'https://github.com/Homebrew/brew/blob/HEAD/docs/Prose-Style-Guidelines.md#typographical-conventions' +link: "https://github.com/Homebrew/brew/blob/HEAD/docs/Prose-Style-Guidelines.md#typographical-conventions" level: error nonword: true tokens: - - '[a-z][.?!][A-Z]' - - '[.?!] {2,}[A-Z]' + - "[a-z][.?!][A-Z]" + - "[.?!] {2,}[A-Z]"
true
Other
Homebrew
brew
c0642e1b84ed17a9ed9e3ef503ed13c7230c165b.json
vale-styles: Upgrade all checks to "error" level - I added these all the way back in December 2019 in #6826, but only today realised that things have been failing unnoticeably because "warning" level exits with status code 0, so doesn't fail CI. - Upgrading to "error" level will enable us to see the style errors in our docs and fix them faster. - My editor also auto-formatted the YAML to have double quotes instead of single.
docs/vale-styles/Homebrew/Terms.yml
@@ -1,7 +1,7 @@ --- extends: substitution message: Use '%s' instead of '%s'. -link: 'https://github.com/Homebrew/brew/blob/HEAD/docs/Prose-Style-Guidelines.md#terminology-words-and-word-styling' +link: "https://github.com/Homebrew/brew/blob/HEAD/docs/Prose-Style-Guidelines.md#terminology-words-and-word-styling" level: error scope: $paragraph swap:
true
Other
Homebrew
brew
c0642e1b84ed17a9ed9e3ef503ed13c7230c165b.json
vale-styles: Upgrade all checks to "error" level - I added these all the way back in December 2019 in #6826, but only today realised that things have been failing unnoticeably because "warning" level exits with status code 0, so doesn't fail CI. - Upgrading to "error" level will enable us to see the style errors in our docs and fix them faster. - My editor also auto-formatted the YAML to have double quotes instead of single.
docs/vale-styles/Homebrew/Titles.yml
@@ -1,6 +1,6 @@ extends: capitalization message: "'%s' should be in title case" -level: warning +level: error scope: heading.h1 match: $title style: AP
true
Other
Homebrew
brew
c0642e1b84ed17a9ed9e3ef503ed13c7230c165b.json
vale-styles: Upgrade all checks to "error" level - I added these all the way back in December 2019 in #6826, but only today realised that things have been failing unnoticeably because "warning" level exits with status code 0, so doesn't fail CI. - Upgrading to "error" level will enable us to see the style errors in our docs and fix them faster. - My editor also auto-formatted the YAML to have double quotes instead of single.
docs/vale-styles/Homebrew/Trademarks.yml
@@ -1,7 +1,7 @@ --- extends: existence message: 'No "TM", ™, SM, ©, ®, or other explicit indicators of rights ownership or trademarks' -link: 'https://github.com/Homebrew/brew/blob/HEAD/docs/Prose-Style-Guidelines.md#typographical-conventions' +link: "https://github.com/Homebrew/brew/blob/HEAD/docs/Prose-Style-Guidelines.md#typographical-conventions" level: error nonword: true tokens:
true
Other
Homebrew
brew
4f7497ddf92b2c018a3e3dce4cc0cd25905fd3c0.json
sorbet: Update RBI files. Autogenerated by the [sorbet](https://github.com/Homebrew/brew/blob/master/.github/workflows/sorbet.yml) workflow.
Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi
@@ -13629,6 +13629,11 @@ class PATH def each(*args, &block); end end +class PATH + extend ::T::Private::Methods::MethodHooks + extend ::T::Private::Methods::SingletonMethodHooks +end + module ParallelTests RUBY_BINARY = ::T.let(nil, ::T.untyped) VERSION = ::T.let(nil, ::T.untyped) @@ -26204,6 +26209,23 @@ class UnpackStrategy::Zip include ::UnpackStrategy::Zip::MacOSZipExtension end +module UnpackStrategy::Zip::MacOSZipExtension + extend ::T::Private::Methods::MethodHooks + extend ::T::Private::Methods::SingletonMethodHooks +end + +class UnpackStrategy::Zip + extend ::T::Private::Methods::MethodHooks + extend ::T::Private::Methods::SingletonMethodHooks +end + +module UnpackStrategy + extend ::T::Private::Abstract::Hooks + extend ::T::InterfaceWrapper::Helpers + extend ::T::Private::Methods::MethodHooks + extend ::T::Private::Methods::SingletonMethodHooks +end + class User extend ::T::Private::Methods::MethodHooks extend ::T::Private::Methods::SingletonMethodHooks
false
Other
Homebrew
brew
6e82f77108c326ede038d11a81fc6e9d9c229886.json
audit: allow python symlinks based on keg-only status
Library/Homebrew/formula_cellar_checks.rb
@@ -265,18 +265,16 @@ def check_plist(prefix, plist) EOS end - PYTHON_SYMLINK_ALLOWED_FORMULA = "python@3.8" - - def check_python_symlinks(name) + def check_python_symlinks(name, keg_only) + return unless keg_only return unless name.start_with? "python" - return if name == PYTHON_SYMLINK_ALLOWED_FORMULA return if %w[pip3 wheel3].none? do |l| link = HOMEBREW_PREFIX/"bin"/l link.exist? && File.realpath(link).start_with?(HOMEBREW_CELLAR/name) end - "Only `#{PYTHON_SYMLINK_ALLOWED_FORMULA}` should create symlinks for `pip3` and `wheel3`" + "Python formulae that are keg-only should not create `pip3` and `wheel3` symlinks" end def audit_installed @@ -296,7 +294,7 @@ def audit_installed problem_if_output(check_python_packages(formula.lib, formula.deps)) problem_if_output(check_shim_references(formula.prefix)) problem_if_output(check_plist(formula.prefix, formula.plist)) - problem_if_output(check_python_symlinks(formula.name)) + problem_if_output(check_python_symlinks(formula.name, formula.keg_only?)) end alias generic_audit_installed audit_installed
false
Other
Homebrew
brew
a582b6e3719a300f4aa37814e41987ab5343ea8a.json
Add type signatures for `PATH`.
Library/Homebrew/PATH.rb
@@ -1,52 +1,71 @@ -# typed: false +# typed: true # frozen_string_literal: true # Represention of a `*PATH` environment variable. # # @api private class PATH + extend T::Sig + include Enumerable extend Forwardable def_delegator :@paths, :each + # FIXME: Enable cop again when https://github.com/sorbet/sorbet/issues/3532 is fixed. + # rubocop:disable Style/MutableConstant + Element = T.type_alias { T.nilable(T.any(Pathname, String, PATH)) } + private_constant :Element + Elements = T.type_alias { T.any(Element, T::Array[Element]) } + private_constant :Elements + # rubocop:enable Style/MutableConstant + + sig { params(paths: Elements).void } def initialize(*paths) - @paths = parse(*paths) + @paths = parse(paths) end + sig { params(paths: Elements).returns(T.self_type) } def prepend(*paths) - @paths = parse(*paths, *@paths) + @paths = parse(paths + @paths) self end + sig { params(paths: Elements).returns(T.self_type) } def append(*paths) - @paths = parse(*@paths, *paths) + @paths = parse(@paths + paths) self end + sig { params(index: Integer, paths: Elements).returns(T.self_type) } def insert(index, *paths) - @paths = parse(*@paths.insert(index, *paths)) + @paths = parse(@paths.insert(index, *paths)) self end + sig { params(block: T.proc.params(arg0: String).returns(T::Boolean)).returns(T.self_type) } def select(&block) self.class.new(@paths.select(&block)) end + sig { params(block: T.proc.params(arg0: String).returns(T::Boolean)).returns(T.self_type) } def reject(&block) self.class.new(@paths.reject(&block)) end + sig { returns(T::Array[String]) } def to_ary @paths.dup.to_ary end alias to_a to_ary + sig { returns(String) } def to_str @paths.join(File::PATH_SEPARATOR) end alias to_s to_str + sig { params(other: T.untyped).returns(T::Boolean) } def ==(other) if other.respond_to?(:to_ary) && to_ary == other.to_ary true @@ -57,10 +76,12 @@ def ==(other) end end + sig { returns(T::Boolean) } def empty? @paths.empty? end + sig { returns(T.nilable(T.self_type)) } def existing existing_path = select(&File.method(:directory?)) # return nil instead of empty PATH, to unset environment variables @@ -69,10 +90,11 @@ def existing private - def parse(*paths) + sig { params(paths: T::Array[Elements]).returns(T::Array[String]) } + def parse(paths) paths.flatten .compact - .flat_map { |p| Pathname.new(p).to_path.split(File::PATH_SEPARATOR) } + .flat_map { |p| Pathname(p).to_path.split(File::PATH_SEPARATOR) } .uniq end end
false
Other
Homebrew
brew
11918cef968c280c41df42263b62bd891834d4bb.json
bash completion: Add remaining brew outdated flags `--verbose`, `--formula`, and `--greedy`
completions/bash/brew
@@ -419,7 +419,7 @@ _brew_outdated() { local cur="${COMP_WORDS[COMP_CWORD]}" case "$cur" in -*) - __brewcomp "--quiet --cask --json=v1 --fetch-HEAD" + __brewcomp "--quiet --verbose --formula --cask --json=v1 --fetch-HEAD --greedy" return ;; esac
false
Other
Homebrew
brew
534f0e61e342b509fd7a95871e70a182de87ddde.json
shared_audits: fix conditional in Bitbucket notability check This check currently returns an error for repositories that are notable enough (and passes on repositories that are not notable enough).
Library/Homebrew/utils/shared_audits.rb
@@ -168,7 +168,7 @@ def bitbucket(user, repo) watcher_metadata = JSON.parse(watcher_out) return if watcher_metadata.nil? - return if (forks_metadata["size"] < 30) && (watcher_metadata["size"] < 75) + return if forks_metadata["size"] >= 30 || watcher_metadata["size"] >= 75 "Bitbucket repository not notable enough (<30 forks and <75 watchers)" end
false
Other
Homebrew
brew
c26f1f436ec8a863c2aa7ed6448882e654d8b6fc.json
shared_audits: add extraterm to GITHUB_PRERELEASE_ALLOWLIST
Library/Homebrew/utils/shared_audits.rb
@@ -34,6 +34,7 @@ def github_release_data(user, repo, tag) GITHUB_PRERELEASE_ALLOWLIST = { "amd-power-gadget" => :all, "elm-format" => "0.8.3", + "extraterm" => :all, "freetube" => :all, "gitless" => "0.8.8", "home-assistant" => :all,
false
Other
Homebrew
brew
4e9773a650759b5d01c310a99fab00b138443eda.json
docs/typechecking: Remove mentions of sorbet/files.yaml - The `sorbet/files.yaml` file was removed in 4382ee9d1404baba4ff4a1734e11fbd9c7826cb7 in favour of more obvious individual type sigils in all files.
docs/Typechecking.md
@@ -27,8 +27,8 @@ file are always passed first (if it exists), followed by arguments provided on t command line. We use it ignore the `Library/Homebrew/vendor` directory, which contains gem definitions which we do not wish to type check. -- The `files.yaml` file. It contains a list of every Ruby file in the codebase -divided into 3 strictness levels, false, true and strict. The `false` files only +- Every Ruby file in the codebase is divided into three strictness levels: false, +true and strict. The `false` files only report errors related to the syntax, constant resolution and correctness of the method signatures, and not type errors. We use this file to override strictness on a file-by-file basis. Our longtime goal is to move all `false` files to `true` @@ -40,11 +40,12 @@ out the resulting type errors. Read more about Sorbet's strictness levels ## Using `brew typecheck` When run without any arguments, `brew typecheck`, will run considering the strictness levels -set in the `files.yaml` file. However, when typecheck is run on a specific file -or directory, more errors may show up since Sorbet can not resolve constants defined -outside the scope of the specified file. These problems can be solved with RBI files. -Currently `brew typecheck` provides `quiet`, `--file`, `--dir` and `--ignore` options -but you can explore more options with `srb tc --help` and passing them with `srb tc`. +set in each of the individual Ruby files in the core Homebrew codebase. However, when +typecheck is run on a specific file or directory, more errors may show up since Sorbet +cannot resolve constants defined outside the scope of the specified file. These +problems can be solved with RBI files. Currently `brew typecheck` provides `quiet`, `--file`, +`--dir` and `--ignore` options but you can explore more options with `srb tc --help` and +passing them with `srb tc`. ## Resolving Type Errors
false
Other
Homebrew
brew
f7154119914398ad12ccfbd7ba24c7cd50214f4e.json
Use GITHUB_ENV instead of set-env https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/ > Action and workflow authors who are setting environment variables via stdout should update any usage of the set-env and add-path workflow commands to use the new environment files.
.github/workflows/docker.yml
@@ -34,7 +34,7 @@ jobs: if: startsWith(github.ref, 'refs/tags/') run: | brew_version=${GITHUB_REF:10} - echo "::set-env name=brew_version::$brew_version" + echo "brew_version=$brew_version" >> ${GITHUB_ENV} echo ${{secrets.HOMEBREW_GITHUB_PACKAGES_API_TOKEN}} | docker login ghcr.io -u BrewTestBot --password-stdin docker tag brew "ghcr.io/homebrew/ubuntu${{matrix.version}}:$brew_version" docker push "ghcr.io/homebrew/ubuntu${{matrix.version}}:$brew_version"
false
Other
Homebrew
brew
64d135d0a7f242fda9ffd1a007614a6aa960c9d9.json
tap-new: add option for branch name
Library/Homebrew/dev-cmd/tap-new.rb
@@ -17,8 +17,12 @@ def tap_new_args switch "--no-git", description: "Don't initialize a git repository for the tap." - flag "--pull-label", + flag "--pull-label=", description: "Label name for pull requests ready to be pulled (default `pr-pull`)." + flag "--branch=", + description: "Initialize git repository with the specified branch name (default `main`)." + + conflicts "--no-git", "--branch" named 1 end end @@ -27,6 +31,7 @@ def tap_new args = tap_new_args.parse label = args.pull_label || "pr-pull" + branch = args.branch || "main" tap_name = args.named.first tap = Tap.fetch(tap_name) @@ -56,7 +61,7 @@ def tap_new name: brew test-bot on: push: - branches: master + branches: #{branch} pull_request: jobs: test-bot: @@ -106,7 +111,7 @@ def tap_new - labeled jobs: pr-pull: - if: contains(github.event.pull_request.labels.*.name, #{label}) + if: contains(github.event.pull_request.labels.*.name, '#{label}') runs-on: ubuntu-latest steps: - name: Set up Homebrew @@ -115,6 +120,11 @@ def tap_new - name: Set up git uses: Homebrew/actions/git-user-config@master + - name: Checkout default branch + env: + BRANCH: ${{ github.event.pull_request.head.repo.default_branch }} + run: git checkout $BRANCH + - name: Pull bottles env: HOMEBREW_GITHUB_API_TOKEN: ${{ github.token }} @@ -125,6 +135,7 @@ def tap_new uses: Homebrew/actions/git-try-push@master with: token: ${{ github.token }} + branch: #{branch} - name: Delete branch if: github.event.pull_request.head.repo.fork == false @@ -142,6 +153,7 @@ def tap_new safe_system "git", "init" safe_system "git", "add", "--all" safe_system "git", "commit", "-m", "Create #{tap} tap" + safe_system "git", "branch", "-m", branch end end
true
Other
Homebrew
brew
64d135d0a7f242fda9ffd1a007614a6aa960c9d9.json
tap-new: add option for branch name
docs/Manpage.md
@@ -1231,6 +1231,8 @@ Generate the template files for a new tap. Don't initialize a git repository for the tap. * `--pull-label`: Label name for pull requests ready to be pulled (default `pr-pull`). +* `--branch`: + Initialize git repository with the specified branch name (default `main`). ### `test` [*`options`*] *`formula`*
true
Other
Homebrew
brew
64d135d0a7f242fda9ffd1a007614a6aa960c9d9.json
tap-new: add option for branch name
manpages/brew.1
@@ -1708,6 +1708,10 @@ Don\'t initialize a git repository for the tap\. \fB\-\-pull\-label\fR Label name for pull requests ready to be pulled (default \fBpr\-pull\fR)\. . +.TP +\fB\-\-branch\fR +Initialize git repository with the specified branch name (default \fBmain\fR)\. +. .SS "\fBtest\fR [\fIoptions\fR] \fIformula\fR" Run the test method provided by an installed formula\. There is no standard output or return code, but generally it should notify the user if something is wrong with the installed formula\. .
true
Other
Homebrew
brew
3497008e6ce3ff1d5cdc32ff797ba31c0786d919.json
Use GITHUB_ENV instead of set-env https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/ > Action and workflow authors who are setting environment variables via stdout should update any usage of the set-env and add-path workflow commands to use the new environment files.
.github/workflows/docker.yml
@@ -34,7 +34,7 @@ jobs: if: startsWith(github.ref, 'refs/tags/') run: | brew_version=${GITHUB_REF:10} - echo "::set-env name=brew_version::$brew_version" + echo "brew_version=$brew_version" >> ${GITHUB_ENV} echo ${{secrets.HOMEBREW_GITHUB_PACKAGES_API_TOKEN}} | docker login ghcr.io -u BrewTestBot --password-stdin docker tag brew "ghcr.io/homebrew/ubuntu${{matrix.version}}:$brew_version" docker push "ghcr.io/homebrew/ubuntu${{matrix.version}}:$brew_version"
false
Other
Homebrew
brew
5e0998d2ce6827ed0aeaf57486148a297e99592a.json
sorbet: Update RBI files. Autogenerated by the [sorbet](https://github.com/Homebrew/brew/blob/master/.github/workflows/sorbet.yml) workflow.
Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi
@@ -13312,6 +13312,8 @@ class Object include ::ActiveSupport::Dependencies::Loadable include ::ActiveSupport::Tryable include ::Minitest::Expectations + include ::SystemCommand::Mixin + include ::Utils::Curl include ::ActiveSupport::ToJsonWithActiveSupportEncoder def acts_like?(duck); end @@ -24691,6 +24693,11 @@ class String ENCODED_BLANKS = ::T.let(nil, ::T.untyped) end +class StringInreplaceExtension + extend ::T::Private::Methods::MethodHooks + extend ::T::Private::Methods::SingletonMethodHooks +end + class StringScanner def bol?(); end @@ -26038,6 +26045,7 @@ class TrueClass end module Tty + extend ::T::Private::Methods::SingletonMethodHooks def self.blue(); end def self.bold(); end @@ -26202,6 +26210,11 @@ class UnpackStrategy::Zip include ::UnpackStrategy::Zip::MacOSZipExtension end +class User + extend ::T::Private::Methods::MethodHooks + extend ::T::Private::Methods::SingletonMethodHooks +end + class Utils::Bottles::Collector def [](*args, &block); end @@ -26214,6 +26227,20 @@ class Utils::Bottles::Collector def keys(*args, &block); end end +module Utils::Inreplace + extend ::T::Private::Methods::MethodHooks + extend ::T::Private::Methods::SingletonMethodHooks +end + +module Utils::Shell + extend ::T::Private::Methods::MethodHooks + extend ::T::Private::Methods::SingletonMethodHooks +end + +module Utils::Svn + extend ::T::Private::Methods::SingletonMethodHooks +end + module Warning extend ::Warning end
true
Other
Homebrew
brew
5e0998d2ce6827ed0aeaf57486148a297e99592a.json
sorbet: Update RBI files. Autogenerated by the [sorbet](https://github.com/Homebrew/brew/blob/master/.github/workflows/sorbet.yml) workflow.
Library/Homebrew/sorbet/rbi/todo.rbi
@@ -5,7 +5,6 @@ module ::StackProf; end module DependencyCollector::Compat; end module OS::Mac::Version::NULL; end -module SPDX::JSON_PATH; end module T::InterfaceWrapper::Helpers; end module T::Private::Abstract::Hooks; end module T::Private::Methods::MethodHooks; end
true
Other
Homebrew
brew
d96ad81cd02e2cad1ba022e979e8fb83f0d431e7.json
cmd/info: Add test for --json=v2
Library/Homebrew/test/cmd/info_spec.rb
@@ -17,6 +17,15 @@ .and not_to_output.to_stderr .and be_a_success end + + it "prints as json with the --json=v2 flag" do + setup_test_formula "testball" + + expect { brew "info", "testball", "--json=v2" } + .to output(a_json_string).to_stdout + .and not_to_output.to_stderr + .and be_a_success + end end describe Homebrew do
false
Other
Homebrew
brew
622e76e7f375cfec6ae07f1db9efbf31e061a631.json
bintray: check remote file hash prior to upload If the remote file is published and has a hash matching the file we're about to upload, just skip uploading and publishing it entirely, rather than bailing out with an error.
Library/Homebrew/bintray.rb
@@ -131,69 +131,88 @@ def package_exists?(repo:, package:) end end - def file_published?(repo:, remote_file:) + # Gets the SHA-256 checksum of the specified remote file. + # Returns the empty string if the file exists but doesn't have a checksum. + # Returns nil if the file doesn't exist. + def remote_checksum(repo:, remote_file:) url = "https://dl.bintray.com/#{@bintray_org}/#{repo}/#{remote_file}" - begin - curl "--fail", "--silent", "--head", "--output", "/dev/null", url - rescue ErrorDuringExecution => e - stderr = e.output - .select { |type,| type == :stderr } - .map { |_, line| line } - .join - raise if e.status.exitstatus != 22 && !stderr.include?("404 Not Found") - - false + result = curl_output "--fail", "--silent", "--head", url + if result.success? + result.stdout.match(/^X-Checksum-Sha2:\s+(\h{64})\b/i)&.values_at(1)&.first || "" else - true + raise Error if result.status.exitstatus != 22 && !result.stderr.include?("404 Not Found") + + nil end end + def file_delete_instructions(bintray_repo, bintray_package, filename) + <<~EOS + Remove this file manually in your web browser: + https://bintray.com/#{@bintray_org}/#{bintray_repo}/#{bintray_package}/view#files + Or run: + curl -X DELETE -u $HOMEBREW_BINTRAY_USER:$HOMEBREW_BINTRAY_KEY \\ + https://api.bintray.com/content/#{@bintray_org}/#{bintray_repo}/#{filename} + EOS + end + def upload_bottles(bottles_hash, publish_package: false, warn_on_error: false) formula_packaged = {} bottles_hash.each do |formula_name, bottle_hash| version = ERB::Util.url_encode(bottle_hash["formula"]["pkg_version"]) bintray_package = bottle_hash["bintray"]["package"] bintray_repo = bottle_hash["bintray"]["repository"] + bottle_count = bottle_hash["bottle"]["tags"].length bottle_hash["bottle"]["tags"].each do |_tag, tag_hash| filename = tag_hash["filename"] # URL encoded in Bottle::Filename#bintray sha256 = tag_hash["sha256"] + delete_instructions = file_delete_instructions(bintray_repo, bintray_package, filename) odebug "Checking remote file #{@bintray_org}/#{bintray_repo}/#{filename}" - if file_published? repo: bintray_repo, remote_file: filename - already_published = "#{filename} is already published." + result = remote_checksum(repo: bintray_repo, remote_file: filename) + + case result + when nil + # File doesn't exist. + if !formula_packaged[formula_name] && !package_exists?(repo: bintray_repo, package: bintray_package) + odebug "Creating package #{@bintray_org}/#{bintray_repo}/#{bintray_package}" + create_package repo: bintray_repo, package: bintray_package + formula_packaged[formula_name] = true + end + + odebug "Uploading #{@bintray_org}/#{bintray_repo}/#{bintray_package}/#{version}/#{filename}" + upload(tag_hash["local_filename"], + repo: bintray_repo, + package: bintray_package, + version: version, + remote_file: filename, + sha256: sha256) + when sha256 + # File exists, checksum matches. + odebug "#{filename} is already published with matching hash." + bottle_count -= 1 + when "" + # File exists, but can't find checksum + failed_message = "#{filename} is already published!" + raise Error, "#{failed_message}\n#{delete_instructions}" unless warn_on_error + + opoo failed_message + else + # File exists, but checksum either doesn't exist or is mismatched. failed_message = <<~EOS - #{already_published} - Please remove it manually from: - https://bintray.com/#{@bintray_org}/#{bintray_repo}/#{bintray_package}/view#files - Or run: - curl -X DELETE -u $HOMEBREW_BINTRAY_USER:$HOMEBREW_BINTRAY_KEY \\ - https://api.bintray.com/content/#{@bintray_org}/#{bintray_repo}/#{filename} + #{filename} is already published with a mismatched hash! + Expected: #{sha256} + Actual: #{result} EOS - raise Error, failed_message unless warn_on_error + raise Error, "#{failed_message}#{delete_instructions}" unless warn_on_error - opoo already_published - next + opoo failed_message end - - if !formula_packaged[formula_name] && !package_exists?(repo: bintray_repo, package: bintray_package) - odebug "Creating package #{@bintray_org}/#{bintray_repo}/#{bintray_package}" - create_package repo: bintray_repo, package: bintray_package - formula_packaged[formula_name] = true - end - - odebug "Uploading #{@bintray_org}/#{bintray_repo}/#{bintray_package}/#{version}/#{filename}" - upload(tag_hash["local_filename"], - repo: bintray_repo, - package: bintray_package, - version: version, - remote_file: filename, - sha256: sha256) end next unless publish_package - bottle_count = bottle_hash["bottle"]["tags"].length odebug "Publishing #{@bintray_org}/#{bintray_repo}/#{bintray_package}/#{version}" publish(repo: bintray_repo, package: bintray_package,
true
Other
Homebrew
brew
622e76e7f375cfec6ae07f1db9efbf31e061a631.json
bintray: check remote file hash prior to upload If the remote file is published and has a hash matching the file we're about to upload, just skip uploading and publishing it entirely, rather than bailing out with an error.
Library/Homebrew/test/bintray_spec.rb
@@ -10,15 +10,15 @@ ENV["HOMEBREW_BINTRAY_KEY"] = "deadbeef" end - describe "::file_published?" do + describe "::remote_checksum" do it "detects a published file" do - results = bintray.file_published?(repo: "bottles", remote_file: "hello-2.10.catalina.bottle.tar.gz") - expect(results).to be true + hash = bintray.remote_checksum(repo: "bottles", remote_file: "hello-2.10.catalina.bottle.tar.gz") + expect(hash).to eq("449de5ea35d0e9431f367f1bb34392e450f6853cdccdc6bd04e6ad6471904ddb") end it "fails on a non-existant file" do - results = bintray.file_published?(repo: "bottles", remote_file: "my-fake-bottle-1.0.snow_hyena.tar.gz") - expect(results).to be false + hash = bintray.remote_checksum(repo: "bottles", remote_file: "my-fake-bottle-1.0.snow_hyena.tar.gz") + expect(hash).to be nil end end
true
Other
Homebrew
brew
6ea9b32f7023b4e70583bd9cc3eb37a783fbb86a.json
Fix version comparison in `SDK#latest_sdk`.
Library/Homebrew/os/mac/sdk.rb
@@ -33,7 +33,7 @@ def sdk_for(v) def latest_sdk return if sdk_paths.empty? - v, path = sdk_paths.max(&:first) + v, path = sdk_paths.max { |(v1, _), (v2, _)| v1 <=> v2 } SDK.new v, path, source end
false
Other
Homebrew
brew
3b944434cfba22338758f0705de4813d076b444f.json
style: allow python versions with two digits
Library/Homebrew/rubocops/lines.rb
@@ -335,7 +335,7 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node) find_strings(body_node).each do |str| string_content = string_content(str) - next unless match = string_content.match(/^python(@)?(\d\.\d)$/) + next unless match = string_content.match(/^python(@)?(\d\.\d+)$/) next if python_version == match[2] @fix = if match[1]
true
Other
Homebrew
brew
3b944434cfba22338758f0705de4813d076b444f.json
style: allow python versions with two digits
Library/Homebrew/test/rubocops/lines_spec.rb
@@ -793,6 +793,30 @@ def install RUBY end + it "allow matching versions with two digits" do + expect_no_offenses(<<~RUBY) + class Foo < Formula + depends_on "python@3.10" + + def install + puts "python@3.10" + end + end + RUBY + end + + it "allow matching versions without `@` with two digits" do + expect_no_offenses(<<~RUBY) + class Foo < Formula + depends_on "python@3.10" + + def install + puts "python3.10" + end + end + RUBY + end + it "do not allow mismatching versions" do expect_offense(<<~RUBY) class Foo < Formula @@ -819,6 +843,32 @@ def install RUBY end + it "do not allow mismatching versions with two digits" do + expect_offense(<<~RUBY) + class Foo < Formula + depends_on "python@3.11" + + def install + puts "python@3.10" + ^^^^^^^^^^^^^ References to `python@3.10` should match the specified python dependency (`python@3.11`) + end + end + RUBY + end + + it "do not allow mismatching versions without `@` with two digits" do + expect_offense(<<~RUBY) + class Foo < Formula + depends_on "python@3.11" + + def install + puts "python3.10" + ^^^^^^^^^^^^ References to `python3.10` should match the specified python dependency (`python3.11`) + end + end + RUBY + end + it "autocorrects mismatching versions" do source = <<~RUBY class Foo < Formula @@ -868,6 +918,56 @@ def install new_source = autocorrect_source(source) expect(new_source).to eq(corrected_source) end + + it "autocorrects mismatching versions with two digits" do + source = <<~RUBY + class Foo < Formula + depends_on "python@3.10" + + def install + puts "python@3.9" + end + end + RUBY + + corrected_source = <<~RUBY + class Foo < Formula + depends_on "python@3.10" + + def install + puts "python@3.10" + end + end + RUBY + + new_source = autocorrect_source(source) + expect(new_source).to eq(corrected_source) + end + + it "autocorrects mismatching versions without `@` with two digits" do + source = <<~RUBY + class Foo < Formula + depends_on "python@3.11" + + def install + puts "python3.10" + end + end + RUBY + + corrected_source = <<~RUBY + class Foo < Formula + depends_on "python@3.11" + + def install + puts "python3.11" + end + end + RUBY + + new_source = autocorrect_source(source) + expect(new_source).to eq(corrected_source) + end end end
true
Other
Homebrew
brew
d7dad10771b8730ac63056d71d8332890affd0af.json
sorbet: Update RBI files and prune files.yaml. Autogenerated by [a scheduled GitHub Action](https://github.com/Homebrew/brew/blob/master/.github/workflows/sorbet.yml).
Library/Homebrew/sorbet/rbi/gems/rubocop-sorbet@0.5.1.rbi
@@ -0,0 +1,237 @@ +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `rubocop-sorbet` gem. +# Please instead update this file by running `tapioca sync`. + +# typed: true + +module RuboCop +end + +module RuboCop::Cop +end + +module RuboCop::Cop::Sorbet +end + +class RuboCop::Cop::Sorbet::AllowIncompatibleOverride < ::RuboCop::Cop::Cop + def allow_incompatible?(param0); end + def allow_incompatible_override?(param0 = T.unsafe(nil)); end + def not_nil?(node); end + def on_send(node); end + def sig?(param0); end +end + +class RuboCop::Cop::Sorbet::BindingConstantWithoutTypeAlias < ::RuboCop::Cop::Cop + def autocorrect(node); end + def binding_unaliased_type?(param0 = T.unsafe(nil)); end + def dynamic_type_creation_with_block?(param0 = T.unsafe(nil)); end + def generic_parameter_decl?(param0 = T.unsafe(nil)); end + def method_needing_aliasing_on_t?(param0); end + def not_dynamic_type_creation_with_block?(node); end + def not_generic_parameter_decl?(node); end + def not_nil?(node); end + def not_t_let?(node); end + def on_casgn(node); end + def t_let?(param0 = T.unsafe(nil)); end + def using_deprecated_type_alias_syntax?(param0 = T.unsafe(nil)); end + def using_type_alias?(param0 = T.unsafe(nil)); end +end + +class RuboCop::Cop::Sorbet::CheckedTrueInSignature < ::RuboCop::Cop::Sorbet::SignatureCop + include(::RuboCop::Cop::RangeHelp) + + def offending_node(param0); end + def on_signature(node); end +end + +class RuboCop::Cop::Sorbet::ConstantsFromStrings < ::RuboCop::Cop::Cop + def constant_from_string?(param0 = T.unsafe(nil)); end + def on_send(node); end +end + +class RuboCop::Cop::Sorbet::EnforceSigilOrder < ::RuboCop::Cop::Sorbet::ValidSigil + include(::RuboCop::Cop::RangeHelp) + + def autocorrect(_node); end + def investigate(processed_source); end + + protected + + def check_magic_comments_order(tokens); end + def extract_magic_comments(processed_source); end +end + +RuboCop::Cop::Sorbet::EnforceSigilOrder::CODING_REGEX = T.let(T.unsafe(nil), Regexp) + +RuboCop::Cop::Sorbet::EnforceSigilOrder::FROZEN_REGEX = T.let(T.unsafe(nil), Regexp) + +RuboCop::Cop::Sorbet::EnforceSigilOrder::INDENT_REGEX = T.let(T.unsafe(nil), Regexp) + +RuboCop::Cop::Sorbet::EnforceSigilOrder::MAGIC_REGEX = T.let(T.unsafe(nil), Regexp) + +RuboCop::Cop::Sorbet::EnforceSigilOrder::PREFERRED_ORDER = T.let(T.unsafe(nil), Hash) + +class RuboCop::Cop::Sorbet::EnforceSignatures < ::RuboCop::Cop::Sorbet::SignatureCop + def accessor?(param0 = T.unsafe(nil)); end + def autocorrect(node); end + def on_def(node); end + def on_defs(node); end + def on_send(node); end + + private + + def check_node(node); end + def param_type_placeholder; end + def previous_node(node); end + def return_type_placeholder; end +end + +class RuboCop::Cop::Sorbet::EnforceSignatures::SigSuggestion + def initialize(indent, param_placeholder, return_placeholder); end + + def params; end + def params=(_); end + def returns; end + def returns=(_); end + def to_autocorrect; end + + private + + def generate_params; end + def generate_return; end +end + +class RuboCop::Cop::Sorbet::FalseSigil < ::RuboCop::Cop::Sorbet::HasSigil + def minimum_strictness; end +end + +class RuboCop::Cop::Sorbet::ForbidIncludeConstLiteral < ::RuboCop::Cop::Cop + def initialize(*_); end + + def not_lit_const_include?(param0 = T.unsafe(nil)); end + def on_send(node); end + def used_names; end + def used_names=(_); end +end + +RuboCop::Cop::Sorbet::ForbidIncludeConstLiteral::MSG = T.let(T.unsafe(nil), String) + +class RuboCop::Cop::Sorbet::ForbidSuperclassConstLiteral < ::RuboCop::Cop::Cop + def not_lit_const_superclass?(param0 = T.unsafe(nil)); end + def on_class(node); end +end + +RuboCop::Cop::Sorbet::ForbidSuperclassConstLiteral::MSG = T.let(T.unsafe(nil), String) + +class RuboCop::Cop::Sorbet::ForbidUntypedStructProps < ::RuboCop::Cop::Cop + def on_class(node); end + def subclass_of_t_struct?(param0 = T.unsafe(nil)); end + def t_nilable_untyped(param0 = T.unsafe(nil)); end + def t_struct(param0 = T.unsafe(nil)); end + def t_untyped(param0 = T.unsafe(nil)); end + def untyped_props(param0); end +end + +RuboCop::Cop::Sorbet::ForbidUntypedStructProps::MSG = T.let(T.unsafe(nil), String) + +class RuboCop::Cop::Sorbet::HasSigil < ::RuboCop::Cop::Sorbet::ValidSigil + def require_sigil_on_all_files?; end +end + +class RuboCop::Cop::Sorbet::IgnoreSigil < ::RuboCop::Cop::Sorbet::HasSigil + def minimum_strictness; end +end + +class RuboCop::Cop::Sorbet::KeywordArgumentOrdering < ::RuboCop::Cop::Sorbet::SignatureCop + def on_signature(node); end + + private + + def check_order_for_kwoptargs(parameters); end +end + +class RuboCop::Cop::Sorbet::ParametersOrderingInSignature < ::RuboCop::Cop::Sorbet::SignatureCop + def on_signature(node); end + def signature_params(param0); end + + private + + def check_for_inconsistent_param_ordering(sig_params_order, parameters); end + def extract_parameters(sig_params); end +end + +class RuboCop::Cop::Sorbet::SignatureBuildOrder < ::RuboCop::Cop::Sorbet::SignatureCop + def autocorrect(node); end + def on_signature(node); end + def root_call(param0); end + + private + + def call_chain(sig_child_node); end + def can_autocorrect?; end + def node_with_index_sends(node); end +end + +RuboCop::Cop::Sorbet::SignatureBuildOrder::ORDER = T.let(T.unsafe(nil), Hash) + +class RuboCop::Cop::Sorbet::SignatureCop < ::RuboCop::Cop::Cop + def on_block(node); end + def on_signature(_); end + def signature?(param0 = T.unsafe(nil)); end +end + +class RuboCop::Cop::Sorbet::StrictSigil < ::RuboCop::Cop::Sorbet::HasSigil + def minimum_strictness; end +end + +class RuboCop::Cop::Sorbet::StrongSigil < ::RuboCop::Cop::Sorbet::HasSigil + def minimum_strictness; end +end + +class RuboCop::Cop::Sorbet::TrueSigil < ::RuboCop::Cop::Sorbet::HasSigil + def minimum_strictness; end +end + +class RuboCop::Cop::Sorbet::ValidSigil < ::RuboCop::Cop::Cop + def autocorrect(_node); end + def investigate(processed_source); end + + protected + + def check_sigil_present(sigil); end + def check_strictness_level(sigil, strictness); end + def check_strictness_not_empty(sigil, strictness); end + def check_strictness_valid(sigil, strictness); end + def extract_sigil(processed_source); end + def extract_strictness(sigil); end + def minimum_strictness; end + def require_sigil_on_all_files?; end + def suggested_strictness; end + def suggested_strictness_level(minimum_strictness, suggested_strictness); end +end + +RuboCop::Cop::Sorbet::ValidSigil::SIGIL_REGEX = T.let(T.unsafe(nil), Regexp) + +RuboCop::Cop::Sorbet::ValidSigil::STRICTNESS_LEVELS = T.let(T.unsafe(nil), Array) + +RuboCop::NodePattern = RuboCop::AST::NodePattern + +RuboCop::ProcessedSource = RuboCop::AST::ProcessedSource + +module RuboCop::Sorbet +end + +RuboCop::Sorbet::CONFIG = T.let(T.unsafe(nil), Hash) + +class RuboCop::Sorbet::Error < ::StandardError +end + +module RuboCop::Sorbet::Inject + class << self + def defaults!; end + end +end + +RuboCop::Sorbet::VERSION = T.let(T.unsafe(nil), String) + +RuboCop::Token = RuboCop::AST::Token
true
Other
Homebrew
brew
d7dad10771b8730ac63056d71d8332890affd0af.json
sorbet: Update RBI files and prune files.yaml. Autogenerated by [a scheduled GitHub Action](https://github.com/Homebrew/brew/blob/master/.github/workflows/sorbet.yml).
Library/Homebrew/sorbet/rbi/gems/sorbet-runtime-stub@0.2.0.rbi
@@ -0,0 +1,8 @@ +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `sorbet-runtime-stub` gem. +# Please instead update this file by running `tapioca sync`. + +# typed: true + +# THIS IS AN EMPTY RBI FILE. +# see https://github.com/Shopify/tapioca/blob/master/README.md#manual-gem-requires
true
Other
Homebrew
brew
d7dad10771b8730ac63056d71d8332890affd0af.json
sorbet: Update RBI files and prune files.yaml. Autogenerated by [a scheduled GitHub Action](https://github.com/Homebrew/brew/blob/master/.github/workflows/sorbet.yml).
Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi
@@ -8158,6 +8158,8 @@ module Homebrew::EnvConfig def self.skip_or_later_bottles?(); end + def self.sorbet_runtime?(); end + def self.sudo_askpass(); end def self.svn(); end @@ -10256,8 +10258,6 @@ module IRB def self.load_modules(); end - def self.parse_opts(argv: T.unsafe(nil)); end - def self.rc_file(ext=T.unsafe(nil)); end def self.rc_file_generators(); end @@ -22357,10 +22357,16 @@ class RuboCop::AST::NodePattern::Parser end module RuboCop::AST::NodePattern::Sets + SET_ABSTRACT_OVERRIDE_OVERRIDABLE_ETC = ::T.let(nil, ::T.untyped) + SET_ANY_ALL_NORETURN_ETC = ::T.let(nil, ::T.untyped) + SET_ATTR_READER_ATTR_WRITER_ATTR_ACCESSOR = ::T.let(nil, ::T.untyped) SET_BUILD_RECOMMENDED_TEST_OPTIONAL = ::T.let(nil, ::T.untyped) + SET_CONSTANTIZE_CONSTANTS_CONST_GET = ::T.let(nil, ::T.untyped) SET_DEPENDS_ON_USES_FROM_MACOS = ::T.let(nil, ::T.untyped) SET_INCLUDE_WITH_WITHOUT = ::T.let(nil, ::T.untyped) + SET_PROP_CONST = ::T.let(nil, ::T.untyped) SET_SYSTEM_SHELL_OUTPUT_PIPE_OUTPUT = ::T.let(nil, ::T.untyped) + SET_TYPE_TEMPLATE_TYPE_MEMBER = ::T.let(nil, ::T.untyped) SET_WITH_WITHOUT = ::T.let(nil, ::T.untyped) end @@ -26169,35 +26175,16 @@ module URI end class URL - def branch(); end - - def cookies(); end - - def data(); end - def path(*args, &block); end - def referer(); end - - def revision(); end - - def revisions(); end - def scheme(*args, &block); end - def specs(); end - - def tag(); end - def to_s(*args, &block); end +end - def trust_cert(); end - - def uri(); end - - def user_agent(); end - - def using(); end +class URL + extend ::T::Private::Methods::MethodHooks + extend ::T::Private::Methods::SingletonMethodHooks end class UnboundMethod @@ -26211,6 +26198,10 @@ end module UnicodeNormalize end +class UnpackStrategy::Zip + include ::UnpackStrategy::Zip::MacOSZipExtension +end + class Utils::Bottles::Collector def [](*args, &block); end
true
Other
Homebrew
brew
73dc98d1c75bfd9b05bc3504d12356e420038b2b.json
Adjust RuboCop rules for Sorbet.
Library/.rubocop.yml
@@ -12,7 +12,12 @@ AllCops: DisplayCopNames: false # enable all pending rubocops NewCops: enable + Include: + - '**/*.rbi' Exclude: + - 'Homebrew/sorbet/rbi/gems/**/*.rbi' + - 'Homebrew/sorbet/rbi/hidden-definitions/**/*.rbi' + - 'Homebrew/sorbet/rbi/todo.rbi' - 'Homebrew/bin/*' - 'Homebrew/vendor/**/*' @@ -62,6 +67,10 @@ Naming/HeredocDelimiterNaming: ForbiddenDelimiters: - END, EOD, EOF +Naming/MethodName: + IgnoredPatterns: + - '\AHEAD\?\Z' + # Allow dashes in filenames. Naming/FileName: Regex: !ruby/regexp /^[\w\@\-\+\.]+(\.rb)?$/ @@ -264,9 +273,14 @@ Layout/LineLength: ' "~/Library/Application Support/', '"~/Library/Caches/', '"~/Application Support', ' was verified as official when first introduced to the cask'] -# Enable once we are using `sorbet-runtime`. Sorbet/FalseSigil: - Enabled: false + Exclude: + - 'Taps/**/*.rb' + - 'Homebrew/test/**/Casks/**/*.rb' + +Sorbet/StrictSigil: + Include: + - '**/*.rbi' # Try getting rid of these. Sorbet/ConstantsFromStrings: @@ -302,6 +316,7 @@ Style/ClassVars: Style/Documentation: Exclude: - 'Taps/**/*' + - '**/*.rbi' Style/DocumentationMethod: Include: @@ -313,6 +328,7 @@ Style/FrozenStringLiteralComment: Exclude: - 'Taps/*/*/{Formula,Casks,}/*.rb' - 'Homebrew/test/**/Casks/**/*.rb' + - '**/*.rbi' # TODO: remove this when possible. Style/GlobalVars:
true
Other
Homebrew
brew
73dc98d1c75bfd9b05bc3504d12356e420038b2b.json
Adjust RuboCop rules for Sorbet.
Library/Homebrew/.rubocop.yml
@@ -45,10 +45,6 @@ Naming/PredicateName: # Can't rename these. AllowedMethods: is_32_bit?, is_64_bit? -Style/FrozenStringLiteralComment: - Exclude: - - '**/Casks/**/*.rb' - Style/HashAsLastArrayItem: Exclude: - 'test/utils/spdx_spec.rb'
true
Other
Homebrew
brew
4c36cf2e8e072b56a66454ddabe7bb9986a2b83e.json
cmd/info: Add --json=v2 for outputing formula and cask json
Library/Homebrew/cli/named_args.rb
@@ -38,8 +38,16 @@ def to_formulae_and_casks(only: nil, method: nil) end end + def to_formulae_to_casks(method: nil, only: nil) + @to_formulae_to_casks ||= {} + @to_formulae_to_casks[[method, only]] = to_formulae_and_casks(method: method, only: only) + .partition { |o| o.is_a?(Formula) } + .map(&:freeze).freeze + end + def to_formulae_casks_unknowns(method: nil) - downcased_unique_named.map do |name| + @to_formulae_casks_unknowns ||= {} + @to_formulae_casks_unknowns[method] = downcased_unique_named.map do |name| load_formula_or_cask(name, method: method) rescue FormulaOrCaskUnavailableError => e e @@ -88,9 +96,7 @@ def to_resolved_formulae end def to_resolved_formulae_to_casks(only: nil) - @to_resolved_formulae_to_casks ||= to_formulae_and_casks(method: :resolve, only: only) - .partition { |o| o.is_a?(Formula) } - .map(&:freeze).freeze + to_formulae_to_casks(method: :resolve, only: only) end # Convert named arguments to `Tap`, `Formula` or `Cask` objects.
true
Other
Homebrew
brew
4c36cf2e8e072b56a66454ddabe7bb9986a2b83e.json
cmd/info: Add --json=v2 for outputing formula and cask json
Library/Homebrew/cmd/info.rb
@@ -81,9 +81,6 @@ def info print_analytics(args: args) elsif args.json - raise UsageError, "invalid JSON version: #{args.json}" unless ["v1", true].include? args.json - raise FormulaUnspecifiedError if !(args.all? || args.installed?) && args.no_named? - print_json(args: args) elsif args.github? raise FormulaOrCaskUnspecifiedError if args.no_named? @@ -143,15 +140,49 @@ def print_info(args:) end end + def json_version(version) + version_hash = { + true => :default, + "v1" => :v1, + "v2" => :v2, + } + + raise UsageError, "invalid JSON version: #{version}" unless version_hash.include?(version) + + version_hash[version] + end + def print_json(args:) - ff = if args.all? - Formula.sort - elsif args.installed? - Formula.installed.sort + raise FormulaOrCaskUnspecifiedError if !(args.all? || args.installed?) && args.no_named? + + json = case json_version(args.json) + when :v1, :default + formulae = if args.all? + Formula.sort + elsif args.installed? + Formula.installed.sort + else + args.named.to_formulae + end + + formulae.map(&:to_hash) + when :v2 + formulae, casks = if args.all? + [Formula.sort, Cask::Cask.to_a.sort_by(&:full_name)] + elsif args.installed? + [Formula.installed.sort, Cask::Caskroom.casks.sort_by(&:full_name)] + else + args.named.to_formulae_to_casks + end + + { + "formulae" => formulae.map(&:to_hash), + "casks" => casks.map(&:to_h), + } else - args.named.to_formulae + raise end - json = ff.map(&:to_hash) + puts JSON.generate(json) end
true
Other
Homebrew
brew
d49100487944014a2c8a554e1eff257addddf460.json
Remove helper script.
Library/add-typed.rb
@@ -1,27 +0,0 @@ -#!/usr/bin/env ruby - -require 'pathname' -require 'open3' - - -Dir.chdir "#{__dir__}/Homebrew" - -files = Pathname.glob("**/*.rb").reject { |path| path.to_s.start_with?("vendor/") } - -files.each do |file| - - content = file.read - - if content.start_with?("# typed: ") - puts "Already typed: #{file}" - next - end - - ['strict', 'true', 'false', 'ignore'].each do |level| - puts "Trying #{file} with level #{level}." - file.write "# typed: #{level}\n#{content.strip}\n" - - output, status = Open3.capture2e('brew', 'typecheck') - break if status.success? - end -end
false
Other
Homebrew
brew
059122c7246915559590ef09714086ebf7cd32d3.json
Inline type annotations for `User`.
Library/Homebrew/sorbet/rbi/utils/user.rbi
@@ -1,11 +0,0 @@ -# typed: strict - -class User < SimpleDelegator - include Kernel - - sig { returns(T::Boolean) } - def gui?; end - - sig { returns(T.nilable(T.attached_class)) } - def self.current; end -end
true
Other
Homebrew
brew
059122c7246915559590ef09714086ebf7cd32d3.json
Inline type annotations for `User`.
Library/Homebrew/utils/user.rb
@@ -10,7 +10,11 @@ # # @api private class User < SimpleDelegator + include Kernel + extend T::Sig + # Return whether the user has an active GUI session. + sig { returns(T::Boolean) } def gui? out, _, status = system_command "who" return false unless status.success? @@ -21,6 +25,7 @@ def gui? end # Return the current user. + sig { returns(T.nilable(T.attached_class)) } def self.current return @current if defined?(@current)
true
Other
Homebrew
brew
fc7a34585f7a290b73e4a9861601060ee42afe3e.json
Inline type annotations for `Tty`.
Library/Homebrew/sorbet/rbi/utils/tty.rbi
@@ -1,36 +0,0 @@ -# typed: strict - -module Tty - include Kernel - - sig{ params(string: String).returns(String) } - def strip_ansi(string) - end - - sig{ returns(Integer) } - def width() - end - - sig{ params(string: String).returns(T.nilable(String)) } - def truncate(string) - end - - def append_to_escape_sequence(code) - end - - sig{ returns(String) } - def current_escape_sequence() - end - - sig{ void } - def reset_escape_sequence!() - end - - sig{ returns(String) } - def to_s - end - - sig { returns(T::Boolean) } - def color? - end -end
true
Other
Homebrew
brew
fc7a34585f7a290b73e4a9861601060ee42afe3e.json
Inline type annotations for `Tty`.
Library/Homebrew/utils/tty.rb
@@ -5,11 +5,15 @@ # # @api private module Tty + include Kernel + extend T::Sig + @stream = $stdout module_function - def with(stream) + sig { params(stream: IO, _block: T.proc.params(arg0: IO).void).void } + def with(stream, &_block) previous_stream = @stream @stream = stream @@ -18,10 +22,12 @@ def with(stream) @stream = previous_stream end + sig { params(string: String).returns(String) } def strip_ansi(string) string.gsub(/\033\[\d+(;\d+)*m/, "") end + sig { returns(Integer) } def width @width ||= begin _, width = `/bin/stty size 2>/dev/null`.split @@ -31,8 +37,9 @@ def width end end + sig { params(string: String).returns(String) } def truncate(string) - (w = width).zero? ? string.to_s : string.to_s[0, w - 4] + (w = width).zero? ? string.to_s : (string.to_s[0, w - 4] || "") end COLOR_CODES = { @@ -65,18 +72,21 @@ def truncate(string) CODES = COLOR_CODES.merge(STYLE_CODES).freeze + sig { params(code: Integer).returns(T.self_type) } def append_to_escape_sequence(code) @escape_sequence ||= [] @escape_sequence << code self end + sig { returns(String) } def current_escape_sequence return "" if @escape_sequence.nil? "\033[#{@escape_sequence.join(";")}m" end + sig { void } def reset_escape_sequence! @escape_sequence = nil end @@ -97,6 +107,7 @@ def reset_escape_sequence! end end + sig { returns(String) } def to_s return "" unless color? @@ -105,6 +116,7 @@ def to_s reset_escape_sequence! end + sig { returns(T::Boolean) } def color? return false if Homebrew::EnvConfig.no_color? return true if Homebrew::EnvConfig.color?
true
Other
Homebrew
brew
12e173cd50a36e99b981d452d230c6225136f731.json
Inline type annotations for `SPDX`.
Library/Homebrew/sorbet/rbi/utils/spdx.rbi
@@ -1,11 +0,0 @@ -# typed: strict - -module SPDX - include Kernel - - def spdx_data; end - - def download_latest_license_data!(to: JSON_PATH); end - - def curl_download(*args, to: nil, partial: true, **options); end -end
true
Other
Homebrew
brew
12e173cd50a36e99b981d452d230c6225136f731.json
Inline type annotations for `SPDX`.
Library/Homebrew/utils/spdx.rb
@@ -8,6 +8,7 @@ # # @api private module SPDX + include Utils::Curl extend Utils::Curl module_function
true
Other
Homebrew
brew
24ae318a3d5f0519f5fe29d08e01e8a044d99d87.json
Move type annotations into files.
Library/Homebrew/PATH.rb
@@ -1,3 +1,4 @@ +# typed: false # frozen_string_literal: true # Represention of a `*PATH` environment variable.
true
Other
Homebrew
brew
24ae318a3d5f0519f5fe29d08e01e8a044d99d87.json
Move type annotations into files.
Library/Homebrew/bintray.rb
@@ -1,3 +1,4 @@ +# typed: false # frozen_string_literal: true require "utils/curl"
true
Other
Homebrew
brew
24ae318a3d5f0519f5fe29d08e01e8a044d99d87.json
Move type annotations into files.
Library/Homebrew/brew.rb
@@ -1,3 +1,4 @@ +# typed: false # frozen_string_literal: true if ENV["HOMEBREW_STACKPROF"]
true
Other
Homebrew
brew
24ae318a3d5f0519f5fe29d08e01e8a044d99d87.json
Move type annotations into files.
Library/Homebrew/build.rb
@@ -1,3 +1,4 @@ +# typed: false # frozen_string_literal: true # This script is loaded by formula_installer as a separate instance.
true
Other
Homebrew
brew
24ae318a3d5f0519f5fe29d08e01e8a044d99d87.json
Move type annotations into files.
Library/Homebrew/build_environment.rb
@@ -1,3 +1,4 @@ +# typed: false # frozen_string_literal: true # Settings for the build environment.
true
Other
Homebrew
brew
24ae318a3d5f0519f5fe29d08e01e8a044d99d87.json
Move type annotations into files.
Library/Homebrew/build_options.rb
@@ -1,3 +1,4 @@ +# typed: true # frozen_string_literal: true # Options for a formula build.
true
Other
Homebrew
brew
24ae318a3d5f0519f5fe29d08e01e8a044d99d87.json
Move type annotations into files.
Library/Homebrew/cache_store.rb
@@ -1,3 +1,4 @@ +# typed: true # frozen_string_literal: true require "json"
true
Other
Homebrew
brew
24ae318a3d5f0519f5fe29d08e01e8a044d99d87.json
Move type annotations into files.
Library/Homebrew/cask.rb
@@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true require "cask/artifact"
true
Other
Homebrew
brew
24ae318a3d5f0519f5fe29d08e01e8a044d99d87.json
Move type annotations into files.
Library/Homebrew/cask/artifact.rb
@@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true require "cask/artifact/app"
true
Other
Homebrew
brew
24ae318a3d5f0519f5fe29d08e01e8a044d99d87.json
Move type annotations into files.
Library/Homebrew/cask/artifact/abstract_artifact.rb
@@ -1,3 +1,4 @@ +# typed: false # frozen_string_literal: true module Cask
true
Other
Homebrew
brew
24ae318a3d5f0519f5fe29d08e01e8a044d99d87.json
Move type annotations into files.
Library/Homebrew/cask/artifact/abstract_flight_block.rb
@@ -1,3 +1,4 @@ +# typed: true # frozen_string_literal: true require "cask/artifact/abstract_artifact"
true
Other
Homebrew
brew
24ae318a3d5f0519f5fe29d08e01e8a044d99d87.json
Move type annotations into files.
Library/Homebrew/cask/artifact/abstract_uninstall.rb
@@ -1,3 +1,4 @@ +# typed: false # frozen_string_literal: true require "timeout"
true
Other
Homebrew
brew
24ae318a3d5f0519f5fe29d08e01e8a044d99d87.json
Move type annotations into files.
Library/Homebrew/cask/artifact/app.rb
@@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true require "cask/artifact/moved"
true
Other
Homebrew
brew
24ae318a3d5f0519f5fe29d08e01e8a044d99d87.json
Move type annotations into files.
Library/Homebrew/cask/artifact/artifact.rb
@@ -1,3 +1,4 @@ +# typed: false # frozen_string_literal: true require "cask/artifact/moved"
true
Other
Homebrew
brew
24ae318a3d5f0519f5fe29d08e01e8a044d99d87.json
Move type annotations into files.
Library/Homebrew/cask/artifact/audio_unit_plugin.rb
@@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true require "cask/artifact/moved"
true
Other
Homebrew
brew
24ae318a3d5f0519f5fe29d08e01e8a044d99d87.json
Move type annotations into files.
Library/Homebrew/cask/artifact/binary.rb
@@ -1,3 +1,4 @@ +# typed: true # frozen_string_literal: true require "cask/artifact/symlinked"
true
Other
Homebrew
brew
24ae318a3d5f0519f5fe29d08e01e8a044d99d87.json
Move type annotations into files.
Library/Homebrew/cask/artifact/colorpicker.rb
@@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true require "cask/artifact/moved"
true
Other
Homebrew
brew
24ae318a3d5f0519f5fe29d08e01e8a044d99d87.json
Move type annotations into files.
Library/Homebrew/cask/artifact/dictionary.rb
@@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true require "cask/artifact/moved"
true
Other
Homebrew
brew
24ae318a3d5f0519f5fe29d08e01e8a044d99d87.json
Move type annotations into files.
Library/Homebrew/cask/artifact/font.rb
@@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true require "cask/artifact/moved"
true
Other
Homebrew
brew
24ae318a3d5f0519f5fe29d08e01e8a044d99d87.json
Move type annotations into files.
Library/Homebrew/cask/artifact/input_method.rb
@@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true require "cask/artifact/moved"
true
Other
Homebrew
brew
24ae318a3d5f0519f5fe29d08e01e8a044d99d87.json
Move type annotations into files.
Library/Homebrew/cask/artifact/installer.rb
@@ -1,3 +1,4 @@ +# typed: false # frozen_string_literal: true require "cask/artifact/abstract_artifact"
true
Other
Homebrew
brew
24ae318a3d5f0519f5fe29d08e01e8a044d99d87.json
Move type annotations into files.
Library/Homebrew/cask/artifact/internet_plugin.rb
@@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true require "cask/artifact/moved"
true
Other
Homebrew
brew
24ae318a3d5f0519f5fe29d08e01e8a044d99d87.json
Move type annotations into files.
Library/Homebrew/cask/artifact/manpage.rb
@@ -1,3 +1,4 @@ +# typed: true # frozen_string_literal: true require "cask/artifact/symlinked"
true
Other
Homebrew
brew
24ae318a3d5f0519f5fe29d08e01e8a044d99d87.json
Move type annotations into files.
Library/Homebrew/cask/artifact/mdimporter.rb
@@ -1,3 +1,4 @@ +# typed: false # frozen_string_literal: true require "cask/artifact/moved"
true
Other
Homebrew
brew
24ae318a3d5f0519f5fe29d08e01e8a044d99d87.json
Move type annotations into files.
Library/Homebrew/cask/artifact/moved.rb
@@ -1,3 +1,4 @@ +# typed: false # frozen_string_literal: true require "cask/artifact/relocated"
true
Other
Homebrew
brew
24ae318a3d5f0519f5fe29d08e01e8a044d99d87.json
Move type annotations into files.
Library/Homebrew/cask/artifact/pkg.rb
@@ -1,3 +1,4 @@ +# typed: false # frozen_string_literal: true require "plist"
true
Other
Homebrew
brew
24ae318a3d5f0519f5fe29d08e01e8a044d99d87.json
Move type annotations into files.
Library/Homebrew/cask/artifact/postflight_block.rb
@@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true require "cask/artifact/abstract_flight_block"
true
Other
Homebrew
brew
24ae318a3d5f0519f5fe29d08e01e8a044d99d87.json
Move type annotations into files.
Library/Homebrew/cask/artifact/preflight_block.rb
@@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true require "cask/artifact/abstract_flight_block"
true
Other
Homebrew
brew
24ae318a3d5f0519f5fe29d08e01e8a044d99d87.json
Move type annotations into files.
Library/Homebrew/cask/artifact/prefpane.rb
@@ -1,3 +1,4 @@ +# typed: true # frozen_string_literal: true require "cask/artifact/moved"
true
Other
Homebrew
brew
24ae318a3d5f0519f5fe29d08e01e8a044d99d87.json
Move type annotations into files.
Library/Homebrew/cask/artifact/qlplugin.rb
@@ -1,3 +1,4 @@ +# typed: false # frozen_string_literal: true require "cask/artifact/moved"
true
Other
Homebrew
brew
24ae318a3d5f0519f5fe29d08e01e8a044d99d87.json
Move type annotations into files.
Library/Homebrew/cask/artifact/relocated.rb
@@ -1,3 +1,4 @@ +# typed: true # frozen_string_literal: true require "cask/artifact/abstract_artifact"
true
Other
Homebrew
brew
24ae318a3d5f0519f5fe29d08e01e8a044d99d87.json
Move type annotations into files.
Library/Homebrew/cask/artifact/screen_saver.rb
@@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true require "cask/artifact/moved"
true
Other
Homebrew
brew
24ae318a3d5f0519f5fe29d08e01e8a044d99d87.json
Move type annotations into files.
Library/Homebrew/cask/artifact/service.rb
@@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true require "cask/artifact/moved"
true
Other
Homebrew
brew
24ae318a3d5f0519f5fe29d08e01e8a044d99d87.json
Move type annotations into files.
Library/Homebrew/cask/artifact/stage_only.rb
@@ -1,3 +1,4 @@ +# typed: true # frozen_string_literal: true require "cask/artifact/abstract_artifact"
true
Other
Homebrew
brew
24ae318a3d5f0519f5fe29d08e01e8a044d99d87.json
Move type annotations into files.
Library/Homebrew/cask/artifact/suite.rb
@@ -1,3 +1,4 @@ +# typed: true # frozen_string_literal: true require "cask/artifact/moved"
true
Other
Homebrew
brew
24ae318a3d5f0519f5fe29d08e01e8a044d99d87.json
Move type annotations into files.
Library/Homebrew/cask/artifact/symlinked.rb
@@ -1,3 +1,4 @@ +# typed: false # frozen_string_literal: true require "cask/artifact/relocated"
true
Other
Homebrew
brew
24ae318a3d5f0519f5fe29d08e01e8a044d99d87.json
Move type annotations into files.
Library/Homebrew/cask/artifact/uninstall.rb
@@ -1,3 +1,4 @@ +# typed: false # frozen_string_literal: true require "cask/artifact/abstract_uninstall"
true
Other
Homebrew
brew
24ae318a3d5f0519f5fe29d08e01e8a044d99d87.json
Move type annotations into files.
Library/Homebrew/cask/artifact/vst3_plugin.rb
@@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true require "cask/artifact/moved"
true
Other
Homebrew
brew
24ae318a3d5f0519f5fe29d08e01e8a044d99d87.json
Move type annotations into files.
Library/Homebrew/cask/artifact/vst_plugin.rb
@@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true require "cask/artifact/moved"
true
Other
Homebrew
brew
24ae318a3d5f0519f5fe29d08e01e8a044d99d87.json
Move type annotations into files.
Library/Homebrew/cask/artifact/zap.rb
@@ -1,3 +1,4 @@ +# typed: false # frozen_string_literal: true require "cask/artifact/abstract_uninstall"
true
Other
Homebrew
brew
24ae318a3d5f0519f5fe29d08e01e8a044d99d87.json
Move type annotations into files.
Library/Homebrew/cask/audit.rb
@@ -1,3 +1,4 @@ +# typed: false # frozen_string_literal: true require "cask/denylist"
true
Other
Homebrew
brew
24ae318a3d5f0519f5fe29d08e01e8a044d99d87.json
Move type annotations into files.
Library/Homebrew/cask/auditor.rb
@@ -1,3 +1,4 @@ +# typed: true # frozen_string_literal: true require "cask/audit"
true
Other
Homebrew
brew
24ae318a3d5f0519f5fe29d08e01e8a044d99d87.json
Move type annotations into files.
Library/Homebrew/cask/cache.rb
@@ -1,3 +1,4 @@ +# typed: true # frozen_string_literal: true module Cask
true
Other
Homebrew
brew
24ae318a3d5f0519f5fe29d08e01e8a044d99d87.json
Move type annotations into files.
Library/Homebrew/cask/cask.rb
@@ -1,3 +1,4 @@ +# typed: false # frozen_string_literal: true require "cask/cask_loader"
true