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 | 07639e8cebd5c791ab3bee9f6f4802688c3e5fe4.json | write_image_index: Remove Docker mediaType
Remove `mediaType: "application/vnd.docker.distribution.manifest.list.v2+json"`
previously needed for correct multi-arch display in GitHub Packages UI. | Library/Homebrew/github_packages.rb | @@ -340,8 +340,6 @@ def write_image_config(platform_hash, tar_sha256, blobs)
def write_image_index(manifests, blobs, annotations)
image_index = {
- # Currently needed for correct multi-arch display in GitHub Packages UI
- mediaType: "application/vnd.docker.distribution.manifest.list.v2+json",
schemaVersion: 2,
manifests: manifests,
annotations: annotations, | false |
Other | Homebrew | brew | 9f9403b753aece5347d6bc698b9c0d77725ea13d.json | Add flags for Codecov | .github/workflows/tests.yml | @@ -216,6 +216,7 @@ jobs:
- uses: codecov/codecov-action@e156083f13aff6830c92fc5faa23505779fbf649 # v1.2.1
with:
directory: /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/test/coverage
+ flags: ${{ matrix.name }}
test-default-formula-linux:
name: test default formula (Linux) | false |
Other | Homebrew | brew | ec20eb604d03f7283ae2b85e1b1038ab1298cae7.json | utils/gitub/api: fix incorrect error when unauthenticated | Library/Homebrew/utils/github/api.rb | @@ -63,7 +63,7 @@ def pretty_ratelimit_reset(reset)
class AuthenticationFailedError < Error
def initialize(github_message)
@github_message = github_message
- message = +"GitHub #{github_message}:"
+ message = +"GitHub API Error: #{github_message}\n"
message << if Homebrew::EnvConfig.github_api_token
<<~EOS
HOMEBREW_GITHUB_API_TOKEN may be invalid or expired; check:
@@ -115,10 +115,8 @@ def initialize(github_message, errors)
# but only if that password looks like a GitHub Personal Access Token.
sig { returns(T.nilable(String)) }
def keychain_username_password
- github_credentials = Utils.popen(["git", "credential-osxkeychain", "get"], "w+") do |pipe|
+ github_credentials = Utils.popen_write("git", "credential-osxkeychain", "get") do |pipe|
pipe.write "protocol=https\nhost=github.com\n"
- pipe.close_write
- pipe.read
end
github_username = github_credentials[/username=(.+)/, 1]
github_password = github_credentials[/password=(.+)/, 1]
@@ -284,15 +282,17 @@ def raise_error(output, errors, http_code, headers, scopes)
meta[key] = value.strip
end
- if meta.fetch("x-ratelimit-remaining", 1).to_i <= 0
- reset = meta.fetch("x-ratelimit-reset").to_i
- raise RateLimitExceededError.new(reset, message)
- end
-
credentials_error_message(meta, scopes)
case http_code
- when "401", "403"
+ when "401"
+ raise AuthenticationFailedError, message
+ when "403"
+ if meta.fetch("x-ratelimit-remaining", 1).to_i <= 0
+ reset = meta.fetch("x-ratelimit-reset").to_i
+ raise RateLimitExceededError.new(reset, message)
+ end
+
raise AuthenticationFailedError, message
when "404"
raise MissingAuthenticationError if credentials_type == :none && scopes.present? | false |
Other | Homebrew | brew | 69cf697e2ee94ec7e793d5022bbe9e9f1d09ab15.json | Remove Audacity from denylist.rb | Library/Homebrew/cask/denylist.rb | @@ -13,8 +13,6 @@ def self.reason(name)
case name
when /^adobe-(after|illustrator|indesign|photoshop|premiere)/
"Adobe casks were removed because they are too difficult to maintain."
- when /^audacity$/
- "Audacity was removed because it is too difficult to download programmatically."
when /^pharo$/
"Pharo developers maintain their own tap."
end | false |
Other | Homebrew | brew | f04404a9f54062340d7cccbefc3b69547c5488c6.json | Update RBI files for tapioca. | Library/Homebrew/sorbet/rbi/gems/tapioca@0.4.20.rbi | @@ -460,8 +460,8 @@ class Tapioca::Generator < ::Thor::Shell::Color
sig { params(config: Tapioca::Config).void }
def initialize(config); end
- sig { params(requested_constants: T::Array[String], should_verify: T::Boolean).void }
- def build_dsl(requested_constants, should_verify: T.unsafe(nil)); end
+ sig { params(requested_constants: T::Array[String], should_verify: T::Boolean, quiet: T::Boolean).void }
+ def build_dsl(requested_constants, should_verify: T.unsafe(nil), quiet: T.unsafe(nil)); end
sig { params(gem_names: T::Array[String]).void }
def build_gem_rbis(gem_names); end
sig { void }
@@ -479,10 +479,12 @@ class Tapioca::Generator < ::Thor::Shell::Color
def add(filename); end
sig { returns(T::Array[String]) }
def added_rbis; end
+ sig { params(cause: Symbol, files: T::Array[String]).returns(String) }
+ def build_error_for_files(cause, files); end
sig { returns(Tapioca::Gemfile) }
def bundle; end
- sig { params(constant: Module, contents: String, outpath: Pathname).returns(T.nilable(Pathname)) }
- def compile_dsl_rbi(constant, contents, outpath: T.unsafe(nil)); end
+ sig { params(constant_name: String, contents: String, outpath: Pathname, quiet: T::Boolean).returns(T.nilable(Pathname)) }
+ def compile_dsl_rbi(constant_name, contents, outpath: T.unsafe(nil), quiet: T.unsafe(nil)); end
sig { params(gem: Tapioca::Gemfile::Gem).void }
def compile_gem_rbi(gem); end
sig { returns(Tapioca::Compilers::SymbolTableCompiler) }
@@ -519,12 +521,14 @@ class Tapioca::Generator < ::Thor::Shell::Color
def move(old_filename, new_filename); end
sig { void }
def perform_additions; end
- sig { params(dir: String).void }
- def perform_dsl_verification(dir); end
+ sig { params(dir: Pathname, constant_lookup: T::Hash[String, String]).void }
+ def perform_dsl_verification(dir, constant_lookup); end
sig { void }
def perform_removals; end
sig { params(files: T::Set[Pathname]).void }
def purge_stale_dsl_rbi_files(files); end
+ sig { params(path: Pathname).returns(T::Array[Pathname]) }
+ def rbi_files_in(path); end
sig { params(command: String, reason: T.nilable(String), strictness: T.nilable(String)).returns(String) }
def rbi_header(command, reason: T.unsafe(nil), strictness: T.unsafe(nil)); end
sig { params(filename: Pathname).void }
@@ -535,7 +539,7 @@ class Tapioca::Generator < ::Thor::Shell::Color
def require_gem_file; end
sig { params(message: String, color: T.any(Symbol, T::Array[Symbol])).void }
def say_error(message = T.unsafe(nil), *color); end
- sig { params(tmp_dir: Pathname).returns(T.nilable(String)) }
+ sig { params(tmp_dir: Pathname).returns(T::Hash[String, Symbol]) }
def verify_dsl_rbi(tmp_dir:); end
end
@@ -556,6 +560,8 @@ module Tapioca::GenericTypeRegistry
sig { params(constant: Module, name: String).returns(Module) }
def create_generic_type(constant, name); end
+ sig { params(constant: Class).returns(Class) }
+ def create_sealed_safe_subclass(constant); end
sig { params(constant: Module).returns(T::Hash[Integer, String]) }
def lookup_or_initialize_type_variables(constant); end
sig { params(constant: Module).returns(T.nilable(String)) } | true |
Other | Homebrew | brew | f04404a9f54062340d7cccbefc3b69547c5488c6.json | Update RBI files for tapioca. | Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi | @@ -29673,6 +29673,21 @@ module URI
def self.get_encoding(label); end
end
+module URL::BlockDSL::PageWithURL
+ extend ::T::Private::Methods::MethodHooks
+ extend ::T::Private::Methods::SingletonMethodHooks
+end
+
+class URL::BlockDSL
+ extend ::T::Private::Methods::MethodHooks
+ extend ::T::Private::Methods::SingletonMethodHooks
+end
+
+class URL::DSL
+ extend ::T::Private::Methods::MethodHooks
+ extend ::T::Private::Methods::SingletonMethodHooks
+end
+
class URL
extend ::T::Private::Methods::MethodHooks
extend ::T::Private::Methods::SingletonMethodHooks | true |
Other | Homebrew | brew | 64183fac5c5b751f773d0953cb65e9528a185961.json | Update RBI files for mechanize. | Library/Homebrew/sorbet/rbi/gems/addressable@2.7.0.rbi | @@ -0,0 +1,290 @@
+# DO NOT EDIT MANUALLY
+# This is an autogenerated file for types exported from the `addressable` gem.
+# Please instead update this file by running `bin/tapioca sync`.
+
+# typed: true
+
+module Addressable
+end
+
+module Addressable::IDNA
+ class << self
+ def to_ascii(input); end
+ def to_unicode(input); end
+ def unicode_normalize_kc(input); end
+
+ private
+
+ def lookup_unicode_combining_class(codepoint); end
+ def lookup_unicode_compatibility(codepoint); end
+ def lookup_unicode_composition(unpacked); end
+ def lookup_unicode_lowercase(codepoint); end
+ def punycode_adapt(delta, numpoints, firsttime); end
+ def punycode_basic?(codepoint); end
+ def punycode_decode(punycode); end
+ def punycode_decode_digit(codepoint); end
+ def punycode_delimiter?(codepoint); end
+ def punycode_encode(unicode); end
+ def punycode_encode_digit(d); end
+ def unicode_compose(unpacked); end
+ def unicode_compose_pair(ch_one, ch_two); end
+ def unicode_decompose(unpacked); end
+ def unicode_decompose_hangul(codepoint); end
+ def unicode_downcase(input); end
+ def unicode_sort_canonical(unpacked); end
+ end
+end
+
+Addressable::IDNA::ACE_MAX_LENGTH = T.let(T.unsafe(nil), Integer)
+
+Addressable::IDNA::ACE_PREFIX = T.let(T.unsafe(nil), String)
+
+Addressable::IDNA::COMPOSITION_TABLE = T.let(T.unsafe(nil), Hash)
+
+Addressable::IDNA::HANGUL_LBASE = T.let(T.unsafe(nil), Integer)
+
+Addressable::IDNA::HANGUL_LCOUNT = T.let(T.unsafe(nil), Integer)
+
+Addressable::IDNA::HANGUL_NCOUNT = T.let(T.unsafe(nil), Integer)
+
+Addressable::IDNA::HANGUL_SBASE = T.let(T.unsafe(nil), Integer)
+
+Addressable::IDNA::HANGUL_SCOUNT = T.let(T.unsafe(nil), Integer)
+
+Addressable::IDNA::HANGUL_TBASE = T.let(T.unsafe(nil), Integer)
+
+Addressable::IDNA::HANGUL_TCOUNT = T.let(T.unsafe(nil), Integer)
+
+Addressable::IDNA::HANGUL_VBASE = T.let(T.unsafe(nil), Integer)
+
+Addressable::IDNA::HANGUL_VCOUNT = T.let(T.unsafe(nil), Integer)
+
+Addressable::IDNA::PUNYCODE_BASE = T.let(T.unsafe(nil), Integer)
+
+Addressable::IDNA::PUNYCODE_DAMP = T.let(T.unsafe(nil), Integer)
+
+Addressable::IDNA::PUNYCODE_DELIMITER = T.let(T.unsafe(nil), Integer)
+
+Addressable::IDNA::PUNYCODE_INITIAL_BIAS = T.let(T.unsafe(nil), Integer)
+
+Addressable::IDNA::PUNYCODE_INITIAL_N = T.let(T.unsafe(nil), Integer)
+
+Addressable::IDNA::PUNYCODE_MAXINT = T.let(T.unsafe(nil), Integer)
+
+Addressable::IDNA::PUNYCODE_PRINT_ASCII = T.let(T.unsafe(nil), String)
+
+Addressable::IDNA::PUNYCODE_SKEW = T.let(T.unsafe(nil), Integer)
+
+Addressable::IDNA::PUNYCODE_TMAX = T.let(T.unsafe(nil), Integer)
+
+Addressable::IDNA::PUNYCODE_TMIN = T.let(T.unsafe(nil), Integer)
+
+class Addressable::IDNA::PunycodeBadInput < ::StandardError
+end
+
+class Addressable::IDNA::PunycodeBigOutput < ::StandardError
+end
+
+class Addressable::IDNA::PunycodeOverflow < ::StandardError
+end
+
+Addressable::IDNA::UNICODE_DATA = T.let(T.unsafe(nil), Hash)
+
+Addressable::IDNA::UNICODE_DATA_CANONICAL = T.let(T.unsafe(nil), Integer)
+
+Addressable::IDNA::UNICODE_DATA_COMBINING_CLASS = T.let(T.unsafe(nil), Integer)
+
+Addressable::IDNA::UNICODE_DATA_COMPATIBILITY = T.let(T.unsafe(nil), Integer)
+
+Addressable::IDNA::UNICODE_DATA_EXCLUSION = T.let(T.unsafe(nil), Integer)
+
+Addressable::IDNA::UNICODE_DATA_LOWERCASE = T.let(T.unsafe(nil), Integer)
+
+Addressable::IDNA::UNICODE_DATA_TITLECASE = T.let(T.unsafe(nil), Integer)
+
+Addressable::IDNA::UNICODE_DATA_UPPERCASE = T.let(T.unsafe(nil), Integer)
+
+Addressable::IDNA::UNICODE_MAX_LENGTH = T.let(T.unsafe(nil), Integer)
+
+Addressable::IDNA::UNICODE_TABLE = T.let(T.unsafe(nil), String)
+
+Addressable::IDNA::UTF8_REGEX = T.let(T.unsafe(nil), Regexp)
+
+Addressable::IDNA::UTF8_REGEX_MULTIBYTE = T.let(T.unsafe(nil), Regexp)
+
+class Addressable::URI
+ def initialize(options = T.unsafe(nil)); end
+
+ def +(uri); end
+ def ==(uri); end
+ def ===(uri); end
+ def absolute?; end
+ def authority; end
+ def authority=(new_authority); end
+ def basename; end
+ def default_port; end
+ def defer_validation; end
+ def display_uri; end
+ def domain; end
+ def dup; end
+ def empty?; end
+ def eql?(uri); end
+ def extname; end
+ def fragment; end
+ def fragment=(new_fragment); end
+ def freeze; end
+ def hash; end
+ def host; end
+ def host=(new_host); end
+ def hostname; end
+ def hostname=(new_hostname); end
+ def inferred_port; end
+ def inspect; end
+ def ip_based?; end
+ def join(uri); end
+ def join!(uri); end
+ def merge(hash); end
+ def merge!(uri); end
+ def normalize; end
+ def normalize!; end
+ def normalized_authority; end
+ def normalized_fragment; end
+ def normalized_host; end
+ def normalized_password; end
+ def normalized_path; end
+ def normalized_port; end
+ def normalized_query(*flags); end
+ def normalized_scheme; end
+ def normalized_site; end
+ def normalized_user; end
+ def normalized_userinfo; end
+ def omit(*components); end
+ def omit!(*components); end
+ def origin; end
+ def origin=(new_origin); end
+ def password; end
+ def password=(new_password); end
+ def path; end
+ def path=(new_path); end
+ def port; end
+ def port=(new_port); end
+ def query; end
+ def query=(new_query); end
+ def query_values(return_type = T.unsafe(nil)); end
+ def query_values=(new_query_values); end
+ def relative?; end
+ def request_uri; end
+ def request_uri=(new_request_uri); end
+ def route_from(uri); end
+ def route_to(uri); end
+ def scheme; end
+ def scheme=(new_scheme); end
+ def site; end
+ def site=(new_site); end
+ def tld; end
+ def tld=(new_tld); end
+ def to_hash; end
+ def to_s; end
+ def to_str; end
+ def user; end
+ def user=(new_user); end
+ def userinfo; end
+ def userinfo=(new_userinfo); end
+
+ protected
+
+ def remove_composite_values; end
+ def replace_self(uri); end
+ def split_path(path); end
+ def validate; end
+
+ class << self
+ def convert_path(path); end
+ def encode(uri, return_type = T.unsafe(nil)); end
+ def encode_component(component, character_class = T.unsafe(nil), upcase_encoded = T.unsafe(nil)); end
+ def escape(uri, return_type = T.unsafe(nil)); end
+ def form_encode(form_values, sort = T.unsafe(nil)); end
+ def form_unencode(encoded_value); end
+ def heuristic_parse(uri, hints = T.unsafe(nil)); end
+ def ip_based_schemes; end
+ def join(*uris); end
+ def normalize_component(component, character_class = T.unsafe(nil), leave_encoded = T.unsafe(nil)); end
+ def normalize_path(path); end
+ def normalized_encode(uri, return_type = T.unsafe(nil)); end
+ def parse(uri); end
+ def port_mapping; end
+ def unencode(uri, return_type = T.unsafe(nil), leave_encoded = T.unsafe(nil)); end
+ def unencode_component(uri, return_type = T.unsafe(nil), leave_encoded = T.unsafe(nil)); end
+ def unescape(uri, return_type = T.unsafe(nil), leave_encoded = T.unsafe(nil)); end
+ def unescape_component(uri, return_type = T.unsafe(nil), leave_encoded = T.unsafe(nil)); end
+ end
+end
+
+module Addressable::URI::CharacterClasses
+end
+
+Addressable::URI::CharacterClasses::ALPHA = T.let(T.unsafe(nil), String)
+
+Addressable::URI::CharacterClasses::AUTHORITY = T.let(T.unsafe(nil), String)
+
+Addressable::URI::CharacterClasses::DIGIT = T.let(T.unsafe(nil), String)
+
+Addressable::URI::CharacterClasses::FRAGMENT = T.let(T.unsafe(nil), String)
+
+Addressable::URI::CharacterClasses::GEN_DELIMS = T.let(T.unsafe(nil), String)
+
+Addressable::URI::CharacterClasses::HOST = T.let(T.unsafe(nil), String)
+
+Addressable::URI::CharacterClasses::PATH = T.let(T.unsafe(nil), String)
+
+Addressable::URI::CharacterClasses::PCHAR = T.let(T.unsafe(nil), String)
+
+Addressable::URI::CharacterClasses::QUERY = T.let(T.unsafe(nil), String)
+
+Addressable::URI::CharacterClasses::RESERVED = T.let(T.unsafe(nil), String)
+
+Addressable::URI::CharacterClasses::SCHEME = T.let(T.unsafe(nil), String)
+
+Addressable::URI::CharacterClasses::SUB_DELIMS = T.let(T.unsafe(nil), String)
+
+Addressable::URI::CharacterClasses::UNRESERVED = T.let(T.unsafe(nil), String)
+
+Addressable::URI::EMPTY_STR = T.let(T.unsafe(nil), String)
+
+class Addressable::URI::InvalidURIError < ::StandardError
+end
+
+Addressable::URI::NORMPATH = T.let(T.unsafe(nil), Regexp)
+
+Addressable::URI::PARENT = T.let(T.unsafe(nil), String)
+
+Addressable::URI::PORT_MAPPING = T.let(T.unsafe(nil), Hash)
+
+Addressable::URI::RULE_2A = T.let(T.unsafe(nil), Regexp)
+
+Addressable::URI::RULE_2B_2C = T.let(T.unsafe(nil), Regexp)
+
+Addressable::URI::RULE_2D = T.let(T.unsafe(nil), Regexp)
+
+Addressable::URI::RULE_PREFIXED_PARENT = T.let(T.unsafe(nil), Regexp)
+
+Addressable::URI::SELF_REF = T.let(T.unsafe(nil), String)
+
+Addressable::URI::SEQUENCE_ENCODING_TABLE = T.let(T.unsafe(nil), Hash)
+
+Addressable::URI::SEQUENCE_UPCASED_PERCENT_ENCODING_TABLE = T.let(T.unsafe(nil), Hash)
+
+Addressable::URI::SLASH = T.let(T.unsafe(nil), String)
+
+Addressable::URI::URIREGEX = T.let(T.unsafe(nil), Regexp)
+
+module Addressable::VERSION
+end
+
+Addressable::VERSION::MAJOR = T.let(T.unsafe(nil), Integer)
+
+Addressable::VERSION::MINOR = T.let(T.unsafe(nil), Integer)
+
+Addressable::VERSION::STRING = T.let(T.unsafe(nil), String)
+
+Addressable::VERSION::TINY = T.let(T.unsafe(nil), Integer) | true |
Other | Homebrew | brew | 64183fac5c5b751f773d0953cb65e9528a185961.json | Update RBI files for mechanize. | Library/Homebrew/sorbet/rbi/gems/mechanize@2.8.0.rbi | @@ -1,6 +1,6 @@
# DO NOT EDIT MANUALLY
# This is an autogenerated file for types exported from the `mechanize` gem.
-# Please instead update this file by running `tapioca sync`.
+# Please instead update this file by running `bin/tapioca sync`.
# typed: true
@@ -293,6 +293,7 @@ class Mechanize::FileResponse
def content_length; end
def each; end
def each_header; end
+ def file_path; end
def get_fields(key); end
def http_version; end
def message; end
@@ -699,6 +700,10 @@ class Mechanize::HTTP::Agent
def webrobots; end
end
+Mechanize::HTTP::Agent::CREDENTIAL_HEADERS = T.let(T.unsafe(nil), Array)
+
+Mechanize::HTTP::Agent::POST_HEADERS = T.let(T.unsafe(nil), Array)
+
Mechanize::HTTP::Agent::RobotsKey = T.let(T.unsafe(nil), Symbol)
class Mechanize::HTTP::AuthChallenge < ::Struct | true |
Other | Homebrew | brew | 64183fac5c5b751f773d0953cb65e9528a185961.json | Update RBI files for mechanize. | Library/Homebrew/sorbet/rbi/gems/mime-types-data@3.2021.0225.rbi | @@ -1,6 +1,6 @@
# DO NOT EDIT MANUALLY
# This is an autogenerated file for types exported from the `mime-types-data` gem.
-# Please instead update this file by running `tapioca sync`.
+# Please instead update this file by running `bin/tapioca sync`.
# typed: true
| true |
Other | Homebrew | brew | 64183fac5c5b751f773d0953cb65e9528a185961.json | Update RBI files for mechanize. | Library/Homebrew/sorbet/rbi/gems/public_suffix@4.0.6.rbi | @@ -0,0 +1,152 @@
+# DO NOT EDIT MANUALLY
+# This is an autogenerated file for types exported from the `public_suffix` gem.
+# Please instead update this file by running `bin/tapioca sync`.
+
+# typed: true
+
+module PublicSuffix
+ class << self
+ def decompose(name, rule); end
+ def domain(name, **options); end
+ def normalize(name); end
+ def parse(name, list: T.unsafe(nil), default_rule: T.unsafe(nil), ignore_private: T.unsafe(nil)); end
+ def valid?(name, list: T.unsafe(nil), default_rule: T.unsafe(nil), ignore_private: T.unsafe(nil)); end
+ end
+end
+
+PublicSuffix::BANG = T.let(T.unsafe(nil), String)
+
+PublicSuffix::DOT = T.let(T.unsafe(nil), String)
+
+class PublicSuffix::Domain
+ def initialize(*args); end
+
+ def domain; end
+ def domain?; end
+ def name; end
+ def sld; end
+ def subdomain; end
+ def subdomain?; end
+ def tld; end
+ def to_a; end
+ def to_s; end
+ def trd; end
+
+ class << self
+ def name_to_labels(name); end
+ end
+end
+
+class PublicSuffix::DomainInvalid < ::PublicSuffix::Error
+end
+
+class PublicSuffix::DomainNotAllowed < ::PublicSuffix::DomainInvalid
+end
+
+class PublicSuffix::Error < ::StandardError
+end
+
+class PublicSuffix::List
+ def initialize; end
+
+ def <<(rule); end
+ def ==(other); end
+ def add(rule); end
+ def clear; end
+ def default_rule; end
+ def each(&block); end
+ def empty?; end
+ def eql?(other); end
+ def find(name, default: T.unsafe(nil), **options); end
+ def size; end
+
+ protected
+
+ def rules; end
+
+ private
+
+ def entry_to_rule(entry, value); end
+ def rule_to_entry(rule); end
+ def select(name, ignore_private: T.unsafe(nil)); end
+
+ class << self
+ def default(**options); end
+ def default=(value); end
+ def parse(input, private_domains: T.unsafe(nil)); end
+ end
+end
+
+PublicSuffix::List::DEFAULT_LIST_PATH = T.let(T.unsafe(nil), String)
+
+module PublicSuffix::Rule
+ class << self
+ def default; end
+ def factory(content, private: T.unsafe(nil)); end
+ end
+end
+
+class PublicSuffix::Rule::Base
+ def initialize(value:, length: T.unsafe(nil), private: T.unsafe(nil)); end
+
+ def ==(other); end
+ def decompose(*_arg0); end
+ def eql?(other); end
+ def length; end
+ def match?(name); end
+ def parts; end
+ def private; end
+ def value; end
+
+ class << self
+ def build(content, private: T.unsafe(nil)); end
+ end
+end
+
+class PublicSuffix::Rule::Entry < ::Struct
+ def length; end
+ def length=(_); end
+ def private; end
+ def private=(_); end
+ def type; end
+ def type=(_); end
+
+ class << self
+ def [](*_arg0); end
+ def inspect; end
+ def members; end
+ def new(*_arg0); end
+ end
+end
+
+class PublicSuffix::Rule::Exception < ::PublicSuffix::Rule::Base
+ def decompose(domain); end
+ def parts; end
+ def rule; end
+
+ class << self
+ def build(content, private: T.unsafe(nil)); end
+ end
+end
+
+class PublicSuffix::Rule::Normal < ::PublicSuffix::Rule::Base
+ def decompose(domain); end
+ def parts; end
+ def rule; end
+end
+
+class PublicSuffix::Rule::Wildcard < ::PublicSuffix::Rule::Base
+ def initialize(value:, length: T.unsafe(nil), private: T.unsafe(nil)); end
+
+ def decompose(domain); end
+ def parts; end
+ def rule; end
+
+ class << self
+ def build(content, private: T.unsafe(nil)); end
+ end
+end
+
+PublicSuffix::STAR = T.let(T.unsafe(nil), String)
+
+PublicSuffix::VERSION = T.let(T.unsafe(nil), String) | true |
Other | Homebrew | brew | 64183fac5c5b751f773d0953cb65e9528a185961.json | Update RBI files for mechanize. | Library/Homebrew/sorbet/rbi/gems/rubyntlm@0.6.3.rbi | @@ -1,15 +1,14 @@
# DO NOT EDIT MANUALLY
-# This is an autogenerated file for types exported from the `ntlm-http` gem.
-# Please instead update this file by running `tapioca generate --exclude json`.
+# This is an autogenerated file for types exported from the `rubyntlm` gem.
+# Please instead update this file by running `bin/tapioca sync`.
# typed: true
module Net::NTLM
class << self
def apply_des(plain, keys); end
- def decode_utf16le(str); end
- def encode_utf16le(str); end
def gen_keys(str); end
+ def is_ntlm_hash?(data); end
def lm_hash(password); end
def lm_response(arg); end
def lmv2_response(arg, opt = T.unsafe(nil)); end
@@ -20,7 +19,6 @@ module Net::NTLM
def ntlmv2_response(arg, opt = T.unsafe(nil)); end
def pack_int64le(val); end
def split7(str); end
- def swap16(str); end
end
end
@@ -29,6 +27,7 @@ class Net::NTLM::Blob < ::Net::NTLM::FieldSet
def blob_signature=(val); end
def challenge; end
def challenge=(val); end
+ def parse(str, offset = T.unsafe(nil)); end
def reserved; end
def reserved=(val); end
def target_info; end
@@ -39,20 +38,104 @@ class Net::NTLM::Blob < ::Net::NTLM::FieldSet
def unknown1=(val); end
def unknown2; end
def unknown2=(val); end
+end
+
+class Net::NTLM::ChannelBinding
+ def initialize(outer_channel); end
+
+ def acceptor_address_length; end
+ def acceptor_addrtype; end
+ def application_data; end
+ def channel; end
+ def channel_binding_token; end
+ def channel_hash; end
+ def gss_channel_bindings_struct; end
+ def initiator_address_length; end
+ def initiator_addtype; end
+ def unique_prefix; end
+
+ class << self
+ def create(outer_channel); end
+ end
+end
+
+class Net::NTLM::Client
+ def initialize(username, password, opts = T.unsafe(nil)); end
+
+ def domain; end
+ def flags; end
+ def init_context(resp = T.unsafe(nil), channel_binding = T.unsafe(nil)); end
+ def password; end
+ def session; end
+ def session_key; end
+ def username; end
+ def workstation; end
+
+ private
+
+ def type1_message; end
+end
+
+class Net::NTLM::Client::Session
+ def initialize(client, challenge_message, channel_binding = T.unsafe(nil)); end
+
+ def authenticate!; end
+ def challenge_message; end
+ def channel_binding; end
+ def client; end
+ def exported_session_key; end
+ def seal_message(message); end
+ def sign_message(message); end
+ def unseal_message(emessage); end
+ def verify_signature(signature, message); end
+
+ private
+
+ def blob; end
+ def calculate_user_session_key!; end
+ def client_challenge; end
+ def client_cipher; end
+ def client_seal_key; end
+ def client_sign_key; end
+ def domain; end
+ def lmv2_resp; end
+ def negotiate_key_exchange?; end
+ def nt_proof_str; end
+ def ntlmv2_hash; end
+ def ntlmv2_resp; end
+ def oem_or_unicode_str(str); end
+ def password; end
+ def raw_sequence; end
+ def sequence; end
+ def server_challenge; end
+ def server_cipher; end
+ def server_seal_key; end
+ def server_sign_key; end
+ def target_info; end
+ def timestamp; end
+ def use_oem_strings?; end
+ def user_session_key; end
+ def username; end
+ def workstation; end
+end
+class Net::NTLM::EncodeUtil
class << self
- def inherited(subclass); end
+ def decode_utf16le(str); end
+ def encode_utf16le(str); end
end
end
class Net::NTLM::Field
def initialize(opts); end
def active; end
- def active=(_); end
+ def active=(_arg0); end
+ def parse(str, offset = T.unsafe(nil)); end
+ def serialize; end
def size; end
def value; end
- def value=(_); end
+ def value=(_arg0); end
end
class Net::NTLM::FieldSet
@@ -62,12 +145,12 @@ class Net::NTLM::FieldSet
def []=(name, val); end
def disable(name); end
def enable(name); end
+ def has_disabled_fields?; end
def parse(str, offset = T.unsafe(nil)); end
def serialize; end
def size; end
class << self
- def define(&block); end
def int16LE(name, opts); end
def int32LE(name, opts); end
def int64LE(name, opts); end
@@ -106,23 +189,27 @@ class Net::NTLM::Int64LE < ::Net::NTLM::Field
def serialize; end
end
+class Net::NTLM::InvalidTargetDataError < ::Net::NTLM::NtlmError
+ def initialize(msg, data); end
+
+ def data; end
+end
+
class Net::NTLM::Message < ::Net::NTLM::FieldSet
+ def data_edge; end
def data_size; end
def decode64(str); end
+ def deflag; end
def dump_flags; end
def encode64; end
def has_flag?(flag); end
def head_size; end
+ def parse(str); end
+ def security_buffers; end
def serialize; end
def set_flag(flag); end
def size; end
- private
-
- def data_edge; end
- def deflag; end
- def security_buffers; end
-
class << self
def decode64(str); end
def parse(str); end
@@ -134,31 +221,21 @@ class Net::NTLM::Message::Type0 < ::Net::NTLM::Message
def sign=(val); end
def type; end
def type=(val); end
-
- class << self
- def inherited(subclass); end
- end
end
class Net::NTLM::Message::Type1 < ::Net::NTLM::Message
def domain; end
def domain=(val); end
def flag; end
def flag=(val); end
- def padding; end
- def padding=(val); end
- def parse(str); end
+ def os_version; end
+ def os_version=(val); end
def sign; end
def sign=(val); end
def type; end
def type=(val); end
def workstation; end
def workstation=(val); end
-
- class << self
- def inherited(subclass); end
- def parse(str); end
- end
end
class Net::NTLM::Message::Type2 < ::Net::NTLM::Message
@@ -168,9 +245,8 @@ class Net::NTLM::Message::Type2 < ::Net::NTLM::Message
def context=(val); end
def flag; end
def flag=(val); end
- def padding; end
- def padding=(val); end
- def parse(str); end
+ def os_version; end
+ def os_version=(val); end
def response(arg, opt = T.unsafe(nil)); end
def sign; end
def sign=(val); end
@@ -180,14 +256,10 @@ class Net::NTLM::Message::Type2 < ::Net::NTLM::Message
def target_name=(val); end
def type; end
def type=(val); end
-
- class << self
- def inherited(subclass); end
- def parse(str); end
- end
end
class Net::NTLM::Message::Type3 < ::Net::NTLM::Message
+ def blank_password?(server_challenge); end
def domain; end
def domain=(val); end
def flag; end
@@ -196,6 +268,10 @@ class Net::NTLM::Message::Type3 < ::Net::NTLM::Message
def lm_response=(val); end
def ntlm_response; end
def ntlm_response=(val); end
+ def ntlm_version; end
+ def os_version; end
+ def os_version=(val); end
+ def password?(password, server_challenge); end
def session_key; end
def session_key=(val); end
def sign; end
@@ -207,18 +283,21 @@ class Net::NTLM::Message::Type3 < ::Net::NTLM::Message
def workstation; end
def workstation=(val); end
+ private
+
+ def ntlm2_session_password?(password, server_challenge); end
+ def ntlmv2_password?(password, server_challenge); end
+
class << self
def create(arg, opt = T.unsafe(nil)); end
- def inherited(subclass); end
- def parse(str); end
end
end
class Net::NTLM::SecurityBuffer < ::Net::NTLM::FieldSet
- def initialize(opts); end
+ def initialize(opts = T.unsafe(nil)); end
def active; end
- def active=(_); end
+ def active=(_arg0); end
def allocated; end
def allocated=(val); end
def data_size; end
@@ -230,10 +309,6 @@ class Net::NTLM::SecurityBuffer < ::Net::NTLM::FieldSet
def serialize; end
def value; end
def value=(val); end
-
- class << self
- def inherited(subclass); end
- end
end
class Net::NTLM::String < ::Net::NTLM::Field
@@ -244,13 +319,14 @@ class Net::NTLM::String < ::Net::NTLM::Field
def value=(val); end
end
-module Net::NTLM::VERSION
-end
-
-Net::NTLM::VERSION::MAJOR = T.let(T.unsafe(nil), Integer)
+class Net::NTLM::TargetInfo
+ def initialize(av_pair_sequence); end
-Net::NTLM::VERSION::MINOR = T.let(T.unsafe(nil), Integer)
+ def av_pairs; end
+ def to_s; end
-Net::NTLM::VERSION::STRING = T.let(T.unsafe(nil), String)
+ private
-Net::NTLM::VERSION::TINY = T.let(T.unsafe(nil), Integer)
+ def read_pairs(av_pair_sequence); end
+ def to_hex(str); end
+end | true |
Other | Homebrew | brew | 64183fac5c5b751f773d0953cb65e9528a185961.json | Update RBI files for mechanize. | Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi | @@ -2685,6 +2685,104 @@ module ActiveSupport
def self.version(); end
end
+class Addressable::Template
+ def ==(template); end
+
+ def eql?(template); end
+
+ def expand(mapping, processor=T.unsafe(nil), normalize_values=T.unsafe(nil)); end
+
+ def extract(uri, processor=T.unsafe(nil)); end
+
+ def generate(params=T.unsafe(nil), recall=T.unsafe(nil), options=T.unsafe(nil)); end
+
+ def initialize(pattern); end
+
+ def keys(); end
+
+ def match(uri, processor=T.unsafe(nil)); end
+
+ def named_captures(); end
+
+ def names(); end
+
+ def partial_expand(mapping, processor=T.unsafe(nil), normalize_values=T.unsafe(nil)); end
+
+ def pattern(); end
+
+ def source(); end
+
+ def to_regexp(); end
+
+ def variable_defaults(); end
+
+ def variables(); end
+ EXPRESSION = ::T.let(nil, ::T.untyped)
+ JOINERS = ::T.let(nil, ::T.untyped)
+ LEADERS = ::T.let(nil, ::T.untyped)
+ RESERVED = ::T.let(nil, ::T.untyped)
+ UNRESERVED = ::T.let(nil, ::T.untyped)
+ VARIABLE_LIST = ::T.let(nil, ::T.untyped)
+ VARNAME = ::T.let(nil, ::T.untyped)
+ VARSPEC = ::T.let(nil, ::T.untyped)
+end
+
+class Addressable::Template::InvalidTemplateOperatorError
+end
+
+class Addressable::Template::InvalidTemplateOperatorError
+end
+
+class Addressable::Template::InvalidTemplateValueError
+end
+
+class Addressable::Template::InvalidTemplateValueError
+end
+
+class Addressable::Template::MatchData
+ def [](key, len=T.unsafe(nil)); end
+
+ def captures(); end
+
+ def initialize(uri, template, mapping); end
+
+ def keys(); end
+
+ def mapping(); end
+
+ def names(); end
+
+ def post_match(); end
+
+ def pre_match(); end
+
+ def string(); end
+
+ def template(); end
+
+ def to_a(); end
+
+ def uri(); end
+
+ def values(); end
+
+ def values_at(*indexes); end
+
+ def variables(); end
+end
+
+class Addressable::Template::MatchData
+end
+
+class Addressable::Template::TemplateOperatorAbortedError
+end
+
+class Addressable::Template::TemplateOperatorAbortedError
+end
+
+class Addressable::Template
+end
+
class Addrinfo
def connect_internal(local_addrinfo, timeout=T.unsafe(nil)); end
end
@@ -9630,12 +9728,6 @@ JSON::State = JSON::Ext::Generator::State
JSON::UnparserError = JSON::GeneratorError
-module Kconv
- AUTO = ::T.let(nil, ::T.untyped)
- NOCONV = ::T.let(nil, ::T.untyped)
- UNKNOWN = ::T.let(nil, ::T.untyped)
-end
-
class Keg::ConflictError
extend ::T::Private::Methods::MethodHooks
extend ::T::Private::Methods::SingletonMethodHooks
@@ -12349,13 +12441,9 @@ end
Net::HTTPFatalErrorCode = Net::HTTPClientError
-class Net::HTTPInformation
-end
-
-Net::HTTPInformationCode::EXCEPTION_TYPE = Net::HTTPError
+Net::HTTPInformation::EXCEPTION_TYPE = Net::HTTPError
-class Net::HTTPInformation
-end
+Net::HTTPInformationCode = Net::HTTPInformation
class Net::HTTPLoopDetected
HAS_BODY = ::T.let(nil, ::T.untyped)
@@ -12419,13 +12507,9 @@ Net::HTTPServerErrorCode = Net::HTTPServerError
Net::HTTPSession = Net::HTTP
-class Net::HTTPSuccess
-end
-
-Net::HTTPSuccessCode::EXCEPTION_TYPE = Net::HTTPError
+Net::HTTPSuccess::EXCEPTION_TYPE = Net::HTTPError
-class Net::HTTPSuccess
-end
+Net::HTTPSuccessCode = Net::HTTPSuccess
class Net::HTTPURITooLong
HAS_BODY = ::T.let(nil, ::T.untyped)
@@ -29167,18 +29251,8 @@ class String
def indent!(amount, indent_string=T.unsafe(nil), indent_empty_lines=T.unsafe(nil)); end
- def iseuc(); end
-
- def isjis(); end
-
- def issjis(); end
-
- def isutf8(); end
-
def italic(); end
- def kconv(to_enc, from_enc=T.unsafe(nil)); end
-
def light_black(); end
def light_blue(); end
@@ -29259,20 +29333,6 @@ class String
def to_time(form=T.unsafe(nil)); end
- def toeuc(); end
-
- def tojis(); end
-
- def tolocale(); end
-
- def tosjis(); end
-
- def toutf16(); end
-
- def toutf32(); end
-
- def toutf8(); end
-
def truncate(truncate_at, options=T.unsafe(nil)); end
def truncate_bytes(truncate_at, omission: T.unsafe(nil)); end
@@ -29673,6 +29733,21 @@ module URI
def self.get_encoding(label); end
end
+module URL::BlockDSL::PageWithURL
+ extend ::T::Private::Methods::MethodHooks
+ extend ::T::Private::Methods::SingletonMethodHooks
+end
+
+class URL::BlockDSL
+ extend ::T::Private::Methods::MethodHooks
+ extend ::T::Private::Methods::SingletonMethodHooks
+end
+
+class URL::DSL
+ extend ::T::Private::Methods::MethodHooks
+ extend ::T::Private::Methods::SingletonMethodHooks
+end
+
class URL
extend ::T::Private::Methods::MethodHooks
extend ::T::Private::Methods::SingletonMethodHooks | true |
Other | Homebrew | brew | abe7cd3edfe34877602a7a13432fe0e08f057f44.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 | @@ -29673,6 +29673,21 @@ module URI
def self.get_encoding(label); end
end
+module URL::BlockDSL::PageWithURL
+ extend ::T::Private::Methods::MethodHooks
+ extend ::T::Private::Methods::SingletonMethodHooks
+end
+
+class URL::BlockDSL
+ extend ::T::Private::Methods::MethodHooks
+ extend ::T::Private::Methods::SingletonMethodHooks
+end
+
+class URL::DSL
+ extend ::T::Private::Methods::MethodHooks
+ extend ::T::Private::Methods::SingletonMethodHooks
+end
+
class URL
extend ::T::Private::Methods::MethodHooks
extend ::T::Private::Methods::SingletonMethodHooks | false |
Other | Homebrew | brew | 8aa0939c531c2c035acdea74f76eafff3dfeda62.json | workflows/{sorbet,spdx}: use origin_branch with git-try-push | .github/workflows/sorbet.yml | @@ -41,7 +41,7 @@ jobs:
if git ls-remote --exit-code --heads origin "$BRANCH"; then
git checkout "$BRANCH"
- git reset origin/master
+ git reset --hard origin/master
else
git checkout -B "$BRANCH" origin/master
BRANCH_EXISTS="1"
@@ -64,6 +64,7 @@ jobs:
token: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }}
branch: ${{ steps.update.outputs.branch }}
force: true
+ origin_branch: "master"
- name: Open a pull request
if: steps.update.outputs.pull_request == 'true' | true |
Other | Homebrew | brew | 8aa0939c531c2c035acdea74f76eafff3dfeda62.json | workflows/{sorbet,spdx}: use origin_branch with git-try-push | .github/workflows/spdx.yml | @@ -40,7 +40,7 @@ jobs:
if git ls-remote --exit-code --heads origin "$BRANCH"; then
git checkout "$BRANCH"
- git reset origin/master
+ git reset --hard origin/master
else
git checkout -B "$BRANCH" origin/master
BRANCH_EXISTS="1"
@@ -62,6 +62,7 @@ jobs:
token: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }}
branch: ${{ steps.update.outputs.branch }}
force: true
+ origin_branch: "master"
- name: Open a pull request
if: steps.update.outputs.pull_request == 'true' | true |
Other | Homebrew | brew | c2c93d1cc9e436db0e0ff18c39e017d7ba5abf57.json | Run `shellcheck` on cask utils and shim scripts. | Library/Homebrew/shims/linux/super/make | @@ -7,7 +7,7 @@ pathremove() {
NEWPATH=${NEWPATH:+$NEWPATH:}$DIR
fi
done
- export $PATHVARIABLE="$NEWPATH"
+ export "$PATHVARIABLE"="$NEWPATH"
}
if [[ -n "$HOMEBREW_MAKE" && "$HOMEBREW_MAKE" != "make" ]]
@@ -16,7 +16,8 @@ then
else
SAVED_PATH="$PATH"
pathremove "$HOMEBREW_LIBRARY/Homebrew/shims/linux/super"
- export MAKE="$(which make)"
+ MAKE="$(which make)"
+ export MAKE
export PATH="$SAVED_PATH"
fi
| true |
Other | Homebrew | brew | c2c93d1cc9e436db0e0ff18c39e017d7ba5abf57.json | Run `shellcheck` on cask utils and shim scripts. | Library/Homebrew/shims/mac/super/ruby | @@ -1,6 +1,9 @@
#!/bin/bash
+
# System Ruby's mkmf on Mojave (10.14) and later require SDKROOT set to work correctly.
+# Don't need shellcheck to follow the `source`.
+# shellcheck disable=SC1090
source "$HOMEBREW_LIBRARY/Homebrew/shims/utils.sh"
try_exec_non_system "$SHIM_FILE" "$@" | true |
Other | Homebrew | brew | c2c93d1cc9e436db0e0ff18c39e017d7ba5abf57.json | Run `shellcheck` on cask utils and shim scripts. | Library/Homebrew/shims/mac/super/xcrun | @@ -1,4 +1,5 @@
#!/bin/bash
+
# Historically, xcrun has had various bugs, and in some cases it didn't
# work at all (e.g. CLT-only in the Xcode 4.3 era). This script emulates
# it and attempts to avoid these issues.
@@ -27,18 +28,18 @@ arg0=$1
shift
exe="/usr/bin/${arg0}"
-if [ -x "$exe" ]; then
- if [ -n "$HOMEBREW_PREFER_CLT_PROXIES" ]; then
+if [[ -x "$exe" ]]; then
+ if [[ -n "$HOMEBREW_PREFER_CLT_PROXIES" ]]; then
exec "$exe" "$@"
- elif [ -z "$HOMEBREW_SDKROOT" -o ! -d "$HOMEBREW_SDKROOT" ]; then
+ elif [[ -z "$HOMEBREW_SDKROOT" || ! -d "$HOMEBREW_SDKROOT" ]]; then
exec "$exe" "$@"
fi
fi
SUPERBIN=$(cd "${0%/*}" && pwd -P)
exe=$(/usr/bin/xcrun --find "$arg0" 2>/dev/null)
-if [ -x "$exe" -a "${exe%/*}" != "$SUPERBIN" ]; then
+if [[ -x "$exe" && "${exe%/*}" != "$SUPERBIN" ]]; then
exec "$exe" "$@"
fi
@@ -57,7 +58,7 @@ done
IFS=$old_IFS
echo >&2 "
-Failed to execute $arg0 $@
+Failed to execute ${arg0} ${*}
Xcode and/or the CLT appear to be misconfigured. Try one or both of the following:
xcodebuild -license | true |
Other | Homebrew | brew | c2c93d1cc9e436db0e0ff18c39e017d7ba5abf57.json | Run `shellcheck` on cask utils and shim scripts. | Library/Homebrew/shims/scm/git | @@ -9,6 +9,8 @@ then
exit 1
fi
+# Don't need shellcheck to follow the `source`.
+# shellcheck disable=SC1090
source "$HOMEBREW_LIBRARY/Homebrew/shims/utils.sh"
case "$(lowercase "$SHIM_FILE")" in | true |
Other | Homebrew | brew | c2c93d1cc9e436db0e0ff18c39e017d7ba5abf57.json | Run `shellcheck` on cask utils and shim scripts. | Library/Homebrew/shims/utils.sh | @@ -60,8 +60,10 @@ safe_exec() {
fi
if [[ "$HOMEBREW" = "print-path" ]]
then
- local dir="$(quiet_safe_cd "${arg0%/*}/" && pwd)"
- local path="$(dirbasepath "$dir" "$arg0")"
+ local dir
+ dir="$(quiet_safe_cd "${arg0%/*}/" && pwd)"
+ local path
+ path="$(dirbasepath "$dir" "$arg0")"
echo "$path"
exit
fi | true |
Other | Homebrew | brew | c2c93d1cc9e436db0e0ff18c39e017d7ba5abf57.json | Run `shellcheck` on cask utils and shim scripts. | Library/Homebrew/style.rb | @@ -177,13 +177,16 @@ def run_shellcheck(files, output_type)
files = [
HOMEBREW_BREW_FILE,
# TODO: HOMEBREW_REPOSITORY/"completions/bash/brew",
- *Pathname.glob("#{HOMEBREW_LIBRARY}/Homebrew/*.sh"),
- *Pathname.glob("#{HOMEBREW_LIBRARY}/Homebrew/cmd/*.sh"),
- *Pathname.glob("#{HOMEBREW_LIBRARY}/Homebrew/utils/*.sh"),
+ *HOMEBREW_LIBRARY.glob("Homebrew/*.sh"),
+ *HOMEBREW_LIBRARY.glob("Homebrew/shims/**/*").map(&:realpath).uniq
+ .reject { |path| path.directory? || path.basename.to_s == "cc" },
+ *HOMEBREW_LIBRARY.glob("Homebrew/{dev-,}cmd/*.sh"),
+ *HOMEBREW_LIBRARY.glob("Homebrew/{cask/,}utils/*.sh"),
]
end
- args = ["--shell=bash", "--", *files] # TODO: Add `--enable=all` to check for more problems.
+ # TODO: Add `--enable=all` to check for more problems.
+ args = ["--shell=bash", "--external-sources", "--", *files]
case output_type
when :print | true |
Other | Homebrew | brew | 5aa0dbe1f96f0528e3a9662fb1a5dbe29ddf56ca.json | Move `RMDIR_SH` into separate file. | Library/Homebrew/cask/pkg.rb | @@ -107,54 +107,14 @@ def special?(path)
# Helper script to delete empty directories after deleting `.DS_Store` files and broken symlinks.
# Needed in order to execute all file operations with `sudo`.
- RMDIR_SH = <<~'BASH'
- set -euo pipefail
-
- # Try removing as many empty directories as possible with a single
- # `rmdir` call to avoid or at least speed up the loop below.
- if /bin/rmdir -- "${@}" &>/dev/null; then
- exit
- fi
-
- for path in "${@}"; do
- symlink=true
- [[ -L "${path}" ]] || symlink=false
-
- directory=false
- if [[ -d "${path}" ]]; then
- directory=true
-
- if [[ -e "${path}/.DS_Store" ]]; then
- /bin/rm -- "${path}/.DS_Store"
- fi
-
- # Some packages leave broken symlinks around; we clean them out before
- # attempting to `rmdir` to prevent extra cruft from accumulating.
- /usr/bin/find -f "${path}" -- -mindepth 1 -maxdepth 1 -type l ! -exec /bin/test -e {} \; -delete
- elif ! ${symlink} && [[ ! -e "${path}" ]]; then
- # Skip paths that don't exists and aren't a broken symlink.
- continue
- fi
-
- if ${symlink}; then
- # Delete directory symlink.
- /bin/rm -- "${path}"
- elif ${directory}; then
- # Delete directory if empty.
- /usr/bin/find -f "${path}" -- -maxdepth 0 -type d -empty -exec /bin/rmdir -- {} \;
- else
- # Try `rmdir` anyways to show a proper error.
- /bin/rmdir -- "${path}"
- fi
- done
- BASH
+ RMDIR_SH = (HOMEBREW_LIBRARY_PATH/"cask/utils/rmdir.sh").freeze
private_constant :RMDIR_SH
sig { params(path: T.any(Pathname, T::Array[Pathname])).void }
def rmdir(path)
@command.run!(
"/usr/bin/xargs",
- args: ["-0", "--", "/bin/bash", "-c", RMDIR_SH, "--"],
+ args: ["-0", "--", RMDIR_SH.to_s],
input: Array(path).join("\0"),
sudo: true,
) | true |
Other | Homebrew | brew | 5aa0dbe1f96f0528e3a9662fb1a5dbe29ddf56ca.json | Move `RMDIR_SH` into separate file. | Library/Homebrew/cask/utils/rmdir.sh | @@ -0,0 +1,41 @@
+#!/bin/bash
+
+set -euo pipefail
+
+# Try removing as many empty directories as possible with a single
+# `rmdir` call to avoid or at least speed up the loop below.
+if /bin/rmdir -- "${@}" &>/dev/null; then
+ exit
+fi
+
+for path in "${@}"; do
+ symlink=true
+ [[ -L "${path}" ]] || symlink=false
+
+ directory=false
+ if [[ -d "${path}" ]]; then
+ directory=true
+
+ if [[ -e "${path}/.DS_Store" ]]; then
+ /bin/rm -- "${path}/.DS_Store"
+ fi
+
+ # Some packages leave broken symlinks around; we clean them out before
+ # attempting to `rmdir` to prevent extra cruft from accumulating.
+ /usr/bin/find -f "${path}" -- -mindepth 1 -maxdepth 1 -type l ! -exec /bin/test -e {} \; -delete
+ elif ! ${symlink} && [[ ! -e "${path}" ]]; then
+ # Skip paths that don't exists and aren't a broken symlink.
+ continue
+ fi
+
+ if ${symlink}; then
+ # Delete directory symlink.
+ /bin/rm -- "${path}"
+ elif ${directory}; then
+ # Delete directory if empty.
+ /usr/bin/find -f "${path}" -- -maxdepth 0 -type d -empty -exec /bin/rmdir -- {} \;
+ else
+ # Try `rmdir` anyways to show a proper error.
+ /bin/rmdir -- "${path}"
+ fi
+done | true |
Other | Homebrew | brew | 5aa0dbe1f96f0528e3a9662fb1a5dbe29ddf56ca.json | Move `RMDIR_SH` into separate file. | Library/Homebrew/test/cask/pkg_spec.rb | @@ -97,7 +97,7 @@
allow(fake_system_command).to receive(:run!).and_call_original
expect(fake_system_command).to receive(:run!).with(
"/usr/bin/xargs",
- args: ["-0", "--", "/bin/bash", "-c", a_string_including("/bin/rmdir"), "--"],
+ args: ["-0", "--", a_string_including("rmdir")],
input: [fake_dir].join("\0"),
sudo: true,
).and_return(instance_double(SystemCommand::Result, stdout: "")) | true |
Other | Homebrew | brew | ffba81f6770769adf139df65bb1985bfdf2e3352.json | Adjust `audit` spec. | Library/Homebrew/test/cask/audit_spec.rb | @@ -795,7 +795,17 @@ def tmp_cask(name, text)
end
end
- context "when doing the audit" do
+ context "when doing an offline audit" do
+ let(:online) { false }
+
+ it "does not evaluate the block" do
+ expect(run).not_to pass
+ end
+ end
+
+ context "when doing and online audit" do
+ let(:online) { true }
+
it "evaluates the block" do
expect(run).to fail_with(/Boom/)
end | false |
Other | Homebrew | brew | 59dae75709bb27c704ec7834779aa8c0f045d5b2.json | Allow specifying committer for some `dev-cmd`s | Library/Homebrew/dev-cmd/bottle.rb | @@ -73,6 +73,8 @@ def bottle_args
switch "--only-json-tab",
depends_on: "--json",
description: "When passed with `--json`, the tab will be written to the JSON file but not the bottle."
+ flag "--committer=",
+ description: "Specify a committer name and email in `git`'s standard author format."
flag "--root-url=",
description: "Use the specified <URL> as the root of the bottle's URL instead of Homebrew's default."
@@ -619,9 +621,15 @@ def merge(args:)
path.atomic_write(formula_ast.process)
unless args.no_commit?
- Utils::Git.set_name_email!
+ Utils::Git.set_name_email!(committer: args.committer.blank?)
Utils::Git.setup_gpg!
+ if (committer = args.committer)
+ committer = Utils.parse_author!(committer)
+ ENV["GIT_COMMITTER_NAME"] = committer[:name]
+ ENV["GIT_COMMITTER_EMAIL"] = committer[:email]
+ end
+
short_name = formula_name.split("/", -1).last
pkg_version = bottle_hash["formula"]["pkg_version"]
| true |
Other | Homebrew | brew | 59dae75709bb27c704ec7834779aa8c0f045d5b2.json | Allow specifying committer for some `dev-cmd`s | Library/Homebrew/dev-cmd/pr-pull.rb | @@ -44,6 +44,8 @@ def pr_pull_args
switch "--warn-on-upload-failure",
description: "Warn instead of raising an error if the bottle upload fails. "\
"Useful for repairing bottle uploads that previously failed."
+ flag "--committer=",
+ description: "Specify a committer name and email in `git`'s standard author format."
flag "--message=",
depends_on: "--autosquash",
description: "Message to include when autosquashing revision bumps, deletions, and rebuilds."
@@ -365,9 +367,15 @@ def pr_pull
mirror_repo = args.bintray_mirror || "mirror"
tap = Tap.fetch(args.tap || CoreTap.instance.name)
- Utils::Git.set_name_email!
+ Utils::Git.set_name_email!(committer: args.committer.blank?)
Utils::Git.setup_gpg!
+ if (committer = args.committer)
+ committer = Utils.parse_author!(committer)
+ ENV["GIT_COMMITTER_NAME"] = committer[:name]
+ ENV["GIT_COMMITTER_EMAIL"] = committer[:email]
+ end
+
args.named.uniq.each do |arg|
arg = "#{tap.default_remote}/pull/#{arg}" if arg.to_i.positive?
url_match = arg.match HOMEBREW_PULL_OR_COMMIT_URL_REGEX | true |
Other | Homebrew | brew | 59dae75709bb27c704ec7834779aa8c0f045d5b2.json | Allow specifying committer for some `dev-cmd`s | Library/Homebrew/dev-cmd/pr-upload.rb | @@ -30,6 +30,8 @@ def pr_upload_args
switch "--warn-on-upload-failure",
description: "Warn instead of raising an error if the bottle upload fails. "\
"Useful for repairing bottle uploads that previously failed."
+ flag "--committer=",
+ description: "Specify a committer name and email in `git`'s standard author format."
flag "--archive-item=",
description: "Upload to the specified Internet Archive item (default: `homebrew`)."
flag "--bintray-org=",
@@ -103,6 +105,7 @@ def pr_upload
bottle_args << "--debug" if args.debug?
bottle_args << "--keep-old" if args.keep_old?
bottle_args << "--root-url=#{args.root_url}" if args.root_url
+ bottle_args << "--committer='#{args.committer}'" if args.committer
bottle_args << "--no-commit" if args.no_commit?
bottle_args += json_files
| true |
Other | Homebrew | brew | 59dae75709bb27c704ec7834779aa8c0f045d5b2.json | Allow specifying committer for some `dev-cmd`s | Library/Homebrew/test/utils_spec.rb | @@ -210,6 +210,19 @@ def esc(code)
end
end
+ specify "#parse_author!" do
+ parse_error_msg = /Unable to parse name and email/
+
+ expect(parse_author!("John Doe <john.doe@example.com>"))
+ .to eq({ name: "John Doe", email: "john.doe@example.com" })
+ expect { parse_author!("") }
+ .to raise_error(parse_error_msg)
+ expect { parse_author!("John Doe") }
+ .to raise_error(parse_error_msg)
+ expect { parse_author!("<john.doe@example.com>") }
+ .to raise_error(parse_error_msg)
+ end
+
specify "#disk_usage_readable" do
expect(disk_usage_readable(1)).to eq("1B")
expect(disk_usage_readable(1000)).to eq("1000B") | true |
Other | Homebrew | brew | 59dae75709bb27c704ec7834779aa8c0f045d5b2.json | Allow specifying committer for some `dev-cmd`s | Library/Homebrew/utils.rb | @@ -467,6 +467,13 @@ def paths
end.uniq.compact
end
+ def parse_author!(author)
+ /^(?<name>[^<]+?)[ \t]*<(?<email>[^>]+?)>$/ =~ author
+ raise "Unable to parse name and email." if name.blank? && email.blank?
+
+ { name: name, email: email }
+ end
+
def disk_usage_readable(size_in_bytes)
if size_in_bytes >= 1_073_741_824
size = size_in_bytes.to_f / 1_073_741_824 | true |
Other | Homebrew | brew | bba27eefec8a5bddd8ab123befa087670f128462.json | Use double quotes | Library/Homebrew/Gemfile | @@ -18,7 +18,7 @@ gem "rspec-wait", require: false
gem "rubocop", require: false
gem "rubocop-ast", require: false
gem "simplecov", require: false
-gem 'simplecov-cobertura', require: false
+gem "simplecov-cobertura", require: false
gem "sorbet", require: false
gem "sorbet-runtime", require: false
gem "tapioca", require: false | true |
Other | Homebrew | brew | bba27eefec8a5bddd8ab123befa087670f128462.json | Use double quotes | Library/Homebrew/test/spec_helper.rb | @@ -3,7 +3,7 @@
if ENV["HOMEBREW_TESTS_COVERAGE"]
require "simplecov"
- require 'simplecov-cobertura'
+ require "simplecov-cobertura"
formatters = [
SimpleCov::Formatter::HTMLFormatter, | true |
Other | Homebrew | brew | c07205caf2146dfd3d496a4b887befb83ae04455.json | Adjust `audit` spec. | Library/Homebrew/test/cask/audit_spec.rb | @@ -795,7 +795,17 @@ def tmp_cask(name, text)
end
end
- context "when doing the audit" do
+ context "when doing an offline audit" do
+ let(:online) { false }
+
+ it "does not evaluate the block" do
+ expect(run).not_to pass
+ end
+ end
+
+ context "when doing and online audit" do
+ let(:online) { true }
+
it "evaluates the block" do
expect(run).to fail_with(/Boom/)
end | false |
Other | Homebrew | brew | 0db0db95169a9d8437c8b058d9b82be40f1766b3.json | build_system_info: Use the host glibc version only
Use the host glibc version only to avoid errors with
brew tests --no-compat | Library/Homebrew/extend/os/linux/development_tools.rb | @@ -21,13 +21,7 @@ def default_compiler
end
def build_system_info
- brewed_glibc_version = begin
- Formula["glibc"].any_installed_version
- rescue FormulaUnavailableError
- nil
- end
- glibc_version = brewed_glibc_version || OS::Linux::Glibc.system_version
- generic_build_system_info.merge "glibc_version" => glibc_version
+ generic_build_system_info.merge "glibc_version" => OS::Linux::Glibc.system_version
end
end
end | false |
Other | Homebrew | brew | 11bfba17628b57446283b12f37eaa6de622e0f94.json | build_info: Add glibc_version for Linux | Library/Homebrew/extend/os/linux/development_tools.rb | @@ -19,5 +19,15 @@ def locate(tool)
def default_compiler
:gcc
end
+
+ def build_system_info
+ brewed_glibc_version = begin
+ Formula["glibc"].any_installed_version
+ rescue FormulaUnavailableError
+ nil
+ end
+ glibc_version = brewed_glibc_version || OS::Linux::Glibc.system_version
+ generic_build_system_info.merge "glibc_version" => glibc_version
+ end
end
end | false |
Other | Homebrew | brew | 53a7065bccfb1cec9286b32e7443c95a2423b62a.json | Allow specifying committer for some `dev-cmd`s | Library/Homebrew/dev-cmd/bottle.rb | @@ -73,6 +73,8 @@ def bottle_args
switch "--only-json-tab",
depends_on: "--json",
description: "When passed with `--json`, the tab will be written to the JSON file but not the bottle."
+ flag "--committer=",
+ description: "Specify a committer name and email in `git`'s standard author format."
flag "--root-url=",
description: "Use the specified <URL> as the root of the bottle's URL instead of Homebrew's default."
@@ -619,9 +621,15 @@ def merge(args:)
path.atomic_write(formula_ast.process)
unless args.no_commit?
- Utils::Git.set_name_email!
+ Utils::Git.set_name_email!(committer: args.committer.blank?)
Utils::Git.setup_gpg!
+ if (committer = args.committer)
+ committer = Utils.parse_author!(committer)
+ ENV["GIT_COMMITTER_NAME"] = committer[:name]
+ ENV["GIT_COMMITTER_EMAIL"] = committer[:email]
+ end
+
short_name = formula_name.split("/", -1).last
pkg_version = bottle_hash["formula"]["pkg_version"]
| true |
Other | Homebrew | brew | 53a7065bccfb1cec9286b32e7443c95a2423b62a.json | Allow specifying committer for some `dev-cmd`s | Library/Homebrew/dev-cmd/pr-pull.rb | @@ -44,6 +44,8 @@ def pr_pull_args
switch "--warn-on-upload-failure",
description: "Warn instead of raising an error if the bottle upload fails. "\
"Useful for repairing bottle uploads that previously failed."
+ flag "--committer=",
+ description: "Specify a committer name and email in `git`'s standard author format."
flag "--message=",
depends_on: "--autosquash",
description: "Message to include when autosquashing revision bumps, deletions, and rebuilds."
@@ -365,9 +367,15 @@ def pr_pull
mirror_repo = args.bintray_mirror || "mirror"
tap = Tap.fetch(args.tap || CoreTap.instance.name)
- Utils::Git.set_name_email!
+ Utils::Git.set_name_email!(committer: args.committer.blank?)
Utils::Git.setup_gpg!
+ if (committer = args.committer)
+ committer = Utils.parse_author!(committer)
+ ENV["GIT_COMMITTER_NAME"] = committer[:name]
+ ENV["GIT_COMMITTER_EMAIL"] = committer[:email]
+ end
+
args.named.uniq.each do |arg|
arg = "#{tap.default_remote}/pull/#{arg}" if arg.to_i.positive?
url_match = arg.match HOMEBREW_PULL_OR_COMMIT_URL_REGEX | true |
Other | Homebrew | brew | 53a7065bccfb1cec9286b32e7443c95a2423b62a.json | Allow specifying committer for some `dev-cmd`s | Library/Homebrew/dev-cmd/pr-upload.rb | @@ -30,6 +30,8 @@ def pr_upload_args
switch "--warn-on-upload-failure",
description: "Warn instead of raising an error if the bottle upload fails. "\
"Useful for repairing bottle uploads that previously failed."
+ flag "--committer=",
+ description: "Specify a committer name and email in `git`'s standard author format."
flag "--archive-item=",
description: "Upload to the specified Internet Archive item (default: `homebrew`)."
flag "--bintray-org=",
@@ -103,6 +105,7 @@ def pr_upload
bottle_args << "--debug" if args.debug?
bottle_args << "--keep-old" if args.keep_old?
bottle_args << "--root-url=#{args.root_url}" if args.root_url
+ bottle_args << "--committer='#{args.committer}'" if args.committer
bottle_args << "--no-commit" if args.no_commit?
bottle_args += json_files
| true |
Other | Homebrew | brew | 53a7065bccfb1cec9286b32e7443c95a2423b62a.json | Allow specifying committer for some `dev-cmd`s | Library/Homebrew/test/utils_spec.rb | @@ -210,6 +210,19 @@ def esc(code)
end
end
+ specify "#parse_author!" do
+ parse_error_msg = /Unable to parse name and email/
+
+ expect(parse_author!("John Doe <john.doe@example.com>"))
+ .to eq({ name: "John Doe", email: "john.doe@example.com" })
+ expect { parse_author!("") }
+ .to raise_error(parse_error_msg)
+ expect { parse_author!("John Doe") }
+ .to raise_error(parse_error_msg)
+ expect { parse_author!("<john.doe@example.com>") }
+ .to raise_error(parse_error_msg)
+ end
+
specify "#disk_usage_readable" do
expect(disk_usage_readable(1)).to eq("1B")
expect(disk_usage_readable(1000)).to eq("1000B") | true |
Other | Homebrew | brew | 53a7065bccfb1cec9286b32e7443c95a2423b62a.json | Allow specifying committer for some `dev-cmd`s | Library/Homebrew/utils.rb | @@ -467,6 +467,13 @@ def paths
end.uniq.compact
end
+ def parse_author!(author)
+ /^(?<name>[^<]+?)[ \t]*<(?<email>[^>]+?)>$/ =~ author
+ raise "Unable to parse name and email." if name.blank? && email.blank?
+
+ { name: name, email: email }
+ end
+
def disk_usage_readable(size_in_bytes)
if size_in_bytes >= 1_073_741_824
size = size_in_bytes.to_f / 1_073_741_824 | true |
Other | Homebrew | brew | 95b44eab4964c9b6ebf615a0fc58d013fb23582c.json | github_packages: adjust rebuild handling | Library/Homebrew/github_packages.rb | @@ -68,10 +68,18 @@ def upload_bottles(bottles_hash, dry_run:)
end
end
- def self.version_rebuild(version, rebuild)
- return version.to_s unless rebuild.to_i.positive?
+ def self.version_rebuild(version, rebuild, bottle_tag = nil)
+ bottle_tag = (".#{bottle_tag}" if bottle_tag.present?)
+
+ rebuild = if rebuild.to_i.positive?
+ if bottle_tag
+ ".#{rebuild}"
+ else
+ "-#{rebuild}"
+ end
+ end
- "#{version}.#{rebuild}"
+ "#{version}#{bottle_tag}#{rebuild}"
end
def self.repo_without_prefix(repo)
@@ -222,8 +230,7 @@ def upload_bottle(user, token, skopeo, formula_full_name, bottle_hash, dry_run:)
formulae_dir = tag_hash["formulae_brew_sh_path"]
documentation = "https://formulae.brew.sh/#{formulae_dir}/#{formula_name}" if formula_core_tap
- rebuild = ".#{rebuild}" if rebuild.to_i.positive?
- tag = "#{version}.#{bottle_tag}#{rebuild}"
+ tag = GitHubPackages.version_rebuild(version, rebuild, bottle_tag)
annotations_hash = formula_annotations_hash.merge({
"org.opencontainers.image.created" => created_date, | false |
Other | Homebrew | brew | 8144fdef783623e3501eb475cf14414ec3dc3dad.json | Simplify CurlGitHubPackagesDownloadStrategy usage | Library/Homebrew/download_strategy.rb | @@ -533,20 +533,18 @@ def curl(*args, **options)
#
# @api public
class CurlGitHubPackagesDownloadStrategy < CurlDownloadStrategy
- attr_accessor :checksum, :name
+ attr_writer :resolved_basename
- private
-
- def _fetch(url:, resolved_url:)
- raise CurlDownloadStrategyError, "Empty checksum" if checksum.blank?
- raise CurlDownloadStrategyError, "Empty name" if name.blank?
+ def initialize(url, name, version, **meta)
+ meta ||= {}
+ meta[:header] = "Authorization: Bearer"
+ super(url, name, version, meta)
+ end
- _, org, repo, = *url.match(GitHubPackages::URL_REGEX)
+ private
- # remove redundant repo prefix for a shorter name
- repo = repo.delete_prefix("homebrew-")
- blob_url = "#{GitHubPackages::URL_PREFIX}#{org}/#{repo}/#{name}/blobs/sha256:#{checksum}"
- curl_download(blob_url, "--header", "Authorization: Bearer", to: temporary_path)
+ def resolved_basename
+ @resolved_basename.presence || super
end
end
| true |
Other | Homebrew | brew | 8144fdef783623e3501eb475cf14414ec3dc3dad.json | Simplify CurlGitHubPackagesDownloadStrategy usage | Library/Homebrew/software_spec.rb | @@ -304,9 +304,18 @@ def initialize(formula, spec)
checksum, tag, cellar = spec.checksum_for(Utils::Bottles.tag)
- filename = Filename.create(formula, tag, spec.rebuild)
- @resource.url("#{spec.root_url}/#{filename.bintray}",
- select_download_strategy(spec.root_url_specs))
+ filename = Filename.create(formula, tag, spec.rebuild).bintray
+
+ # TODO: this will need adjusted when if we use GitHub Packages by default
+ path, resolved_basename = if (bottle_domain = Homebrew::EnvConfig.bottle_domain.presence) &&
+ bottle_domain.start_with?(GitHubPackages::URL_PREFIX)
+ ["#{@name}/blobs/sha256:#{checksum}", filename]
+ else
+ filename
+ end
+
+ @resource.url("#{spec.root_url}/#{path}", select_download_strategy(spec.root_url_specs))
+ @resource.downloader.resolved_basename = resolved_basename if resolved_basename.present?
@resource.version = formula.pkg_version
@resource.checksum = checksum
@prefix = spec.prefix
@@ -316,16 +325,12 @@ def initialize(formula, spec)
def fetch(verify_download_integrity: true)
# add the default bottle domain as a fallback mirror
- # TODO: this may need adjusted when if we use GitHub Packages by default
if @resource.download_strategy == CurlDownloadStrategy &&
@resource.url.start_with?(Homebrew::EnvConfig.bottle_domain)
fallback_url = @resource.url
.sub(/^#{Regexp.escape(Homebrew::EnvConfig.bottle_domain)}/,
HOMEBREW_BOTTLE_DEFAULT_DOMAIN)
@resource.mirror(fallback_url) if [@resource.url, *@resource.mirrors].exclude?(fallback_url)
- elsif @resource.download_strategy == CurlGitHubPackagesDownloadStrategy
- @resource.downloader.name = @name
- @resource.downloader.checksum = @resource.checksum.hexdigest
end
@resource.fetch(verify_download_integrity: verify_download_integrity)
end
@@ -380,7 +385,7 @@ def prefix=(prefix)
def root_url(var = nil, specs = {})
if var.nil?
@root_url ||= if Homebrew::EnvConfig.bottle_domain.start_with?(GitHubPackages::URL_PREFIX)
- "#{GitHubPackages::URL_PREFIX}#{tap.full_name}"
+ GitHubPackages.root_url(tap.user, tap.repo).to_s
else
"#{Homebrew::EnvConfig.bottle_domain}/#{Utils::Bottles::Bintray.repository(tap)}"
end | true |
Other | Homebrew | brew | c8aea8653abcbb89a1334b173511b39e8588825a.json | utils/bottles: remove unused method. | Library/Homebrew/utils/bottles.rb | @@ -39,12 +39,6 @@ def extname_tag_rebuild(filename)
HOMEBREW_BOTTLES_EXTNAME_REGEX.match(filename).to_a
end
- # TODO: remove when removed from brew-test-bot
- sig { returns(Regexp) }
- def native_regex
- /(\.#{Regexp.escape(tag.to_s)}\.bottle\.(\d+\.)?tar\.gz)$/o
- end
-
def receipt_path(bottle_file)
path = Utils.popen_read("tar", "-tzf", bottle_file).lines.map(&:chomp).find do |line|
line =~ %r{.+/.+/INSTALL_RECEIPT.json} | false |
Other | Homebrew | brew | 1012f98c006b045e6461a344fdaa984f8433967a.json | cmd/vendor-install: use GitHub for portable Ruby.
Let's default to using GitHub for portable Ruby and fall back to Bintray
(because Bintray is going away). | Library/Homebrew/cmd/vendor-install.sh | @@ -17,16 +17,16 @@ if [[ -n "$HOMEBREW_MACOS" ]]
then
if [[ "$HOMEBREW_PROCESSOR" = "Intel" ]]
then
- ruby_URL="$HOMEBREW_BOTTLE_DOMAIN/bottles-portable-ruby/portable-ruby-2.6.3_2.yosemite.bottle.tar.gz"
- ruby_URL2="https://github.com/Homebrew/homebrew-portable-ruby/releases/download/2.6.3_2/portable-ruby-2.6.3_2.yosemite.bottle.tar.gz"
+ ruby_URL="https://github.com/Homebrew/homebrew-portable-ruby/releases/download/2.6.3_2/portable-ruby-2.6.3_2.yosemite.bottle.tar.gz"
+ ruby_URL2="$HOMEBREW_BOTTLE_DOMAIN/bottles-portable-ruby/portable-ruby-2.6.3_2.yosemite.bottle.tar.gz"
ruby_SHA="b065e5e3783954f3e65d8d3a6377ca51649bfcfa21b356b0dd70490f74c6bd86"
fi
elif [[ -n "$HOMEBREW_LINUX" ]]
then
case "$HOMEBREW_PROCESSOR" in
x86_64)
- ruby_URL="$HOMEBREW_BOTTLE_DOMAIN/bottles-portable-ruby/portable-ruby-2.6.3_2.x86_64_linux.bottle.tar.gz"
- ruby_URL2="https://github.com/Homebrew/homebrew-portable-ruby/releases/download/2.6.3_2/portable-ruby-2.6.3_2.x86_64_linux.bottle.tar.gz"
+ ruby_URL="https://github.com/Homebrew/homebrew-portable-ruby/releases/download/2.6.3_2/portable-ruby-2.6.3_2.x86_64_linux.bottle.tar.gz"
+ ruby_URL2="$HOMEBREW_BOTTLE_DOMAIN/bottles-portable-ruby/portable-ruby-2.6.3_2.x86_64_linux.bottle.tar.gz"
ruby_SHA="97e639a64dcec285392b53ad804b5334c324f1d2a8bdc2b5087b8bf8051e332f"
;;
esac | false |
Other | Homebrew | brew | e30f2af9870905181f12dbd45a973145dcadc1ee.json | system_command: improve EOF handling | Library/Homebrew/system_command.rb | @@ -197,23 +197,26 @@ def write_input_to(raw_stdin)
sig { params(sources: T::Array[IO], _block: T.proc.params(type: Symbol, line: String).void).void }
def each_line_from(sources, &_block)
- loop do
- readable_sources, = IO.select(sources)
-
- readable_sources = T.must(readable_sources).reject(&:eof?)
+ sources_remaining = sources.dup
+ while sources_remaining.present?
+ readable_sources, = IO.select(sources_remaining)
+ readable_sources = T.must(readable_sources)
break if readable_sources.empty?
readable_sources.each do |source|
line = source.readline_nonblock || ""
type = (source == sources[0]) ? :stdout : :stderr
yield(type, line)
- rescue IO::WaitReadable, EOFError
+ rescue EOFError
+ source.close_read
+ sources_remaining.delete(source)
+ rescue IO::WaitReadable
next
end
end
- sources.each(&:close_read)
+ sources_remaining.each(&:close_read)
end
# Result containing the output and exit status of a finished sub-process. | false |
Other | Homebrew | brew | 89868087fd8540118475b5f3bddf159c687317ec.json | repair the message | Library/Homebrew/cmd/update-report.rb | @@ -154,8 +154,8 @@ def update_report
puts_stdout_or_stderr
puts_stdout_or_stderr <<~EOS
You have #{msg} installed.
- You can check #{update_pronoun} with #{Tty.bold}brew outdated#{Tty.reset}.
- You can update #{update_pronoun} with #{Tty.bold}brew upgrade#{Tty.reset}.
+ You can upgrade #{update_pronoun} with #{Tty.bold}brew upgrade#{Tty.reset}
+ or check #{update_pronoun} with #{Tty.bold}brew outdated#{Tty.reset}.
EOS
end
end | false |
Other | Homebrew | brew | c8299edb39eecb4bab7e55746ef69156ffea9a86.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 | @@ -12603,6 +12603,7 @@ class Object
DEPRECATED_OFFICIAL_TAPS = ::T.let(nil, ::T.untyped)
ENV = ::T.let(nil, ::T.untyped)
FORMULA_COMPONENT_PRECEDENCE_LIST = ::T.let(nil, ::T.untyped)
+ HOMEBREW_BOTTLES_EXTNAME_REGEX = ::T.let(nil, ::T.untyped)
HOMEBREW_BOTTLE_DEFAULT_DOMAIN = ::T.let(nil, ::T.untyped)
HOMEBREW_BREW_DEFAULT_GIT_REMOTE = ::T.let(nil, ::T.untyped)
HOMEBREW_BREW_FILE = ::T.let(nil, ::T.untyped) | false |
Other | Homebrew | brew | f0ece0432d8c938d245dbca22fd2b08dc12cf7ff.json | Fix appcast spec. | Library/Homebrew/test/cask/audit_spec.rb | @@ -613,46 +613,46 @@ def tmp_cask(name, text)
end
end
- describe "hosting with appcast checks" do
- let(:message) { /please add an appcast/ }
+ describe "hosting with livecheck checks" do
+ let(:message) { /please add a livecheck/ }
- context "when the download does not use hosting with an appcast" do
+ context "when the download does not use hosting with a livecheck" do
let(:cask_token) { "basic-cask" }
it { is_expected.not_to fail_with(message) }
end
- context "when the download is hosted on SourceForge and has an appcast" do
+ context "when the download is hosted on SourceForge and has a livecheck" do
let(:cask_token) { "sourceforge-with-appcast" }
it { is_expected.not_to fail_with(message) }
end
- context "when the download is hosted on SourceForge and does not have an appcast" do
+ context "when the download is hosted on SourceForge and does not have a livecheck" do
let(:cask_token) { "sourceforge-correct-url-format" }
it { is_expected.to fail_with(message) }
end
- context "when the download is hosted on DevMate and has an appcast" do
+ context "when the download is hosted on DevMate and has a livecheck" do
let(:cask_token) { "devmate-with-appcast" }
it { is_expected.not_to fail_with(message) }
end
- context "when the download is hosted on DevMate and does not have an appcast" do
+ context "when the download is hosted on DevMate and does not have a livecheck" do
let(:cask_token) { "devmate-without-appcast" }
it { is_expected.to fail_with(message) }
end
- context "when the download is hosted on HockeyApp and has an appcast" do
+ context "when the download is hosted on HockeyApp and has a livecheck" do
let(:cask_token) { "hockeyapp-with-appcast" }
it { is_expected.not_to fail_with(message) }
end
- context "when the download is hosted on HockeyApp and does not have an appcast" do
+ context "when the download is hosted on HockeyApp and does not have a livecheck" do
let(:cask_token) { "hockeyapp-without-appcast" }
it { is_expected.to fail_with(message) } | false |
Other | Homebrew | brew | 9f9c5df047b2043158c081f0003b29856c71f19d.json | github_packages: Translate tab.arch to OCI
Translate Homebrew tab.arch to OCI platform.architecture. | Library/Homebrew/github_packages.rb | @@ -17,6 +17,12 @@ class GitHubPackages
DOCKER_PREFIX = "docker://#{URL_DOMAIN}/"
URL_REGEX = %r{(?:#{Regexp.escape(URL_PREFIX)}|#{Regexp.escape(DOCKER_PREFIX)})([\w-]+)/([\w-]+)}.freeze
+ # Translate Homebrew tab.arch to OCI platform.architecture
+ TAB_ARCH_TO_PLATFORM_ARCHITECTURE = {
+ "arm64" => "arm64",
+ "x86_64" => "amd64",
+ }.freeze
+
# Translate Homebrew built_on.os to OCI platform.os
BUILT_ON_OS_TO_PLATFORM_OS = {
"Linux" => "linux",
@@ -179,11 +185,14 @@ def upload_bottle(user, token, skopeo, formula_full_name, bottle_hash, dry_run:)
tar_gz_sha256 = write_tar_gz(local_file, blobs)
tab = tag_hash["tab"]
+ architecture = TAB_ARCH_TO_PLATFORM_ARCHITECTURE[tab["arch"]]
+ raise TypeError, "unknown tab['arch']: #{tab["arch"]}" if architecture.blank?
+
os = BUILT_ON_OS_TO_PLATFORM_OS[tab["built_on"]["os"]]
raise TypeError, "unknown tab['built_on']['os']: #{tab["built_on"]["os"]}" if os.blank?
platform_hash = {
- architecture: tab["arch"],
+ architecture: architecture,
os: os,
"os.version" => tab["built_on"]["os_version"],
} | false |
Other | Homebrew | brew | 495450592052a7e42377e1f78bca5ef92d20fa68.json | github_packages: Translate built_on to platform OS | Library/Homebrew/github_packages.rb | @@ -17,6 +17,12 @@ class GitHubPackages
DOCKER_PREFIX = "docker://#{URL_DOMAIN}/"
URL_REGEX = %r{(?:#{Regexp.escape(URL_PREFIX)}|#{Regexp.escape(DOCKER_PREFIX)})([\w-]+)/([\w-]+)}.freeze
+ # Translate Homebrew built_on.os to OCI platform.os
+ BUILT_ON_OS_TO_PLATFORM_OS = {
+ "Linux" => "linux",
+ "Macintosh" => "darwin",
+ }.freeze
+
sig { returns(String) }
def inspect
"#<GitHubPackages: org=#{@github_org}>"
@@ -173,9 +179,12 @@ def upload_bottle(user, token, skopeo, formula_full_name, bottle_hash, dry_run:)
tar_gz_sha256 = write_tar_gz(local_file, blobs)
tab = tag_hash["tab"]
+ os = BUILT_ON_OS_TO_PLATFORM_OS[tab["built_on"]["os"]]
+ raise TypeError, "unknown tab['built_on']['os']: #{tab["built_on"]["os"]}" if os.blank?
+
platform_hash = {
architecture: tab["arch"],
- os: tab["built_on"]["os"],
+ os: os,
"os.version" => tab["built_on"]["os_version"],
}
tar_sha256 = Digest::SHA256.hexdigest( | false |
Other | Homebrew | brew | d8a2cf9efcecbc3e2ba48699a7c99cf2242dcae0.json | Write tabs to bottle JSON, optionally not bottle
- Write a subset of the tab required for bottles as an annotation.
- Add option on new bottle creation to skip writing tab into bottle
and instead add it (and other useful metadata) to bottle JSON.
- Read formula information and tab from bottle JSON.
- Write prettier JSON to disk.
- Don't write `HEAD` to tab; this duplicates `HOMEBREW_VERSION`.
- Allow `brew bottle` to use `--json` to generate JSON files from a
local bottle file. | Library/Homebrew/.rubocop.yml | @@ -14,7 +14,7 @@ Lint/NestedMethodDefinition:
# TODO: Try to bring down all metrics maximums.
Metrics/AbcSize:
- Max: 250
+ Max: 275
Metrics/BlockLength:
Max: 100
Exclude: | true |
Other | Homebrew | brew | d8a2cf9efcecbc3e2ba48699a7c99cf2242dcae0.json | Write tabs to bottle JSON, optionally not bottle
- Write a subset of the tab required for bottles as an annotation.
- Add option on new bottle creation to skip writing tab into bottle
and instead add it (and other useful metadata) to bottle JSON.
- Read formula information and tab from bottle JSON.
- Write prettier JSON to disk.
- Don't write `HEAD` to tab; this duplicates `HOMEBREW_VERSION`.
- Allow `brew bottle` to use `--json` to generate JSON files from a
local bottle file. | Library/Homebrew/cleanup.rb | @@ -64,7 +64,7 @@ def stale?(scrub: false)
def stale_formula?(scrub)
return false unless HOMEBREW_CELLAR.directory?
- version = if to_s.match?(Pathname::BOTTLE_EXTNAME_RX)
+ version = if HOMEBREW_BOTTLES_EXTNAME_REGEX.match?(to_s)
begin
Utils::Bottles.resolve_version(self)
rescue | true |
Other | Homebrew | brew | d8a2cf9efcecbc3e2ba48699a7c99cf2242dcae0.json | Write tabs to bottle JSON, optionally not bottle
- Write a subset of the tab required for bottles as an annotation.
- Add option on new bottle creation to skip writing tab into bottle
and instead add it (and other useful metadata) to bottle JSON.
- Read formula information and tab from bottle JSON.
- Write prettier JSON to disk.
- Don't write `HEAD` to tab; this duplicates `HOMEBREW_VERSION`.
- Allow `brew bottle` to use `--json` to generate JSON files from a
local bottle file. | Library/Homebrew/dev-cmd/bottle.rb | @@ -70,6 +70,9 @@ def bottle_args
depends_on: "--write",
description: "When passed with `--write`, a new commit will not generated after writing changes "\
"to the formula file."
+ switch "--only-json-tab",
+ depends_on: "--json",
+ description: "When passed with `--json`, the tab will be written to the JSON file but not the bottle."
flag "--root-url=",
description: "Use the specified <URL> as the root of the bottle's URL instead of Homebrew's default."
@@ -252,9 +255,15 @@ def sudo_purge
end
def bottle_formula(f, args:)
- return ofail "Formula not installed or up-to-date: #{f.full_name}" unless f.latest_version_installed?
+ local_bottle_json = args.json? && f.local_bottle_path.present?
- unless (tap = f.tap)
+ unless local_bottle_json
+ return ofail "Formula not installed or up-to-date: #{f.full_name}" unless f.latest_version_installed?
+ return ofail "Formula was not installed with --build-bottle: #{f.full_name}" unless Utils::Bottles.built_as? f
+ end
+
+ tap = f.tap
+ if tap.nil?
return ofail "Formula not from core or any installed taps: #{f.full_name}" unless args.force_core_tap?
tap = CoreTap.instance
@@ -266,39 +275,95 @@ def bottle_formula(f, args:)
return
end
- return ofail "Formula was not installed with --build-bottle: #{f.full_name}" unless Utils::Bottles.built_as? f
-
return ofail "Formula has no stable version: #{f.full_name}" unless f.stable
- if args.no_rebuild? || !f.tap
- rebuild = 0
+ bottle_tag, rebuild = if local_bottle_json
+ _, tag_string, rebuild_string = Utils::Bottles.extname_tag_rebuild(f.local_bottle_path.to_s)
+ [tag_string.to_sym, rebuild_string.to_i]
+ end
+
+ bottle_tag ||= Utils::Bottles.tag
+
+ rebuild ||= if args.no_rebuild? || !tap
+ 0
elsif args.keep_old?
- rebuild = f.bottle_specification.rebuild
+ f.bottle_specification.rebuild
else
ohai "Determining #{f.full_name} bottle rebuild..."
versions = FormulaVersions.new(f)
rebuilds = versions.bottle_version_map("origin/master")[f.pkg_version]
rebuilds.pop if rebuilds.last.to_i.positive?
- rebuild = rebuilds.empty? ? 0 : rebuilds.max.to_i + 1
+ rebuilds.empty? ? 0 : rebuilds.max.to_i + 1
end
- filename = Bottle::Filename.create(f, Utils::Bottles.tag, rebuild)
+ filename = Bottle::Filename.create(f, bottle_tag, rebuild)
+ local_filename = filename.to_s
bottle_path = Pathname.pwd/filename
- tar_filename = filename.to_s.sub(/.gz$/, "")
- tar_path = Pathname.pwd/tar_filename
+ tab = nil
+ keg = nil
+
+ tap_path = tap.path
+ tap_git_revision = tap.git_head
+ tap_git_remote = tap.remote
+
+ root_url = args.root_url
+
+ formulae_brew_sh_path = Utils::Analytics.formula_path
+
+ relocatable = T.let(false, T::Boolean)
+ skip_relocation = T.let(false, T::Boolean)
prefix = HOMEBREW_PREFIX.to_s
cellar = HOMEBREW_CELLAR.to_s
- ohai "Bottling #{filename}..."
+ if local_bottle_json
+ bottle_path = f.local_bottle_path
+ local_filename = bottle_path.basename.to_s
+
+ tab_path = Utils::Bottles.receipt_path(f.local_bottle_path)
+ tab_json = Utils.safe_popen_read("tar", "xfO", f.local_bottle_path, tab_path)
+ tab = Tab.from_file_content(tab_json, tab_path)
+
+ # TODO: most of this logic can be removed when we're done with bulk GitHub Packages bottle uploading
+ tap_git_revision = tab["source"]["tap_git_head"]
+ if tap.core_tap?
+ if bottle_tag.to_s.end_with?("_linux")
+ tap_git_remote = "https://github.com/Homebrew/linuxbrew-core"
+ formulae_brew_sh_path = "formula-linux"
+ else
+ tap_git_remote = "https://github.com/Homebrew/homebrew-core"
+ formulae_brew_sh_path = "formula"
+ end
+ end
+
+ _, _, bottle_cellar = Formula[f.name].bottle_specification.checksum_for(bottle_tag, exact: true)
+ relocatable = [:any, :any_skip_relocation].include?(bottle_cellar)
+ skip_relocation = bottle_cellar == :any_skip_relocation
+
+ if bottle_tag.to_s.end_with?("_linux")
+ prefix = HOMEBREW_LINUX_DEFAULT_PREFIX.to_s
+ cellar = Homebrew::DEFAULT_LINUX_CELLAR
+ elsif bottle_tag.to_s.start_with?("arm64_")
+ prefix = HOMEBREW_MACOS_ARM_DEFAULT_PREFIX.to_s
+ cellar = Homebrew::DEFAULT_MACOS_ARM_CELLAR
+ else
+ prefix = HOMEBREW_DEFAULT_PREFIX.to_s
+ cellar = Homebrew::DEFAULT_MACOS_CELLAR
+ end
+ else
+ tar_filename = filename.to_s.sub(/.gz$/, "")
+ tar_path = Pathname.pwd/tar_filename
+
+ keg = Keg.new(f.prefix)
+ end
+
+ ohai "Bottling #{local_filename}..."
formula_and_runtime_deps_names = [f.name] + f.runtime_dependencies.map(&:name)
- keg = Keg.new(f.prefix)
- relocatable = T.let(false, T::Boolean)
- skip_relocation = T.let(false, T::Boolean)
- keg.lock do
+ # this will be nil when using a local bottle
+ keg&.lock do
original_tab = nil
changed_files = nil
@@ -318,7 +383,11 @@ def bottle_formula(f, args:)
tab.HEAD = nil
tab.time = nil
tab.changed_files = changed_files
- tab.write
+ if args.only_json_tab?
+ tab.tabfile.unlink
+ else
+ tab.write
+ end
keg.find do |file|
if file.symlink?
@@ -342,7 +411,7 @@ def bottle_formula(f, args:)
mv "#{relocatable_tar_path}.gz", bottle_path
end
- ohai "Detecting if #{filename} is relocatable..." if bottle_path.size > 1 * 1024 * 1024
+ ohai "Detecting if #{local_filename} is relocatable..." if bottle_path.size > 1 * 1024 * 1024
prefix_check = if Homebrew.default_prefix?(prefix)
File.join(prefix, "opt")
@@ -400,8 +469,6 @@ def bottle_formula(f, args:)
end
end
- root_url = args.root_url
-
bottle = BottleSpecification.new
bottle.tap = tap
bottle.root_url(root_url) if root_url
@@ -417,7 +484,7 @@ def bottle_formula(f, args:)
end
bottle.rebuild rebuild
sha256 = bottle_path.sha256
- bottle.sha256 sha256 => Utils::Bottles.tag
+ bottle.sha256 sha256 => bottle_tag
old_spec = f.bottle_specification
if args.keep_old? && !old_spec.checksums.empty?
@@ -448,27 +515,36 @@ def bottle_formula(f, args:)
output = bottle_output bottle
- puts "./#{filename}"
+ puts "./#{local_filename}"
puts output
return unless args.json?
json = {
f.full_name => {
"formula" => {
- "pkg_version" => f.pkg_version.to_s,
- "path" => f.path.to_s.delete_prefix("#{HOMEBREW_REPOSITORY}/"),
+ "name" => f.name,
+ "pkg_version" => f.pkg_version.to_s,
+ "path" => f.path.to_s.delete_prefix("#{HOMEBREW_REPOSITORY}/"),
+ "tap_git_path" => f.path.to_s.delete_prefix("#{tap_path}/"),
+ "tap_git_revision" => tap_git_revision,
+ "tap_git_remote" => tap_git_remote,
+ "desc" => f.desc,
+ "license" => f.license,
+ "homepage" => f.homepage,
},
"bottle" => {
"root_url" => bottle.root_url,
"prefix" => bottle.prefix,
"cellar" => bottle.cellar.to_s,
"rebuild" => bottle.rebuild,
"tags" => {
- Utils::Bottles.tag.to_s => {
- "filename" => filename.bintray,
- "local_filename" => filename.to_s,
- "sha256" => sha256,
+ bottle_tag.to_s => {
+ "filename" => filename.bintray,
+ "local_filename" => local_filename,
+ "sha256" => sha256,
+ "formulae_brew_sh_path" => formulae_brew_sh_path,
+ "tab" => tab.to_bottle_hash,
},
},
},
@@ -479,7 +555,7 @@ def bottle_formula(f, args:)
},
}
File.open(filename.json, "w") do |file|
- file.write JSON.generate json
+ file.write JSON.pretty_generate json
end
end
| true |
Other | Homebrew | brew | d8a2cf9efcecbc3e2ba48699a7c99cf2242dcae0.json | Write tabs to bottle JSON, optionally not bottle
- Write a subset of the tab required for bottles as an annotation.
- Add option on new bottle creation to skip writing tab into bottle
and instead add it (and other useful metadata) to bottle JSON.
- Read formula information and tab from bottle JSON.
- Write prettier JSON to disk.
- Don't write `HEAD` to tab; this duplicates `HOMEBREW_VERSION`.
- Allow `brew bottle` to use `--json` to generate JSON files from a
local bottle file. | Library/Homebrew/dev-cmd/pr-upload.rb | @@ -92,6 +92,12 @@ def pr_upload
hash.deep_merge(JSON.parse(IO.read(json_file)))
end
+ if args.root_url
+ bottles_hash.each_value do |bottle_hash|
+ bottle_hash["bottle"]["root_url"] = args.root_url
+ end
+ end
+
bottle_args = ["bottle", "--merge", "--write"]
bottle_args << "--verbose" if args.verbose?
bottle_args << "--debug" if args.debug? | true |
Other | Homebrew | brew | d8a2cf9efcecbc3e2ba48699a7c99cf2242dcae0.json | Write tabs to bottle JSON, optionally not bottle
- Write a subset of the tab required for bottles as an annotation.
- Add option on new bottle creation to skip writing tab into bottle
and instead add it (and other useful metadata) to bottle JSON.
- Read formula information and tab from bottle JSON.
- Write prettier JSON to disk.
- Don't write `HEAD` to tab; this duplicates `HOMEBREW_VERSION`.
- Allow `brew bottle` to use `--json` to generate JSON files from a
local bottle file. | Library/Homebrew/download_strategy.rb | @@ -538,8 +538,8 @@ class CurlGitHubPackagesDownloadStrategy < CurlDownloadStrategy
private
def _fetch(url:, resolved_url:)
- raise "Empty checksum" if checksum.blank?
- raise "Empty name" if name.blank?
+ raise CurlDownloadStrategyError, "Empty checksum" if checksum.blank?
+ raise CurlDownloadStrategyError, "Empty name" if name.blank?
_, org, repo, = *url.match(GitHubPackages::URL_REGEX)
| true |
Other | Homebrew | brew | d8a2cf9efcecbc3e2ba48699a7c99cf2242dcae0.json | Write tabs to bottle JSON, optionally not bottle
- Write a subset of the tab required for bottles as an annotation.
- Add option on new bottle creation to skip writing tab into bottle
and instead add it (and other useful metadata) to bottle JSON.
- Read formula information and tab from bottle JSON.
- Write prettier JSON to disk.
- Don't write `HEAD` to tab; this duplicates `HOMEBREW_VERSION`.
- Allow `brew bottle` to use `--json` to generate JSON files from a
local bottle file. | Library/Homebrew/extend/pathname.rb | @@ -81,9 +81,6 @@ class Pathname
include DiskUsageExtension
- # @private
- BOTTLE_EXTNAME_RX = /(\.[a-z0-9_]+\.bottle\.(\d+\.)?tar\.gz)$/.freeze
-
# Moves a file from the original location to the {Pathname}'s.
sig {
params(sources: T.any(
@@ -243,7 +240,7 @@ def cp_path_sub(pattern, replacement)
def extname
basename = File.basename(self)
- bottle_ext = basename[BOTTLE_EXTNAME_RX, 1]
+ bottle_ext, = HOMEBREW_BOTTLES_EXTNAME_REGEX.match(basename).to_a
return bottle_ext if bottle_ext
archive_ext = basename[/(\.(tar|cpio|pax)\.(gz|bz2|lz|xz|Z))\Z/, 1] | true |
Other | Homebrew | brew | d8a2cf9efcecbc3e2ba48699a7c99cf2242dcae0.json | Write tabs to bottle JSON, optionally not bottle
- Write a subset of the tab required for bottles as an annotation.
- Add option on new bottle creation to skip writing tab into bottle
and instead add it (and other useful metadata) to bottle JSON.
- Read formula information and tab from bottle JSON.
- Write prettier JSON to disk.
- Don't write `HEAD` to tab; this duplicates `HOMEBREW_VERSION`.
- Allow `brew bottle` to use `--json` to generate JSON files from a
local bottle file. | Library/Homebrew/formula_installer.rb | @@ -1139,14 +1139,21 @@ def pour
)
end
- tab.tap = formula.tap
+ # fill in missing/outdated parts of the tab
+ # keep in sync with Tab#to_bottle_json
+ tab.used_options = []
+ tab.unused_options = []
+ tab.built_as_bottle = true
tab.poured_from_bottle = true
- tab.time = Time.now.to_i
- tab.head = HOMEBREW_REPOSITORY.git_head
- tab.source["path"] = formula.specified_path.to_s
tab.installed_as_dependency = installed_as_dependency?
tab.installed_on_request = installed_on_request?
+ tab.time = Time.now.to_i
tab.aliases = formula.aliases
+ tab.arch = Hardware::CPU.arch
+ tab.source["versions"]["stable"] = formula.stable.version.to_s
+ tab.source["path"] = formula.specified_path.to_s
+ tab.source["tap_git_head"] = formula.tap&.git_head
+ tab.tap = formula.tap
tab.write
end
| true |
Other | Homebrew | brew | d8a2cf9efcecbc3e2ba48699a7c99cf2242dcae0.json | Write tabs to bottle JSON, optionally not bottle
- Write a subset of the tab required for bottles as an annotation.
- Add option on new bottle creation to skip writing tab into bottle
and instead add it (and other useful metadata) to bottle JSON.
- Read formula information and tab from bottle JSON.
- Write prettier JSON to disk.
- Don't write `HEAD` to tab; this duplicates `HOMEBREW_VERSION`.
- Allow `brew bottle` to use `--json` to generate JSON files from a
local bottle file. | Library/Homebrew/formulary.rb | @@ -4,6 +4,7 @@
require "digest/md5"
require "extend/cachable"
require "tab"
+require "utils/bottles"
# The {Formulary} is responsible for creating instances of {Formula}.
# It is not meant to be used directly from formulae.
@@ -458,7 +459,7 @@ def self.path(ref)
def self.loader_for(ref, from: nil)
case ref
- when Pathname::BOTTLE_EXTNAME_RX
+ when HOMEBREW_BOTTLES_EXTNAME_REGEX
return BottleLoader.new(ref)
when URL_START_REGEX
return FromUrlLoader.new(ref) | true |
Other | Homebrew | brew | d8a2cf9efcecbc3e2ba48699a7c99cf2242dcae0.json | Write tabs to bottle JSON, optionally not bottle
- Write a subset of the tab required for bottles as an annotation.
- Add option on new bottle creation to skip writing tab into bottle
and instead add it (and other useful metadata) to bottle JSON.
- Read formula information and tab from bottle JSON.
- Write prettier JSON to disk.
- Don't write `HEAD` to tab; this duplicates `HOMEBREW_VERSION`.
- Allow `brew bottle` to use `--json` to generate JSON files from a
local bottle file. | Library/Homebrew/github_packages.rb | @@ -51,8 +51,8 @@ def upload_bottles(bottles_hash, dry_run:)
load_schemas!
- bottles_hash.each_value do |bottle_hash|
- upload_bottle(user, token, skopeo, bottle_hash, dry_run: dry_run)
+ bottles_hash.each do |formula_full_name, bottle_hash|
+ upload_bottle(user, token, skopeo, formula_full_name, bottle_hash, dry_run: dry_run)
end
end
@@ -119,10 +119,8 @@ def validate_schema!(schema_uri, json)
exit 1
end
- def upload_bottle(user, token, skopeo, bottle_hash, dry_run:)
- formula_path = HOMEBREW_REPOSITORY/bottle_hash["formula"]["path"]
- formula = Formulary.factory(formula_path)
- formula_name = formula.name
+ def upload_bottle(user, token, skopeo, formula_full_name, bottle_hash, dry_run:)
+ formula_name = bottle_hash["formula"]["name"]
_, org, repo, = *bottle_hash["bottle"]["root_url"].match(URL_REGEX)
@@ -139,89 +137,62 @@ def upload_bottle(user, token, skopeo, bottle_hash, dry_run:)
blobs = root/"blobs/sha256"
blobs.mkpath
- # TODO: ideally most/all of these attributes would be stored in the
- # bottle JSON rather than reading them from the formula.
- git_revision = formula.tap.git_head
- git_path = formula_path.to_s.delete_prefix("#{formula.tap.path}/")
+ git_revision = bottle_hash["formula"]["tap_git_head"]
+ git_path = bottle_hash["formula"]["tap_git_path"]
source = "https://github.com/#{org}/#{repo}/blob/#{git_revision}/#{git_path}"
- documentation = if formula.tap.core_tap?
+
+ formula_core_tap = formula_full_name.exclude?("/")
+ documentation = if formula_core_tap
"https://formulae.brew.sh/formula/#{formula_name}"
- elsif (remote = formula.tap.remote) && remote.start_with?("https://github.com/")
+ elsif (remote = bottle_hash["formula"]["tap_git_remote"]) && remote.start_with?("https://github.com/")
remote
end
formula_annotations_hash = {
"org.opencontainers.image.created" => Time.now.strftime("%F"),
- "org.opencontainers.image.description" => formula.desc,
+ "org.opencontainers.image.description" => bottle_hash["formula"]["desc"],
"org.opencontainers.image.documentation" => documentation,
- "org.opencontainers.image.license" => formula.license,
+ "org.opencontainers.image.license" => bottle_hash["formula"]["license"],
"org.opencontainers.image.ref.name" => version_rebuild,
"org.opencontainers.image.revision" => git_revision,
"org.opencontainers.image.source" => source,
- "org.opencontainers.image.title" => formula.full_name,
- "org.opencontainers.image.url" => formula.homepage,
+ "org.opencontainers.image.title" => formula_full_name,
+ "org.opencontainers.image.url" => bottle_hash["formula"]["homepage"],
"org.opencontainers.image.vendor" => org,
"org.opencontainers.image.version" => version,
}
formula_annotations_hash.each do |key, value|
formula_annotations_hash.delete(key) if value.blank?
end
- created_times = []
manifests = bottle_hash["bottle"]["tags"].map do |bottle_tag, tag_hash|
local_file = tag_hash["local_filename"]
odebug "Uploading #{local_file}"
tar_gz_sha256 = write_tar_gz(local_file, blobs)
- tab = Tab.from_file_content(
- Utils.safe_popen_read("tar", "xfO", local_file, "#{formula_name}/#{version}/INSTALL_RECEIPT.json"),
- "#{local_file}/#{formula_name}/#{version}",
- )
- os_version = if tab.built_on.present?
- /(\d+\.)*\d+/ =~ tab.built_on["os_version"]
- Regexp.last_match(0)
- end
-
- # TODO: ideally most/all of these attributes would be stored in the
- # bottle JSON rather than reading them from the formula.
- os, arch, formulae_dir = if bottle_tag.to_s.end_with?("_linux")
- ["linux", "amd64", "formula-linux"]
- else
- os = "darwin"
- macos_version = MacOS::Version.from_symbol(bottle_tag.to_sym)
- os_version ||= macos_version.to_f.to_s
- arch = if macos_version.arch == :arm64
- "arm64"
- else
- "amd64"
- end
- [os, arch, "formula"]
- end
-
+ tab = tag_hash["tab"]
platform_hash = {
- architecture: arch,
- os: os,
- "os.version" => os_version,
+ architecture: tab["arch"],
+ os: tab["built_on"]["os"],
+ "os.version" => tab["built_on"]["os_version"],
}
tar_sha256 = Digest::SHA256.hexdigest(
Utils.safe_popen_read("gunzip", "--stdout", "--decompress", local_file),
)
config_json_sha256, config_json_size = write_image_config(platform_hash, tar_sha256, blobs)
- created_time = tab.source_modified_time
- created_time ||= Time.now
- created_times << created_time
- documentation = "https://formulae.brew.sh/#{formulae_dir}/#{formula_name}" if formula.tap.core_tap?
+ formulae_dir = tag_hash["formulae_brew_sh_path"]
+ documentation = "https://formulae.brew.sh/#{formulae_dir}/#{formula_name}" if formula_core_tap
+
tag = "#{version}.#{bottle_tag}#{rebuild}"
- title = "#{formula.full_name} #{tag}"
annotations_hash = formula_annotations_hash.merge({
- "org.opencontainers.image.created" => created_time.strftime("%F"),
+ "org.opencontainers.image.created" => Time.at(tag_hash["tab"]["source_modified_time"]).strftime("%F"),
"org.opencontainers.image.documentation" => documentation,
"org.opencontainers.image.ref.name" => tag,
- "org.opencontainers.image.title" => title,
+ "org.opencontainers.image.title" => "#{formula_full_name} #{tag}",
}).sort.to_h
annotations_hash.each do |key, value|
annotations_hash.delete(key) if value.blank?
@@ -254,6 +225,8 @@ def upload_bottle(user, token, skopeo, bottle_hash, dry_run:)
platform: platform_hash,
annotations: {
"org.opencontainers.image.ref.name" => tag,
+ "sh.brew.bottle.checksum" => tar_gz_sha256,
+ "sh.brew.tab" => tab.to_json,
},
}
end
@@ -263,7 +236,7 @@ def upload_bottle(user, token, skopeo, bottle_hash, dry_run:)
write_index_json(index_json_sha256, index_json_size, root)
# docker/skopeo insist on lowercase org ("repository name")
- org_prefix = "#{URL_DOMAIN}/#{org.downcase}"
+ org_prefix = "#{DOCKER_PREFIX}#{org.downcase}"
# remove redundant repo prefix for a shorter name
package_name = "#{repo.delete_prefix("homebrew-")}/#{formula_name}"
image_tag = "#{org_prefix}/#{package_name}:#{version_rebuild}" | true |
Other | Homebrew | brew | d8a2cf9efcecbc3e2ba48699a7c99cf2242dcae0.json | Write tabs to bottle JSON, optionally not bottle
- Write a subset of the tab required for bottles as an annotation.
- Add option on new bottle creation to skip writing tab into bottle
and instead add it (and other useful metadata) to bottle JSON.
- Read formula information and tab from bottle JSON.
- Write prettier JSON to disk.
- Don't write `HEAD` to tab; this duplicates `HOMEBREW_VERSION`.
- Allow `brew bottle` to use `--json` to generate JSON files from a
local bottle file. | Library/Homebrew/global.rb | @@ -71,6 +71,7 @@
%r{https://api\.github\.com/repos/([\w-]+)/([\w-]+)?/pulls/(\d+)}.freeze
HOMEBREW_PULL_OR_COMMIT_URL_REGEX =
%r[https://github\.com/([\w-]+)/([\w-]+)?/(?:pull/(\d+)|commit/[0-9a-fA-F]{4,40})].freeze
+HOMEBREW_BOTTLES_EXTNAME_REGEX = /\.([a-z0-9_]+)\.bottle\.(?:(\d+)\.)?tar\.gz$/.freeze
require "fileutils"
| true |
Other | Homebrew | brew | d8a2cf9efcecbc3e2ba48699a7c99cf2242dcae0.json | Write tabs to bottle JSON, optionally not bottle
- Write a subset of the tab required for bottles as an annotation.
- Add option on new bottle creation to skip writing tab into bottle
and instead add it (and other useful metadata) to bottle JSON.
- Read formula information and tab from bottle JSON.
- Write prettier JSON to disk.
- Don't write `HEAD` to tab; this duplicates `HOMEBREW_VERSION`.
- Allow `brew bottle` to use `--json` to generate JSON files from a
local bottle file. | Library/Homebrew/tab.rb | @@ -33,17 +33,17 @@ def self.create(formula, compiler, stdlib)
"poured_from_bottle" => false,
"time" => Time.now.to_i,
"source_modified_time" => formula.source_modified_time.to_i,
- "HEAD" => HOMEBREW_REPOSITORY.git_head,
"compiler" => compiler,
"stdlib" => stdlib,
"aliases" => formula.aliases,
"runtime_dependencies" => Tab.runtime_deps_hash(runtime_deps),
"arch" => Hardware::CPU.arch,
"source" => {
- "path" => formula.specified_path.to_s,
- "tap" => formula.tap&.name,
- "spec" => formula.active_spec_sym.to_s,
- "versions" => {
+ "path" => formula.specified_path.to_s,
+ "tap" => formula.tap&.name,
+ "tap_git_head" => formula.tap&.git_head,
+ "spec" => formula.active_spec_sym.to_s,
+ "versions" => {
"stable" => formula.stable&.version.to_s,
"head" => formula.head&.version.to_s,
"version_scheme" => formula.version_scheme,
@@ -188,17 +188,17 @@ def self.empty
"poured_from_bottle" => false,
"time" => nil,
"source_modified_time" => 0,
- "HEAD" => nil,
"stdlib" => nil,
"compiler" => DevelopmentTools.default_compiler,
"aliases" => [],
"runtime_dependencies" => nil,
"arch" => nil,
"source" => {
- "path" => nil,
- "tap" => nil,
- "spec" => "stable",
- "versions" => {
+ "path" => nil,
+ "tap" => nil,
+ "tap_git_head" => nil,
+ "spec" => "stable",
+ "versions" => {
"stable" => nil,
"head" => nil,
"version_scheme" => 0,
@@ -330,17 +330,33 @@ def to_json(options = nil)
"changed_files" => changed_files&.map(&:to_s),
"time" => time,
"source_modified_time" => source_modified_time.to_i,
- "HEAD" => self.HEAD,
"stdlib" => stdlib&.to_s,
"compiler" => compiler&.to_s,
"aliases" => aliases,
"runtime_dependencies" => runtime_dependencies,
"source" => source,
- "arch" => Hardware::CPU.arch,
+ "arch" => arch,
"built_on" => built_on,
}
+ attributes.delete("stdlib") if attributes["stdlib"].blank?
- JSON.generate(attributes, options)
+ JSON.pretty_generate(attributes, options)
+ end
+
+ # a subset of to_json that we care about for bottles
+ def to_bottle_hash
+ attributes = {
+ "homebrew_version" => homebrew_version,
+ "changed_files" => changed_files&.map(&:to_s),
+ "source_modified_time" => source_modified_time.to_i,
+ "stdlib" => stdlib&.to_s,
+ "compiler" => compiler&.to_s,
+ "runtime_dependencies" => runtime_dependencies,
+ "arch" => arch,
+ "built_on" => built_on,
+ }
+ attributes.delete("stdlib") if attributes["stdlib"].blank?
+ attributes
end
def write | true |
Other | Homebrew | brew | d8a2cf9efcecbc3e2ba48699a7c99cf2242dcae0.json | Write tabs to bottle JSON, optionally not bottle
- Write a subset of the tab required for bottles as an annotation.
- Add option on new bottle creation to skip writing tab into bottle
and instead add it (and other useful metadata) to bottle JSON.
- Read formula information and tab from bottle JSON.
- Write prettier JSON to disk.
- Don't write `HEAD` to tab; this duplicates `HOMEBREW_VERSION`.
- Allow `brew bottle` to use `--json` to generate JSON files from a
local bottle file. | Library/Homebrew/test/tab_spec.rb | @@ -42,6 +42,8 @@
"head" => "HEAD-1111111",
},
},
+ "arch" => Hardware::CPU.arch,
+ "built_on" => DevelopmentTools.build_system_info,
)
}
@@ -360,6 +362,7 @@
specify "#to_json" do
json_tab = described_class.new(JSON.parse(tab.to_json))
+ expect(json_tab.homebrew_version).to eq(tab.homebrew_version)
expect(json_tab.used_options.sort).to eq(tab.used_options.sort)
expect(json_tab.unused_options.sort).to eq(tab.unused_options.sort)
expect(json_tab.built_as_bottle).to eq(tab.built_as_bottle)
@@ -368,13 +371,26 @@
expect(json_tab.tap).to eq(tab.tap)
expect(json_tab.spec).to eq(tab.spec)
expect(json_tab.time).to eq(tab.time)
- expect(json_tab.HEAD).to eq(tab.HEAD)
expect(json_tab.compiler).to eq(tab.compiler)
expect(json_tab.stdlib).to eq(tab.stdlib)
expect(json_tab.runtime_dependencies).to eq(tab.runtime_dependencies)
expect(json_tab.stable_version).to eq(tab.stable_version)
expect(json_tab.head_version).to eq(tab.head_version)
expect(json_tab.source["path"]).to eq(tab.source["path"])
+ expect(json_tab.arch).to eq(tab.arch.to_s)
+ expect(json_tab.built_on["os"]).to eq(tab.built_on["os"])
+ end
+
+ specify "#to_bottle_hash" do
+ json_tab = described_class.new(JSON.parse(tab.to_bottle_hash.to_json))
+ expect(json_tab.homebrew_version).to eq(tab.homebrew_version)
+ expect(json_tab.changed_files).to eq(tab.changed_files)
+ expect(json_tab.source_modified_time).to eq(tab.source_modified_time)
+ expect(json_tab.stdlib).to eq(tab.stdlib)
+ expect(json_tab.compiler).to eq(tab.compiler)
+ expect(json_tab.runtime_dependencies).to eq(tab.runtime_dependencies)
+ expect(json_tab.arch).to eq(tab.arch.to_s)
+ expect(json_tab.built_on["os"]).to eq(tab.built_on["os"])
end
specify "::remap_deprecated_options" do | true |
Other | Homebrew | brew | d8a2cf9efcecbc3e2ba48699a7c99cf2242dcae0.json | Write tabs to bottle JSON, optionally not bottle
- Write a subset of the tab required for bottles as an annotation.
- Add option on new bottle creation to skip writing tab into bottle
and instead add it (and other useful metadata) to bottle JSON.
- Read formula information and tab from bottle JSON.
- Write prettier JSON to disk.
- Don't write `HEAD` to tab; this duplicates `HOMEBREW_VERSION`.
- Allow `brew bottle` to use `--json` to generate JSON files from a
local bottle file. | Library/Homebrew/utils/bottles.rb | @@ -24,14 +24,22 @@ def built_as?(f)
def file_outdated?(f, file)
filename = file.basename.to_s
- return if f.bottle.blank? || !filename.match?(Pathname::BOTTLE_EXTNAME_RX)
+ return false if f.bottle.blank?
- bottle_ext = filename[native_regex, 1]
- bottle_url_ext = f.bottle.url[native_regex, 1]
+ bottle_ext, bottle_tag, = extname_tag_rebuild(filename)
+ return false if bottle_ext.blank?
+ return false if bottle_tag != tag.to_s
+
+ bottle_url_ext, = extname_tag_rebuild(f.bottle.url)
bottle_ext && bottle_url_ext && bottle_ext != bottle_url_ext
end
+ def extname_tag_rebuild(filename)
+ HOMEBREW_BOTTLES_EXTNAME_REGEX.match(filename).to_a
+ end
+
+ # TODO: remove when removed from brew-test-bot
sig { returns(Regexp) }
def native_regex
/(\.#{Regexp.escape(tag.to_s)}\.bottle\.(\d+\.)?tar\.gz)$/o | true |
Other | Homebrew | brew | d8a2cf9efcecbc3e2ba48699a7c99cf2242dcae0.json | Write tabs to bottle JSON, optionally not bottle
- Write a subset of the tab required for bottles as an annotation.
- Add option on new bottle creation to skip writing tab into bottle
and instead add it (and other useful metadata) to bottle JSON.
- Read formula information and tab from bottle JSON.
- Write prettier JSON to disk.
- Don't write `HEAD` to tab; this duplicates `HOMEBREW_VERSION`.
- Allow `brew bottle` to use `--json` to generate JSON files from a
local bottle file. | completions/bash/brew | @@ -380,6 +380,7 @@ _brew_bottle() {
--merge
--no-commit
--no-rebuild
+ --only-json-tab
--quiet
--root-url
--skip-relocation | true |
Other | Homebrew | brew | d8a2cf9efcecbc3e2ba48699a7c99cf2242dcae0.json | Write tabs to bottle JSON, optionally not bottle
- Write a subset of the tab required for bottles as an annotation.
- Add option on new bottle creation to skip writing tab into bottle
and instead add it (and other useful metadata) to bottle JSON.
- Read formula information and tab from bottle JSON.
- Write prettier JSON to disk.
- Don't write `HEAD` to tab; this duplicates `HOMEBREW_VERSION`.
- Allow `brew bottle` to use `--json` to generate JSON files from a
local bottle file. | completions/fish/brew.fish | @@ -365,6 +365,7 @@ __fish_brew_complete_arg 'bottle' -l keep-old -d 'If the formula specifies a reb
__fish_brew_complete_arg 'bottle' -l merge -d 'Generate an updated bottle block for a formula and optionally merge it into the formula file. Instead of a formula name, requires the path to a JSON file generated with `brew bottle --json` formula'
__fish_brew_complete_arg 'bottle' -l no-commit -d 'When passed with `--write`, a new commit will not generated after writing changes to the formula file'
__fish_brew_complete_arg 'bottle' -l no-rebuild -d 'If the formula specifies a rebuild version, remove it from the generated DSL'
+__fish_brew_complete_arg 'bottle' -l only-json-tab -d 'When passed with `--json`, the tab will be written to the JSON file but not the bottle'
__fish_brew_complete_arg 'bottle' -l quiet -d 'Make some output more quiet'
__fish_brew_complete_arg 'bottle' -l root-url -d 'Use the specified URL as the root of the bottle\'s URL instead of Homebrew\'s default'
__fish_brew_complete_arg 'bottle' -l skip-relocation -d 'Do not check if the bottle can be marked as relocatable' | true |
Other | Homebrew | brew | d8a2cf9efcecbc3e2ba48699a7c99cf2242dcae0.json | Write tabs to bottle JSON, optionally not bottle
- Write a subset of the tab required for bottles as an annotation.
- Add option on new bottle creation to skip writing tab into bottle
and instead add it (and other useful metadata) to bottle JSON.
- Read formula information and tab from bottle JSON.
- Write prettier JSON to disk.
- Don't write `HEAD` to tab; this duplicates `HOMEBREW_VERSION`.
- Allow `brew bottle` to use `--json` to generate JSON files from a
local bottle file. | completions/zsh/_brew | @@ -453,6 +453,7 @@ _brew_bottle() {
'--merge[Generate an updated bottle block for a formula and optionally merge it into the formula file. Instead of a formula name, requires the path to a JSON file generated with `brew bottle --json` formula]' \
'--no-commit[When passed with `--write`, a new commit will not generated after writing changes to the formula file]' \
'(--keep-old)--no-rebuild[If the formula specifies a rebuild version, remove it from the generated DSL]' \
+ '--only-json-tab[When passed with `--json`, the tab will be written to the JSON file but not the bottle]' \
'--quiet[Make some output more quiet]' \
'--root-url[Use the specified URL as the root of the bottle'\''s URL instead of Homebrew'\''s default]' \
'--skip-relocation[Do not check if the bottle can be marked as relocatable]' \ | true |
Other | Homebrew | brew | d8a2cf9efcecbc3e2ba48699a7c99cf2242dcae0.json | Write tabs to bottle JSON, optionally not bottle
- Write a subset of the tab required for bottles as an annotation.
- Add option on new bottle creation to skip writing tab into bottle
and instead add it (and other useful metadata) to bottle JSON.
- Read formula information and tab from bottle JSON.
- Write prettier JSON to disk.
- Don't write `HEAD` to tab; this duplicates `HOMEBREW_VERSION`.
- Allow `brew bottle` to use `--json` to generate JSON files from a
local bottle file. | docs/Manpage.md | @@ -823,6 +823,8 @@ value, while `--no-rebuild` will remove it.
Write changes to the formula file. A new commit will be generated unless `--no-commit` is passed.
* `--no-commit`:
When passed with `--write`, a new commit will not generated after writing changes to the formula file.
+* `--only-json-tab`:
+ When passed with `--json`, the tab will be written to the JSON file but not the bottle.
* `--root-url`:
Use the specified *`URL`* as the root of the bottle's URL instead of Homebrew's default.
| true |
Other | Homebrew | brew | d8a2cf9efcecbc3e2ba48699a7c99cf2242dcae0.json | Write tabs to bottle JSON, optionally not bottle
- Write a subset of the tab required for bottles as an annotation.
- Add option on new bottle creation to skip writing tab into bottle
and instead add it (and other useful metadata) to bottle JSON.
- Read formula information and tab from bottle JSON.
- Write prettier JSON to disk.
- Don't write `HEAD` to tab; this duplicates `HOMEBREW_VERSION`.
- Allow `brew bottle` to use `--json` to generate JSON files from a
local bottle file. | manpages/brew.1 | @@ -1133,6 +1133,10 @@ Write changes to the formula file\. A new commit will be generated unless \fB\-\
When passed with \fB\-\-write\fR, a new commit will not generated after writing changes to the formula file\.
.
.TP
+\fB\-\-only\-json\-tab\fR
+When passed with \fB\-\-json\fR, the tab will be written to the JSON file but not the bottle\.
+.
+.TP
\fB\-\-root\-url\fR
Use the specified \fIURL\fR as the root of the bottle\'s URL instead of Homebrew\'s default\.
. | true |
Other | Homebrew | brew | 6be0b57a8237b113a27a5243bef9a5469f4cb031.json | formulary: fix constant redefined warning. | Library/Homebrew/formulary.rb | @@ -52,6 +52,7 @@ def self.load_formula(name, path, contents, namespace, flags:)
require "formula"
mod = Module.new
+ remove_const(namespace) if const_defined?(namespace)
const_set(namespace, mod)
begin | false |
Other | Homebrew | brew | a2099461dcd0b04eeada2b441966eb72d5174759.json | cask/dsl/version: remove another invalid character | Library/Homebrew/cask/dsl/version.rb | @@ -19,7 +19,7 @@ class Version < ::String
MAJOR_MINOR_PATCH_REGEX = /^([^.,:]+)(?:.([^.,:]+)(?:.([^.,:]+))?)?/.freeze
- INVALID_CHARACTERS = /[^0-9a-zA-Z.,:\-_+% ]/.freeze
+ INVALID_CHARACTERS = /[^0-9a-zA-Z.,:\-_+ ]/.freeze
class << self
private | false |
Other | Homebrew | brew | 7501d33159aadaabe2435373ceca2bb371aa8ef8.json | Pathname#install_metafiles: skip empty files.
Extracted from #10851 | Library/Homebrew/extend/pathname.rb | @@ -432,6 +432,7 @@ def write_jar_script(target_jar, script_name, java_opts = "", java_version: nil)
def install_metafiles(from = Pathname.pwd)
Pathname(from).children.each do |p|
next if p.directory?
+ next if File.zero?(p)
next unless Metafiles.copy?(p.basename.to_s)
# Some software symlinks these files (see help2man.rb) | true |
Other | Homebrew | brew | 7501d33159aadaabe2435373ceca2bb371aa8ef8.json | Pathname#install_metafiles: skip empty files.
Extracted from #10851 | Library/Homebrew/test/formula_installer_spec.rb | @@ -51,7 +51,8 @@ def temporary_install(formula, **options)
specify "basic installation" do
temporary_install(Testball.new) do |f|
# Test that things made it into the Keg
- expect(f.prefix/"readme").to exist
+ # "readme" is empty, so it should not be installed
+ expect(f.prefix/"readme").not_to exist
expect(f.bin).to be_a_directory
expect(f.bin.children.count).to eq(3) | true |
Other | Homebrew | brew | 9b725a58515f101caa9f1519bc9d5f48c28c18d7.json | cask/dsl/version: reject invalid characters.
There was a `invalid_characters` method already but it was not being
used. | Library/Homebrew/cask/audit.rb | @@ -233,7 +233,6 @@ def check_version
return unless cask.version
check_no_string_version_latest
- check_no_file_separator_in_version
end
def check_no_string_version_latest
@@ -243,14 +242,6 @@ def check_no_string_version_latest
add_error "you should use version :latest instead of version 'latest'"
end
- def check_no_file_separator_in_version
- odebug "Verifying version does not contain '#{File::SEPARATOR}'"
- return unless cask.version.raw_version.is_a?(String)
- return unless cask.version.raw_version.include?(File::SEPARATOR)
-
- add_error "version should not contain '#{File::SEPARATOR}'"
- end
-
def check_sha256
return unless cask.sha256
| true |
Other | Homebrew | brew | 9b725a58515f101caa9f1519bc9d5f48c28c18d7.json | cask/dsl/version: reject invalid characters.
There was a `invalid_characters` method already but it was not being
used. | Library/Homebrew/cask/dsl/version.rb | @@ -19,7 +19,7 @@ class Version < ::String
MAJOR_MINOR_PATCH_REGEX = /^([^.,:]+)(?:.([^.,:]+)(?:.([^.,:]+))?)?/.freeze
- INVALID_CHARACTERS = /[^0-9a-zA-Z.,:\-_]/.freeze
+ INVALID_CHARACTERS = /[^0-9a-zA-Z.,:\-_+% ]/.freeze
class << self
private
@@ -68,10 +68,13 @@ def conversion_method_name(left_divider, right_divider)
def initialize(raw_version)
@raw_version = raw_version
super(raw_version.to_s)
+
+ invalid = invalid_characters
+ raise TypeError, "#{raw_version} contains invalid characters: #{invalid.uniq.join}!" if invalid.present?
end
def invalid_characters
- return [] if latest?
+ return [] if raw_version.blank? || latest?
raw_version.scan(INVALID_CHARACTERS)
end | true |
Other | Homebrew | brew | 9b725a58515f101caa9f1519bc9d5f48c28c18d7.json | cask/dsl/version: reject invalid characters.
There was a `invalid_characters` method already but it was not being
used. | Library/Homebrew/test/cask/audit_spec.rb | @@ -1011,24 +1011,5 @@ def tmp_cask(name, text)
expect(audit.cask.url.cookies).to eq "foo" => "bar"
end
end
-
- context "when the version contains a slash" do
- let(:cask_token) { "foo" }
- let(:cask) do
- tmp_cask cask_token.to_s, <<~RUBY
- cask '#{cask_token}' do
- version '0.1,../../directory/traversal'
- sha256 '8dd95daa037ac02455435446ec7bc737b34567afe9156af7d20b2a83805c1d8a'
- url 'https://brew.sh/foo.zip'
- name 'Audit'
- desc 'Audit Description'
- homepage 'https://brew.sh'
- app 'Audit.app'
- end
- RUBY
- end
-
- it { is_expected.to fail_with(%r{version should not contain '/'}) }
- end
end
end | true |
Other | Homebrew | brew | 9b725a58515f101caa9f1519bc9d5f48c28c18d7.json | cask/dsl/version: reject invalid characters.
There was a `invalid_characters` method already but it was not being
used. | Library/Homebrew/test/cask/dsl/version_spec.rb | @@ -52,6 +52,14 @@
let(:version) { described_class.new(raw_version) }
+ describe "#initialize" do
+ it "raises an error when the version contains a slash" do
+ expect {
+ described_class.new("0.1,../../directory/traversal")
+ }.to raise_error(TypeError, %r{invalid characters: /})
+ end
+ end
+
describe "#==" do
subject { version == other }
| true |
Other | Homebrew | brew | c193cb984847f4e5583d44396016cc66075e34df.json | github_packages: Add annotations to image index
When `brew pr-upload` is run with `--dry-run`, write the OCI directory,
but do not upload it. | Library/Homebrew/dev-cmd/pr-upload.rb | @@ -118,7 +118,7 @@ def pr_upload
Upload bottles described by these JSON files to #{service}:
#{json_files.join("\n ")}
EOS
- return
+ return unless github_packages?(bottles_hash)
end
check_bottled_formulae(bottles_hash)
@@ -151,7 +151,7 @@ def pr_upload
elsif github_packages?(bottles_hash)
github_org = args.github_org || "homebrew"
github_packages = GitHubPackages.new(org: github_org)
- github_packages.upload_bottles(bottles_hash)
+ github_packages.upload_bottles(bottles_hash, dry_run: args.dry_run?)
else
odie "Service specified by root_url is not recognized"
end | true |
Other | Homebrew | brew | c193cb984847f4e5583d44396016cc66075e34df.json | github_packages: Add annotations to image index
When `brew pr-upload` is run with `--dry-run`, write the OCI directory,
but do not upload it. | Library/Homebrew/github_packages.rb | @@ -14,7 +14,8 @@ class GitHubPackages
URL_DOMAIN = "ghcr.io"
URL_PREFIX = "https://#{URL_DOMAIN}/v2/"
- URL_REGEX = %r{#{Regexp.escape(URL_PREFIX)}([\w-]+)/([\w-]+)}.freeze
+ DOCKER_PREFIX = "docker://#{URL_DOMAIN}/"
+ URL_REGEX = %r{(?:#{Regexp.escape(URL_PREFIX)}|#{Regexp.escape(DOCKER_PREFIX)})([\w-]+)/([\w-]+)}.freeze
sig { returns(String) }
def inspect
@@ -30,8 +31,8 @@ def initialize(org: "homebrew")
ENV["HOMEBREW_FORCE_HOMEBREW_ON_LINUX"] = "1" if @github_org == "homebrew" && !OS.mac?
end
- sig { params(bottles_hash: T::Hash[String, T.untyped]).void }
- def upload_bottles(bottles_hash)
+ sig { params(bottles_hash: T::Hash[String, T.untyped], dry_run: T::Boolean).void }
+ def upload_bottles(bottles_hash, dry_run:)
user = Homebrew::EnvConfig.github_packages_user
token = Homebrew::EnvConfig.github_packages_token
@@ -52,7 +53,7 @@ def upload_bottles(bottles_hash)
load_schemas!
bottles_hash.each_value do |bottle_hash|
- upload_bottle(user, token, skopeo, bottle_hash)
+ upload_bottle(user, token, skopeo, bottle_hash, dry_run: dry_run)
end
end
@@ -119,7 +120,7 @@ def validate_schema!(schema_uri, json)
exit 1
end
- def upload_bottle(user, token, skopeo, bottle_hash)
+ def upload_bottle(user, token, skopeo, bottle_hash, dry_run:)
formula_path = HOMEBREW_REPOSITORY/bottle_hash["formula"]["path"]
formula = Formulary.factory(formula_path)
formula_name = formula.name
@@ -131,7 +132,7 @@ def upload_bottle(user, token, skopeo, bottle_hash)
".#{rebuild}"
end
version_rebuild = "#{version}#{rebuild}"
- root = Pathname("#{formula_name}-#{version_rebuild}")
+ root = Pathname("#{formula_name}--#{version_rebuild}")
FileUtils.rm_rf root
write_image_layout(root)
@@ -144,21 +145,30 @@ def upload_bottle(user, token, skopeo, bottle_hash)
git_revision = formula.tap.git_head
git_path = formula_path.to_s.delete_prefix("#{formula.tap.path}/")
source = "https://github.com/#{org}/#{repo}/blob/#{git_revision}/#{git_path}"
+ documentation = if formula.tap.core_tap?
+ "https://formulae.brew.sh/formula/#{formula_name}"
+ else
+ formula.tap.remote
+ end
formula_annotations_hash = {
- "org.opencontainers.image.created" => Time.now.strftime("%F"),
- "org.opencontainers.image.description" => formula.desc,
- "org.opencontainers.image.license" => formula.license,
- "org.opencontainers.image.revision" => git_revision,
- "org.opencontainers.image.source" => source,
- "org.opencontainers.image.url" => formula.homepage,
- "org.opencontainers.image.vendor" => org,
- "org.opencontainers.image.version" => version,
+ "org.opencontainers.image.created" => Time.now.strftime("%F"),
+ "org.opencontainers.image.description" => formula.desc,
+ "org.opencontainers.image.documentation" => documentation,
+ "org.opencontainers.image.license" => formula.license,
+ "org.opencontainers.image.ref.name" => version_rebuild,
+ "org.opencontainers.image.revision" => git_revision,
+ "org.opencontainers.image.source" => source,
+ "org.opencontainers.image.title" => formula.full_name,
+ "org.opencontainers.image.url" => formula.homepage,
+ "org.opencontainers.image.vendor" => org,
+ "org.opencontainers.image.version" => version,
}
formula_annotations_hash.each do |key, value|
formula_annotations_hash.delete(key) if value.blank?
end
+ created_times = []
manifests = bottle_hash["bottle"]["tags"].map do |bottle_tag, tag_hash|
local_file = tag_hash["local_filename"]
odebug "Uploading #{local_file}"
@@ -203,6 +213,7 @@ def upload_bottle(user, token, skopeo, bottle_hash)
created_time = tab.source_modified_time
created_time ||= Time.now
+ created_times << created_time
documentation = "https://formulae.brew.sh/#{formulae_dir}/#{formula_name}" if formula.tap.core_tap?
tag = "#{version}.#{bottle_tag}#{rebuild}"
title = "#{formula.full_name} #{tag}"
@@ -258,11 +269,14 @@ def upload_bottle(user, token, skopeo, bottle_hash)
package_name = "#{repo.delete_prefix("homebrew-")}/#{formula_name}"
image_tag = "#{org_prefix}/#{package_name}:#{version_rebuild}"
puts
- system_command!(skopeo, verbose: true, print_stdout: true, args: [
- "copy", "--all", "--dest-creds=#{user}:#{token}",
- "oci:#{root}", "docker://#{image_tag}"
- ])
- ohai "Uploaded to https://github.com/orgs/Homebrew/packages/container/package/#{package_name}"
+ args = ["copy", "--all", "oci:#{root}", image_tag.to_s]
+ if dry_run
+ puts "#{skopeo} #{args.join(" ")} --dest-creds=#{user}:$HOMEBREW_GITHUB_PACKAGES_TOKEN"
+ else
+ args << "--dest-creds=#{user}:#{token}"
+ system_command!(skopeo, verbose: true, print_stdout: true, args: args)
+ ohai "Uploaded to https://github.com/orgs/Homebrew/packages/container/package/#{package_name}"
+ end
end
def write_image_layout(root) | true |
Other | Homebrew | brew | a631377fd21f4dfc645b8d0c2d0311c7e4016301.json | pr-upload: Fix GitHub Packages for Linux
Fix GitHub Packages for Linux and third-party taps.
- Copy all architecture images using `skopeo copy --all` | Library/Homebrew/github_packages.rb | @@ -259,7 +259,7 @@ def upload_bottle(user, token, skopeo, bottle_hash)
image_tag = "#{org_prefix}/#{package_name}:#{version_rebuild}"
puts
system_command!(skopeo, verbose: true, print_stdout: true, args: [
- "copy", "--dest-creds=#{user}:#{token}",
+ "copy", "--all", "--dest-creds=#{user}:#{token}",
"oci:#{root}", "docker://#{image_tag}"
])
ohai "Uploaded to https://github.com/orgs/Homebrew/packages/container/package/#{package_name}" | false |
Other | Homebrew | brew | 725f2828b4ec27e43c4cc0086cc8b2894c91f7d2.json | github_packages: add mediaType comment. | Library/Homebrew/github_packages.rb | @@ -290,6 +290,7 @@ def write_image_config(platform_hash, tar_sha256, blobs)
def write_image_index(manifests, blobs, annotations)
image_index = {
+ # Currently needed for correct multi-arch display in GitHub Packages UI
mediaType: "application/vnd.docker.distribution.manifest.list.v2+json",
schemaVersion: 2,
manifests: manifests, | false |
Other | Homebrew | brew | 5f31ebd8d4e617aed9bc73f5a831981590ad2824.json | github_packages: use json_schemer gem.
Instead of the deprecated json-schema. | .gitignore | @@ -84,7 +84,6 @@
**/vendor/bundle/ruby/*/gems/thread_safe-*/lib/thread_safe/util
# Ignore dependencies we don't wish to vendor
-**/vendor/bundle/ruby/*/gems/addressable-*/
**/vendor/bundle/ruby/*/gems/ast-*/
**/vendor/bundle/ruby/*/gems/bootsnap-*/
**/vendor/bundle/ruby/*/gems/bundler-*/
@@ -97,11 +96,14 @@
**/vendor/bundle/ruby/*/gems/diff-lcs-*/
**/vendor/bundle/ruby/*/gems/docile-*/
**/vendor/bundle/ruby/*/gems/domain_name-*/
+**/vendor/bundle/ruby/*/gems/ecma-re-validator-*/
+**/vendor/bundle/ruby/*/gems/hana-*/
**/vendor/bundle/ruby/*/gems/highline-*/
**/vendor/bundle/ruby/*/gems/http-cookie-*/
**/vendor/bundle/ruby/*/gems/hpricot-*/
**/vendor/bundle/ruby/*/gems/jaro_winkler-*/
**/vendor/bundle/ruby/*/gems/json-*/
+**/vendor/bundle/ruby/*/gems/json_schemer-*/
**/vendor/bundle/ruby/*/gems/method_source-*/
**/vendor/bundle/ruby/*/gems/mime-types-data-*/
**/vendor/bundle/ruby/*/gems/mime-types-*/
@@ -120,7 +122,6 @@
**/vendor/bundle/ruby/*/gems/powerpack-*/
**/vendor/bundle/ruby/*/gems/psych-*/
**/vendor/bundle/ruby/*/gems/pry-*/
-**/vendor/bundle/ruby/*/gems/public_suffix-*/
**/vendor/bundle/ruby/*/gems/racc-*/
**/vendor/bundle/ruby/*/gems/rainbow-*/
**/vendor/bundle/ruby/*/gems/rdiscount-*/
@@ -152,6 +153,7 @@
**/vendor/bundle/ruby/*/gems/unf_ext-*/
**/vendor/bundle/ruby/*/gems/unf-*/
**/vendor/bundle/ruby/*/gems/unicode-display_width-*/
+**/vendor/bundle/ruby/*/gems/uri_template-*/
**/vendor/bundle/ruby/*/gems/webrobots-*/
# Ignore `bin` contents (again). | true |
Other | Homebrew | brew | 5f31ebd8d4e617aed9bc73f5a831981590ad2824.json | github_packages: use json_schemer gem.
Instead of the deprecated json-schema. | Library/Homebrew/github_packages.rb | @@ -46,10 +46,8 @@ def upload_bottles(bottles_hash)
end
# TODO: these dependencies are installed but cannot be required automatically.
- Homebrew.install_gem!("public_suffix")
- Homebrew.install_gem!("addressable")
- Homebrew.install_gem!("json-schema")
- require "json-schema"
+ Homebrew.install_gem!("json_schemer")
+ require "json_schemer"
load_schemas!
@@ -97,13 +95,30 @@ def schema_uri(basename, uris)
out, = curl_output(url)
json = JSON.parse(out)
+ @schema_json ||= {}
Array(uris).each do |uri|
- schema = JSON::Schema.new(json, uri)
- schema.uri = uri
- JSON::Validator.add_schema(schema)
+ @schema_json[uri] = json
end
end
+ def schema_resolver(uri)
+ @schema_json[uri.to_s.gsub(/#.*/, "")]
+ end
+
+ def validate_schema!(schema_uri, json)
+ schema = JSONSchemer.schema(@schema_json[schema_uri], ref_resolver: method(:schema_resolver))
+ json = json.deep_stringify_keys
+ return if schema.valid?(json)
+
+ puts
+ ofail "#{Formatter.url(schema_uri)} JSON schema validation failed!"
+ oh1 "Errors"
+ pp schema.validate(json).to_a
+ oh1 "JSON"
+ pp json
+ exit 1
+ end
+
def upload_bottle(user, token, skopeo, formula_name, bottle_hash)
_, org, repo, = *bottle_hash["bottle"]["root_url"].match(URL_REGEX)
@@ -217,7 +232,7 @@ def upload_bottle(user, token, skopeo, formula_name, bottle_hash)
}],
annotations: annotations_hash,
}
- JSON::Validator.validate!(IMAGE_MANIFEST_SCHEMA_URI, image_manifest)
+ validate_schema!(IMAGE_MANIFEST_SCHEMA_URI, image_manifest)
manifest_json_sha256, manifest_json_size = write_hash(blobs, image_manifest)
{
@@ -244,7 +259,7 @@ def upload_bottle(user, token, skopeo, formula_name, bottle_hash)
def write_image_layout(root)
image_layout = { imageLayoutVersion: "1.0.0" }
- JSON::Validator.validate!(IMAGE_LAYOUT_SCHEMA_URI, image_layout)
+ validate_schema!(IMAGE_LAYOUT_SCHEMA_URI, image_layout)
write_hash(root, image_layout, "oci-layout")
end
@@ -262,7 +277,7 @@ def write_image_config(platform_hash, tar_sha256, blobs)
diff_ids: ["sha256:#{tar_sha256}"],
},
})
- JSON::Validator.validate!(IMAGE_CONFIG_SCHEMA_URI, image_config)
+ validate_schema!(IMAGE_CONFIG_SCHEMA_URI, image_config)
write_hash(blobs, image_config)
end
@@ -272,7 +287,7 @@ def write_image_index(manifests, blobs)
manifests: manifests,
annotations: {},
}
- JSON::Validator.validate!(IMAGE_INDEX_SCHEMA_URI, image_index)
+ validate_schema!(IMAGE_INDEX_SCHEMA_URI, image_index)
write_hash(blobs, image_index)
end
@@ -287,7 +302,7 @@ def write_index_json(index_json_sha256, index_json_size, root)
}],
annotations: {},
}
- JSON::Validator.validate!(IMAGE_INDEX_SCHEMA_URI, index_json)
+ validate_schema!(IMAGE_INDEX_SCHEMA_URI, index_json)
write_hash(root, index_json, "index.json")
end
| true |
Other | Homebrew | brew | 5f31ebd8d4e617aed9bc73f5a831981590ad2824.json | github_packages: use json_schemer gem.
Instead of the deprecated json-schema. | Library/Homebrew/sorbet/rbi/todo.rbi | @@ -4,8 +4,7 @@
# typed: strong
module ::StackProf; end
module DependencyCollector::Compat; end
-module JSON::Schema; end
-module JSON::Validator; end
+module GitHubPackages::JSONSchemer; end
module OS::Mac::Version::NULL; end
module T::InterfaceWrapper::Helpers; end
module T::Private::Abstract::Hooks; end | true |
Other | Homebrew | brew | c3ea073a07cdf14b40102c72bf65419af83bb6ef.json | utils/gems: add dependencies to LOAD_PATH. | Library/Homebrew/utils/gems.rb | @@ -88,7 +88,10 @@ def install_gem!(name, version: nil, setup_gem_environment: true)
specs = Gem.install name, version, document: []
end
- # Add the new specs to the $LOAD_PATH.
+ specs += specs.flat_map(&:runtime_dependencies)
+ .flat_map(&:to_specs)
+
+ # Add the specs to the $LOAD_PATH.
specs.each do |spec|
spec.require_paths.each do |path|
full_path = File.join(spec.full_gem_path, path) | false |
Other | Homebrew | brew | 22053ca2c3cb1b1a214087f1309def98757387bf.json | formula_installer: pass cache key to Dependency.expand | Library/Homebrew/formula_installer.rb | @@ -502,9 +502,8 @@ def check_conflicts
# being installed.
def compute_dependencies
@compute_dependencies ||= begin
- req_map, req_deps = expand_requirements
- check_requirements(req_map)
- expand_dependencies(req_deps + formula.deps)
+ check_requirements(expand_requirements)
+ expand_dependencies
end
end
@@ -550,7 +549,6 @@ def runtime_requirements(formula)
def expand_requirements
unsatisfied_reqs = Hash.new { |h, k| h[k] = [] }
- req_deps = []
formulae = [formula]
formula_deps_map = formula.recursive_dependencies
.index_by(&:name)
@@ -577,17 +575,16 @@ def expand_requirements
end
end
- # Merge the repeated dependencies, which may have different tags.
- req_deps = Dependency.merge_repeats(req_deps)
-
- [unsatisfied_reqs, req_deps]
+ unsatisfied_reqs
end
- def expand_dependencies(deps)
+ def expand_dependencies
inherited_options = Hash.new { |hash, key| hash[key] = Options.new }
pour_bottle = pour_bottle?
- expanded_deps = Dependency.expand(formula, deps) do |dependent, dep|
+ # Cache for this expansion only. FormulaInstaller has a lot of inputs which can alter expansion.
+ cache_key = "FormulaInstaller-#{formula.full_name}-#{Time.now.to_f}"
+ expanded_deps = Dependency.expand(formula, cache_key: cache_key) do |dependent, dep|
inherited_options[dep.name] |= inherited_options_for(dep)
build = effective_build_options_for(
dependent, | false |
Other | Homebrew | brew | 65f52806f6e04f2013838d5c9ecc70eb1b91ab82.json | formula: make bazel write to .brew_home | Library/Homebrew/formula.rb | @@ -1981,6 +1981,9 @@ def setup_home(home)
import site; site.addsitedir("#{HOMEBREW_PREFIX}/lib/python2.7/site-packages")
import sys, os; sys.path = (os.environ["PYTHONPATH"].split(os.pathsep) if "PYTHONPATH" in os.environ else []) + ["#{HOMEBREW_PREFIX}/lib/python2.7/site-packages"] + sys.path
PYTHON
+
+ # Don't let bazel write to tmp directories we don't control or clean.
+ (home/".bazelrc").write "startup --output_user_root=#{home}/_bazel"
end
# Returns a list of Dependency objects that are declared in the formula. | false |
Other | Homebrew | brew | a6e7858cbc95b2526ac481248ac72e8bdc2dc786.json | mktemp: handle dirs with restricted permissions | Library/Homebrew/mktemp.rb | @@ -62,9 +62,23 @@ def run
begin
Dir.chdir(tmpdir) { yield self }
ensure
- ignore_interrupts { rm_rf(tmpdir) } unless retain?
+ ignore_interrupts { chmod_rm_rf(tmpdir) } unless retain?
end
ensure
ohai "Temporary files retained at:", @tmpdir.to_s if retain? && !@tmpdir.nil? && !@quiet
end
+
+ private
+
+ def chmod_rm_rf(path)
+ if path.directory? && !path.symlink?
+ chmod("u+rw", path) if path.owned? # Need permissions in order to see the contents
+ path.children.each { |child| chmod_rm_rf(child) }
+ rmdir(path)
+ else
+ rm_f(path)
+ end
+ rescue
+ nil # Just skip this directory.
+ end
end | false |
Other | Homebrew | brew | eea2055bfd0b812098ddc1a3404d6ed07d80fba1.json | Update RBI files for activesupport. | Library/Homebrew/sorbet/rbi/gems/activesupport@6.1.3.1.rbi | @@ -1,6 +1,6 @@
# DO NOT EDIT MANUALLY
# This is an autogenerated file for types exported from the `activesupport` gem.
-# Please instead update this file by running `tapioca sync`.
+# Please instead update this file by running `bin/tapioca sync`.
# typed: false
@@ -518,10 +518,10 @@ end
class String
include(::Comparable)
- include(::Colorize::InstanceMethods)
include(::JSON::Ext::Generator::GeneratorMethods::String)
- extend(::Colorize::ClassMethods)
+ include(::Colorize::InstanceMethods)
extend(::JSON::Ext::Generator::GeneratorMethods::String::Extend)
+ extend(::Colorize::ClassMethods)
def acts_like_string?; end
def as_json(options = T.unsafe(nil)); end | false |
Other | Homebrew | brew | a0261c4b394d661737e780607248174fb81996e2.json | cask uninstall script: allow tilde expansion to '$HOME' | Library/Homebrew/cask/artifact/abstract_artifact.rb | @@ -30,6 +30,7 @@ def self.dirmethod
def staged_path_join_executable(path)
path = Pathname(path)
+ path = path.expand_path if path.to_s.start_with?("~")
absolute_path = if path.absolute?
path | true |
Other | Homebrew | brew | a0261c4b394d661737e780607248174fb81996e2.json | cask uninstall script: allow tilde expansion to '$HOME' | Library/Homebrew/test/cask/cmd/uninstall_spec.rb | @@ -90,6 +90,30 @@
expect(cask).not_to be_installed
end
+ context "when Casks use script path with `~` as `HOME`" do
+ let(:home_dir) { mktmpdir }
+ let(:app) { Pathname.new("#{home_dir}/MyFancyApp.app") }
+ let(:cask) { Cask::CaskLoader.load(cask_path("with-uninstall-script-user-relative")) }
+
+ before do
+ ENV["HOME"] = home_dir
+ end
+
+ it "can still uninstall them" do
+ Cask::Installer.new(cask).install
+
+ expect(cask).to be_installed
+ expect(app).to exist
+
+ expect {
+ described_class.run("with-uninstall-script-user-relative")
+ }.not_to raise_error
+
+ expect(cask).not_to be_installed
+ expect(app).not_to exist
+ end
+ end
+
describe "when multiple versions of a cask are installed" do
let(:token) { "versioned-cask" }
let(:first_installed_version) { "1.2.3" } | true |
Other | Homebrew | brew | a0261c4b394d661737e780607248174fb81996e2.json | cask uninstall script: allow tilde expansion to '$HOME' | Library/Homebrew/test/support/fixtures/cask/Casks/with-uninstall-script-user-relative.rb | @@ -0,0 +1,21 @@
+cask "with-uninstall-script-user-relative" do
+ version "1.2.3"
+ sha256 "5633c3a0f2e572cbf021507dec78c50998b398c343232bdfc7e26221d0a5db4d"
+
+ url "file://#{TEST_FIXTURE_DIR}/cask/MyFancyApp.zip"
+ homepage "https://brew.sh/MyFancyApp"
+
+ app "MyFancyApp/MyFancyApp.app", target: "~/MyFancyApp.app"
+
+ postflight do
+ IO.write "#{ENV["HOME"]}/MyFancyApp.app/uninstall.sh", <<~SH
+ #!/bin/sh
+ /bin/rm -r "#{ENV["HOME"]}/MyFancyApp.app"
+ SH
+ end
+
+ uninstall script: {
+ executable: "~/MyFancyApp.app/uninstall.sh",
+ sudo: false,
+ }
+end | true |
Other | Homebrew | brew | 92a42381df63456872e7bb0971a50bf91e209ad4.json | Add additional quiet check in update-report | Library/Homebrew/cmd/update-report.rb | @@ -91,10 +91,7 @@ def update_report
"git", "-C", HOMEBREW_REPOSITORY, "tag", "--list", "--sort=-version:refname", "*.*"
).lines.first.chomp
- if new_tag != old_tag
- Settings.write "latesttag", new_tag
- new_repository_version = new_tag
- end
+ new_repository_version = new_tag unless new_tag == old_tag
end
Homebrew.failed = true if ENV["HOMEBREW_UPDATE_FAILED"]
@@ -189,11 +186,13 @@ def update_report
puts_stdout_or_stderr
ohai_stdout_or_stderr "Homebrew was updated to version #{new_repository_version}"
if new_repository_version.split(".").last == "0"
+ Settings.write "latesttag", new_repository_version
puts_stdout_or_stderr <<~EOS
More detailed release notes are available on the Homebrew Blog:
#{Formatter.url("https://brew.sh/blog/#{new_repository_version}")}
EOS
- else
+ elsif !args.quiet?
+ Settings.write "latesttag", new_repository_version
puts_stdout_or_stderr <<~EOS
The changelog can be found at:
#{Formatter.url("https://github.com/Homebrew/brew/releases/tag/#{new_repository_version}")} | false |
Other | Homebrew | brew | d4bca4595acc31bb8c1f93d0b9ad54e4c8a44f07.json | dev-cmd/audit: delete one variable | Library/Homebrew/dev-cmd/audit.rb | @@ -106,7 +106,6 @@ def audit
new_formula = args.new_formula?
strict = new_formula || args.strict?
online = new_formula || args.online?
- git = args.git?
skip_style = args.skip_style? || args.no_named? || args.tap
no_named_args = false
@@ -173,7 +172,7 @@ def audit
new_formula: new_formula,
strict: strict,
online: online,
- git: git,
+ git: args.git?,
only: only,
except: args.except,
spdx_license_data: spdx_license_data, | false |
Other | Homebrew | brew | a3a6af9d99141160dad21ff8f04e9fdcacd274f4.json | cmd/list: remove cask and ls flag conflicts | Library/Homebrew/cmd/list.rb | @@ -57,6 +57,7 @@ def list_args
conflicts "--formula", "--cask"
conflicts "--full-name", "--versions"
conflicts "--pinned", "--multiple"
+ conflicts "--pinned", "--cask"
conflicts "--cask", "--multiple"
["--formula", "--cask", "--full-name", "--versions", "--pinned"].each do |flag|
conflicts "--unbrewed", flag
@@ -68,7 +69,6 @@ def list_args
end
["--pinned", "-l", "-r", "-t"].each do |flag|
conflicts "--full-name", flag
- conflicts "--cask", flag
end
named_args [:installed_formula, :installed_cask] | false |
Other | Homebrew | brew | 0b39690e5c4c8b4b84c8e13c162ef77b8e9a4037.json | os/mac/xcode: update Clang version parsing for CLT 12.5 | Library/Homebrew/os/mac/xcode.rb | @@ -353,7 +353,7 @@ def detect_clang_version
end
def detect_version_from_clang_version
- detect_clang_version&.sub(/^(\d+)00\./, "\\1.")
+ detect_clang_version&.sub(/^(\d+)0(\d)\./, "\\1.\\2.")
end
# Version string (a pretty long one) of the CLT package. | false |
Other | Homebrew | brew | 402bf2ec561187d10f3d96bcdedbc0bffd14eea3.json | Update RBI files for parallel_tests. | Library/Homebrew/sorbet/rbi/gems/parallel_tests@3.6.0.rbi | @@ -1,6 +1,6 @@
# DO NOT EDIT MANUALLY
# This is an autogenerated file for types exported from the `parallel_tests` gem.
-# Please instead update this file by running `tapioca sync`.
+# Please instead update this file by running `bin/tapioca sync`.
# typed: true
| false |
Other | Homebrew | brew | eecbd5887c7e85010dd741cc7a957bd30a0c3aed.json | Apply suggestion from review
Co-authored-by: Markus Reiter <me@reitermark.us> | Library/Homebrew/cask/artifact/abstract_uninstall.rb | @@ -312,7 +312,7 @@ def uninstall_script(directives, directive_name: :script, force: false, command:
end
def uninstall_pkgutil(*pkgs, command: nil, **_)
- ohai "Uninstalling packages (your password may be necessary):"
+ ohai "Uninstalling packages; your password may be necessary:"
pkgs.each do |regex|
::Cask::Pkg.all_matching(regex, command).each do |pkg|
puts pkg.package_id | false |
Other | Homebrew | brew | 94737ef41ddc5352289ed3e3f88f3bd34198197d.json | cask: add password warning for pkg uninstall | Library/Homebrew/cask/artifact/abstract_uninstall.rb | @@ -312,7 +312,7 @@ def uninstall_script(directives, directive_name: :script, force: false, command:
end
def uninstall_pkgutil(*pkgs, command: nil, **_)
- ohai "Uninstalling packages:"
+ ohai "Uninstalling packages (your password may be necessary):"
pkgs.each do |regex|
::Cask::Pkg.all_matching(regex, command).each do |pkg|
puts pkg.package_id | false |
Other | Homebrew | brew | 7f272b78758930fa927f24e512eaa4cfaff28f68.json | Update RBI files for rubocop. | Library/Homebrew/sorbet/rbi/gems/rubocop@1.12.0.rbi | @@ -1,6 +1,6 @@
# DO NOT EDIT MANUALLY
# This is an autogenerated file for types exported from the `rubocop` gem.
-# Please instead update this file by running `tapioca sync`.
+# Please instead update this file by running `bin/tapioca sync`.
# typed: true
@@ -184,33 +184,20 @@ class RuboCop::CommentConfig
private
- def all_cop_names; end
def analyze; end
- def analyze_cop(analysis, disabled, line, single_line); end
- def analyze_disabled(analysis, line); end
- def analyze_rest(analysis, line); end
- def analyze_single_line(analysis, line, disabled); end
+ def analyze_cop(analysis, directive); end
+ def analyze_disabled(analysis, directive); end
+ def analyze_rest(analysis, directive); end
+ def analyze_single_line(analysis, directive); end
def cop_line_ranges(analysis); end
- def directive_on_comment_line?(comment); end
- def directive_parts(comment); end
def each_directive; end
- def each_mentioned_cop; end
- def enable_all?(comment); end
def extra_enabled_comments_with_names(extras:, names:); end
- def handle_enable_all(names, extras, comment); end
- def handle_switch(cop_names, names, disabled, extras, comment); end
+ def handle_enable_all(directive, names, extras); end
+ def handle_switch(directive, names, extras); end
def non_comment_token_line_numbers; end
def qualified_cop_name(cop_name); end
end
-RuboCop::CommentConfig::COMMENT_DIRECTIVE_REGEXP = T.let(T.unsafe(nil), Regexp)
-
-RuboCop::CommentConfig::COPS_PATTERN = T.let(T.unsafe(nil), String)
-
-RuboCop::CommentConfig::COP_NAMES_PATTERN = T.let(T.unsafe(nil), String)
-
-RuboCop::CommentConfig::COP_NAME_PATTERN = T.let(T.unsafe(nil), String)
-
class RuboCop::CommentConfig::CopAnalysis < ::Struct
def line_ranges; end
def line_ranges=(_); end
@@ -225,8 +212,6 @@ class RuboCop::CommentConfig::CopAnalysis < ::Struct
end
end
-RuboCop::CommentConfig::REDUNDANT_DISABLE = T.let(T.unsafe(nil), String)
-
class RuboCop::Config
include(::RuboCop::PathUtil)
include(::RuboCop::FileFinder)
@@ -608,6 +593,7 @@ module RuboCop::Cop::Alignment
def end_of_line_comment(line); end
def indentation(node); end
def offset(node); end
+ def register_offense(offense_node, message_node); end
def within?(inner, outer); end
end
@@ -619,7 +605,7 @@ class RuboCop::Cop::AlignmentCorrector
class << self
def align_end(corrector, processed_source, node, align_to); end
- def correct(processed_source, node, column_delta); end
+ def correct(corrector, processed_source, node, column_delta); end
def processed_source; end
private
@@ -1811,37 +1797,39 @@ end
module RuboCop::Cop::Layout
end
-class RuboCop::Cop::Layout::AccessModifierIndentation < ::RuboCop::Cop::Cop
+class RuboCop::Cop::Layout::AccessModifierIndentation < ::RuboCop::Cop::Base
include(::RuboCop::Cop::Alignment)
include(::RuboCop::Cop::ConfigurableEnforcedStyle)
include(::RuboCop::Cop::RangeHelp)
+ extend(::RuboCop::Cop::AutoCorrector)
- def autocorrect(node); end
def on_block(node); end
def on_class(node); end
def on_module(node); end
def on_sclass(node); end
private
+ def autocorrect(corrector, node); end
def check_body(body, node); end
def check_modifier(send_node, end_range); end
def expected_indent_offset; end
- def message(node); end
+ def message(range); end
def unexpected_indent_offset; end
end
RuboCop::Cop::Layout::AccessModifierIndentation::MSG = T.let(T.unsafe(nil), String)
-class RuboCop::Cop::Layout::ArgumentAlignment < ::RuboCop::Cop::Cop
+class RuboCop::Cop::Layout::ArgumentAlignment < ::RuboCop::Cop::Base
include(::RuboCop::Cop::Alignment)
+ extend(::RuboCop::Cop::AutoCorrector)
- def autocorrect(node); end
def on_csend(node); end
def on_send(node); end
private
+ def autocorrect(corrector, node); end
def base_column(node, args); end
def fixed_indentation?; end
def message(_node); end
@@ -1852,29 +1840,34 @@ RuboCop::Cop::Layout::ArgumentAlignment::ALIGN_PARAMS_MSG = T.let(T.unsafe(nil),
RuboCop::Cop::Layout::ArgumentAlignment::FIXED_INDENT_MSG = T.let(T.unsafe(nil), String)
-class RuboCop::Cop::Layout::ArrayAlignment < ::RuboCop::Cop::Cop
+class RuboCop::Cop::Layout::ArrayAlignment < ::RuboCop::Cop::Base
include(::RuboCop::Cop::Alignment)
+ extend(::RuboCop::Cop::AutoCorrector)
- def autocorrect(node); end
def on_array(node); end
private
+ def autocorrect(corrector, node); end
def base_column(node, args); end
def fixed_indentation?; end
- def message(_node); end
+ def message(_range); end
def target_method_lineno(node); end
end
RuboCop::Cop::Layout::ArrayAlignment::ALIGN_ELEMENTS_MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Layout::ArrayAlignment::FIXED_INDENT_MSG = T.let(T.unsafe(nil), String)
-class RuboCop::Cop::Layout::AssignmentIndentation < ::RuboCop::Cop::Cop
+class RuboCop::Cop::Layout::AssignmentIndentation < ::RuboCop::Cop::Base
include(::RuboCop::Cop::CheckAssignment)
include(::RuboCop::Cop::Alignment)
+ extend(::RuboCop::Cop::AutoCorrector)
- def autocorrect(node); end
+
+ private
+
+ def autocorrect(corrector, node); end
def check_assignment(node, rhs); end
def leftmost_multiple_assignment(node); end
end
@@ -1928,10 +1921,10 @@ end
RuboCop::Cop::Layout::BlockAlignment::MSG = T.let(T.unsafe(nil), String)
-class RuboCop::Cop::Layout::BlockEndNewline < ::RuboCop::Cop::Cop
+class RuboCop::Cop::Layout::BlockEndNewline < ::RuboCop::Cop::Base
include(::RuboCop::Cop::Alignment)
+ extend(::RuboCop::Cop::AutoCorrector)
- def autocorrect(node); end
def on_block(node); end
private
@@ -2020,10 +2013,10 @@ RuboCop::Cop::Layout::ClosingHeredocIndentation::MSG_ARG = T.let(T.unsafe(nil),
RuboCop::Cop::Layout::ClosingHeredocIndentation::SIMPLE_HEREDOC = T.let(T.unsafe(nil), String)
-class RuboCop::Cop::Layout::ClosingParenthesisIndentation < ::RuboCop::Cop::Cop
+class RuboCop::Cop::Layout::ClosingParenthesisIndentation < ::RuboCop::Cop::Base
include(::RuboCop::Cop::Alignment)
+ extend(::RuboCop::Cop::AutoCorrector)
- def autocorrect(node); end
def on_begin(node); end
def on_csend(node); end
def on_def(node); end
@@ -2033,6 +2026,7 @@ class RuboCop::Cop::Layout::ClosingParenthesisIndentation < ::RuboCop::Cop::Cop
private
def all_elements_aligned?(elements); end
+ def autocorrect(corrector, node); end
def check(node, elements); end
def check_for_elements(node, elements); end
def check_for_no_elements(node); end
@@ -2048,16 +2042,17 @@ RuboCop::Cop::Layout::ClosingParenthesisIndentation::MSG_ALIGN = T.let(T.unsafe(
RuboCop::Cop::Layout::ClosingParenthesisIndentation::MSG_INDENT = T.let(T.unsafe(nil), String)
-class RuboCop::Cop::Layout::CommentIndentation < ::RuboCop::Cop::Cop
+class RuboCop::Cop::Layout::CommentIndentation < ::RuboCop::Cop::Base
include(::RuboCop::Cop::Alignment)
+ extend(::RuboCop::Cop::AutoCorrector)
- def autocorrect(comment); end
- def investigate(processed_source); end
+ def on_new_investigation; end
private
- def autocorrect_one(comment); end
- def autocorrect_preceding_comments(comment); end
+ def autocorrect(corrector, comment); end
+ def autocorrect_one(corrector, comment); end
+ def autocorrect_preceding_comments(corrector, comment); end
def check(comment); end
def correct_indentation(next_line); end
def less_indented?(line); end
@@ -2121,14 +2116,14 @@ class RuboCop::Cop::Layout::DotPosition < ::RuboCop::Cop::Base
def selector_range(node); end
end
-class RuboCop::Cop::Layout::ElseAlignment < ::RuboCop::Cop::Cop
+class RuboCop::Cop::Layout::ElseAlignment < ::RuboCop::Cop::Base
include(::RuboCop::Cop::ConfigurableEnforcedStyle)
include(::RuboCop::Cop::RangeHelp)
include(::RuboCop::Cop::EndKeywordAlignment)
include(::RuboCop::Cop::Alignment)
include(::RuboCop::Cop::CheckAssignment)
+ extend(::RuboCop::Cop::AutoCorrector)
- def autocorrect(node); end
def on_case(node); end
def on_case_match(node); end
def on_if(node, base = T.unsafe(nil)); end
@@ -2137,6 +2132,7 @@ class RuboCop::Cop::Layout::ElseAlignment < ::RuboCop::Cop::Cop
private
def assignment_node(node); end
+ def autocorrect(corrector, node); end
def base_for_method_definition(node); end
def base_range_of_if(node, base); end
def base_range_of_rescue(node); end
@@ -2559,19 +2555,20 @@ RuboCop::Cop::Layout::ExtraSpacing::MSG_UNALIGNED_ASGN = T.let(T.unsafe(nil), St
RuboCop::Cop::Layout::ExtraSpacing::MSG_UNNECESSARY = T.let(T.unsafe(nil), String)
-class RuboCop::Cop::Layout::FirstArgumentIndentation < ::RuboCop::Cop::Cop
+class RuboCop::Cop::Layout::FirstArgumentIndentation < ::RuboCop::Cop::Base
include(::RuboCop::Cop::Alignment)
include(::RuboCop::Cop::ConfigurableEnforcedStyle)
include(::RuboCop::Cop::RangeHelp)
+ extend(::RuboCop::Cop::AutoCorrector)
- def autocorrect(node); end
def eligible_method_call?(param0 = T.unsafe(nil)); end
def on_csend(node); end
def on_send(node); end
private
def argument_alignment_config; end
+ def autocorrect(corrector, node); end
def bare_operator?(node); end
def base_indentation(node); end
def base_range(send_node, arg_node); end
@@ -2586,18 +2583,19 @@ end
RuboCop::Cop::Layout::FirstArgumentIndentation::MSG = T.let(T.unsafe(nil), String)
-class RuboCop::Cop::Layout::FirstArrayElementIndentation < ::RuboCop::Cop::Cop
+class RuboCop::Cop::Layout::FirstArrayElementIndentation < ::RuboCop::Cop::Base
include(::RuboCop::Cop::Alignment)
include(::RuboCop::Cop::ConfigurableEnforcedStyle)
include(::RuboCop::Cop::MultilineElementIndentation)
+ extend(::RuboCop::Cop::AutoCorrector)
- def autocorrect(node); end
def on_array(node); end
def on_csend(node); end
def on_send(node); end
private
+ def autocorrect(corrector, node); end
def base_description(left_parenthesis); end
def brace_alignment_style; end
def check(array_node, left_parenthesis); end
@@ -2621,24 +2619,26 @@ end
RuboCop::Cop::Layout::FirstArrayElementLineBreak::MSG = T.let(T.unsafe(nil), String)
-class RuboCop::Cop::Layout::FirstHashElementIndentation < ::RuboCop::Cop::Cop
+class RuboCop::Cop::Layout::FirstHashElementIndentation < ::RuboCop::Cop::Base
include(::RuboCop::Cop::Alignment)
include(::RuboCop::Cop::ConfigurableEnforcedStyle)
include(::RuboCop::Cop::MultilineElementIndentation)
+ extend(::RuboCop::Cop::AutoCorrector)
- def autocorrect(node); end
def on_csend(node); end
def on_hash(node); end
def on_send(node); end
private
+ def autocorrect(corrector, node); end
def base_description(left_parenthesis); end
def brace_alignment_style; end
def check(hash_node, left_parenthesis); end
def check_based_on_longest_key(hash_node, left_brace, left_parenthesis); end
def check_right_brace(right_brace, left_brace, left_parenthesis); end
def message(base_description); end
+ def message_for_right_brace(left_parenthesis); end
def separator_style?(first_pair); end
end
@@ -2674,17 +2674,18 @@ end
RuboCop::Cop::Layout::FirstMethodParameterLineBreak::MSG = T.let(T.unsafe(nil), String)
-class RuboCop::Cop::Layout::FirstParameterIndentation < ::RuboCop::Cop::Cop
+class RuboCop::Cop::Layout::FirstParameterIndentation < ::RuboCop::Cop::Base
include(::RuboCop::Cop::Alignment)
include(::RuboCop::Cop::ConfigurableEnforcedStyle)
include(::RuboCop::Cop::MultilineElementIndentation)
+ extend(::RuboCop::Cop::AutoCorrector)
- def autocorrect(node); end
def on_def(node); end
def on_defs(node); end
private
+ def autocorrect(corrector, node); end
def base_description(_); end
def brace_alignment_style; end
def check(def_node); end
@@ -2801,16 +2802,17 @@ RuboCop::Cop::Layout::HeredocIndentation::TYPE_MSG = T.let(T.unsafe(nil), String
RuboCop::Cop::Layout::HeredocIndentation::WIDTH_MSG = T.let(T.unsafe(nil), String)
-class RuboCop::Cop::Layout::IndentationConsistency < ::RuboCop::Cop::Cop
+class RuboCop::Cop::Layout::IndentationConsistency < ::RuboCop::Cop::Base
include(::RuboCop::Cop::Alignment)
include(::RuboCop::Cop::ConfigurableEnforcedStyle)
+ extend(::RuboCop::Cop::AutoCorrector)
- def autocorrect(node); end
def on_begin(node); end
def on_kwbegin(node); end
private
+ def autocorrect(corrector, node); end
def bare_access_modifier?(node); end
def base_column_for_normal_style(node); end
def check(node); end
@@ -2820,36 +2822,37 @@ end
RuboCop::Cop::Layout::IndentationConsistency::MSG = T.let(T.unsafe(nil), String)
-class RuboCop::Cop::Layout::IndentationStyle < ::RuboCop::Cop::Cop
+class RuboCop::Cop::Layout::IndentationStyle < ::RuboCop::Cop::Base
include(::RuboCop::Cop::Alignment)
include(::RuboCop::Cop::ConfigurableEnforcedStyle)
include(::RuboCop::Cop::RangeHelp)
+ extend(::RuboCop::Cop::AutoCorrector)
- def autocorrect(range); end
- def investigate(processed_source); end
+ def on_new_investigation; end
private
- def autocorrect_lambda_for_spaces(range); end
- def autocorrect_lambda_for_tabs(range); end
- def find_offence(line); end
+ def autocorrect(corrector, range); end
+ def autocorrect_lambda_for_spaces(corrector, range); end
+ def autocorrect_lambda_for_tabs(corrector, range); end
+ def find_offence(line, lineno); end
def in_string_literal?(ranges, tabs_range); end
def message(_node); end
def string_literal_ranges(ast); end
end
RuboCop::Cop::Layout::IndentationStyle::MSG = T.let(T.unsafe(nil), String)
-class RuboCop::Cop::Layout::IndentationWidth < ::RuboCop::Cop::Cop
+class RuboCop::Cop::Layout::IndentationWidth < ::RuboCop::Cop::Base
include(::RuboCop::Cop::ConfigurableEnforcedStyle)
include(::RuboCop::Cop::RangeHelp)
include(::RuboCop::Cop::EndKeywordAlignment)
include(::RuboCop::Cop::Alignment)
include(::RuboCop::Cop::CheckAssignment)
include(::RuboCop::Cop::IgnoredPattern)
+ extend(::RuboCop::Cop::AutoCorrector)
def access_modifier?(param0 = T.unsafe(nil)); end
- def autocorrect(node); end
def on_block(node); end
def on_case(case_node); end
def on_class(node); end
@@ -2871,12 +2874,14 @@ class RuboCop::Cop::Layout::IndentationWidth < ::RuboCop::Cop::Cop
private
def access_modifier_indentation_style; end
+ def autocorrect(corrector, node); end
def check_assignment(node, rhs); end
def check_if(node, body, else_clause, base_loc); end
def check_indentation(base_loc, body_node, style = T.unsafe(nil)); end
def check_members(base, members); end
def check_members_for_indented_internal_methods_style(members); end
def check_members_for_normal_style(base, members); end
+ def check_rescue?(rescue_node); end
def configured_indentation_width; end
def each_member(members); end
def indentation_consistency_style; end
@@ -3116,18 +3121,19 @@ RuboCop::Cop::Layout::MultilineMethodCallBraceLayout::NEW_LINE_MESSAGE = T.let(T
RuboCop::Cop::Layout::MultilineMethodCallBraceLayout::SAME_LINE_MESSAGE = T.let(T.unsafe(nil), String)
-class RuboCop::Cop::Layout::MultilineMethodCallIndentation < ::RuboCop::Cop::Cop
+class RuboCop::Cop::Layout::MultilineMethodCallIndentation < ::RuboCop::Cop::Base
include(::RuboCop::Cop::ConfigurableEnforcedStyle)
include(::RuboCop::Cop::Alignment)
include(::RuboCop::Cop::MultilineExpressionIndentation)
+ extend(::RuboCop::Cop::AutoCorrector)
- def autocorrect(node); end
def validate_config; end
private
def align_with_base_message(rhs); end
def alignment_base(node, rhs, given_style); end
+ def autocorrect(corrector, node); end
def base_source; end
def extra_indentation(given_style, parent); end
def message(node, lhs, rhs); end
@@ -3162,34 +3168,36 @@ RuboCop::Cop::Layout::MultilineMethodDefinitionBraceLayout::NEW_LINE_MESSAGE = T
RuboCop::Cop::Layout::MultilineMethodDefinitionBraceLayout::SAME_LINE_MESSAGE = T.let(T.unsafe(nil), String)
-class RuboCop::Cop::Layout::MultilineOperationIndentation < ::RuboCop::Cop::Cop
+class RuboCop::Cop::Layout::MultilineOperationIndentation < ::RuboCop::Cop::Base
include(::RuboCop::Cop::ConfigurableEnforcedStyle)
include(::RuboCop::Cop::Alignment)
include(::RuboCop::Cop::MultilineExpressionIndentation)
+ extend(::RuboCop::Cop::AutoCorrector)
- def autocorrect(node); end
def on_and(node); end
def on_or(node); end
def validate_config; end
private
+ def autocorrect(corrector, node); end
def check_and_or(node); end
def message(node, lhs, rhs); end
def offending_range(node, lhs, rhs, given_style); end
def relevant_node?(node); end
def should_align?(node, rhs, given_style); end
end
-class RuboCop::Cop::Layout::ParameterAlignment < ::RuboCop::Cop::Cop
+class RuboCop::Cop::Layout::ParameterAlignment < ::RuboCop::Cop::Base
include(::RuboCop::Cop::Alignment)
+ extend(::RuboCop::Cop::AutoCorrector)
- def autocorrect(node); end
def on_def(node); end
def on_defs(node); end
private
+ def autocorrect(corrector, node); end
def base_column(node, args); end
def fixed_indentation?; end
def message(_node); end
@@ -4810,6 +4818,7 @@ class RuboCop::Cop::Lint::NumberConversion < ::RuboCop::Cop::Base
def ignore_receiver?(receiver); end
def ignored_class?(name); end
def ignored_classes; end
+ def remove_parentheses(corrector, node); end
def top_receiver(node); end
end
@@ -5377,28 +5386,36 @@ class RuboCop::Cop::Lint::SuppressedException < ::RuboCop::Cop::Base
private
def comment_between_rescue_and_end?(node); end
+ def nil_body?(node); end
end
RuboCop::Cop::Lint::SuppressedException::MSG = T.let(T.unsafe(nil), String)
class RuboCop::Cop::Lint::SymbolConversion < ::RuboCop::Cop::Base
+ include(::RuboCop::Cop::ConfigurableEnforcedStyle)
extend(::RuboCop::Cop::AutoCorrector)
+ def on_hash(node); end
def on_send(node); end
def on_sym(node); end
private
def correct_hash_key(node); end
+ def correct_inconsistent_hash_keys(keys); end
def hash_key?(node); end
def in_alias?(node); end
def in_percent_literal_array?(node); end
def properly_quoted?(source, value); end
+ def quote_type; end
def register_offense(node, correction:, message: T.unsafe(nil)); end
+ def requires_quotes?(sym_node); end
end
RuboCop::Cop::Lint::SymbolConversion::MSG = T.let(T.unsafe(nil), String)
+RuboCop::Cop::Lint::SymbolConversion::MSG_CONSISTENCY = T.let(T.unsafe(nil), String)
+
RuboCop::Cop::Lint::SymbolConversion::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
class RuboCop::Cop::Lint::Syntax < ::RuboCop::Cop::Base
@@ -6783,6 +6800,7 @@ class RuboCop::Cop::Registry
def ==(other); end
def contains_cop_matching?(names); end
def cops; end
+ def department?(name); end
def department_missing?(badge, name); end
def departments; end
def dismiss(cop); end
@@ -6795,6 +6813,7 @@ class RuboCop::Cop::Registry
def freeze; end
def length; end
def names; end
+ def names_for_department(department); end
def options; end
def print_warning(name, path); end
def qualified_cop_name(name, path, warn: T.unsafe(nil)); end
@@ -7263,28 +7282,50 @@ end
RuboCop::Cop::Style::BeginBlock::MSG = T.let(T.unsafe(nil), String)
class RuboCop::Cop::Style::BisectedAttrAccessor < ::RuboCop::Cop::Base
- include(::RuboCop::Cop::VisibilityHelp)
+ include(::RuboCop::Cop::RangeHelp)
extend(::RuboCop::Cop::AutoCorrector)
+ def after_class(class_node); end
+ def after_module(class_node); end
+ def after_sclass(class_node); end
def on_class(class_node); end
def on_module(class_node); end
+ def on_new_investigation; end
def on_sclass(class_node); end
private
- def accessor_macroses(class_node, visibility); end
- def accessor_names(class_node, visibility); end
- def attr_reader?(send_node); end
- def attr_reader_replacement(macro, node, rest_args); end
- def attr_within_visibility_scope?(node, visibility); end
- def attr_writer?(send_node); end
- def check(macro, reader_names, writer_names); end
- def replacement(macro, node); end
- def rest_args(args, reader_names, writer_names); end
+ def correct_reader(corrector, macro, node, range); end
+ def correct_writer(corrector, macro, node, range); end
+ def find_bisection(macros); end
+ def find_macros(class_def); end
+ def register_offense(attr); end
end
RuboCop::Cop::Style::BisectedAttrAccessor::MSG = T.let(T.unsafe(nil), String)
+class RuboCop::Cop::Style::BisectedAttrAccessor::Macro
+ include(::RuboCop::Cop::VisibilityHelp)
+
+ def initialize(node); end
+
+ def all_bisected?; end
+ def attr_names; end
+ def attrs; end
+ def bisect(*names); end
+ def bisected_names; end
+ def bisection; end
+ def node; end
+ def reader?; end
+ def rest; end
+ def visibility; end
+ def writer?; end
+
+ class << self
+ def macro?(node); end
+ end
+end
+
class RuboCop::Cop::Style::BlockComments < ::RuboCop::Cop::Base
include(::RuboCop::Cop::RangeHelp)
extend(::RuboCop::Cop::AutoCorrector)
@@ -7395,13 +7436,15 @@ class RuboCop::Cop::Style::CaseLikeIf < ::RuboCop::Cop::Base
def collect_conditions(node, target, conditions); end
def condition_from_binary_op(lhs, rhs, target); end
def condition_from_equality_node(node, target); end
+ def condition_from_include_or_cover_node(node, target); end
def condition_from_match_node(node, target); end
def condition_from_send_node(node, target); end
def const_reference?(node); end
def correction_range(node); end
def deparenthesize(node); end
def find_target(node); end
def find_target_in_equality_node(node); end
+ def find_target_in_include_or_cover_node(node); end
def find_target_in_match_node(node); end
def find_target_in_send_node(node); end
def regexp_with_named_captures?(node); end
@@ -7907,14 +7950,17 @@ class RuboCop::Cop::Style::Documentation < ::RuboCop::Cop::Base
private
+ def allowed_constants; end
def check(node, body, type); end
def compact_namespace?(node); end
+ def constant_allowed?(node); end
def constant_declaration?(node); end
def macro_only?(body); end
def namespace?(node); end
def nodoc(node); end
def nodoc?(comment, require_all: T.unsafe(nil)); end
def nodoc_comment?(node, require_all: T.unsafe(nil)); end
+ def nodoc_self_or_outer_module?(node); end
end
RuboCop::Cop::Style::Documentation::MSG = T.let(T.unsafe(nil), String)
@@ -8552,12 +8598,12 @@ end
RuboCop::Cop::Style::HashLikeCase::MSG = T.let(T.unsafe(nil), String)
-class RuboCop::Cop::Style::HashSyntax < ::RuboCop::Cop::Cop
+class RuboCop::Cop::Style::HashSyntax < ::RuboCop::Cop::Base
include(::RuboCop::Cop::ConfigurableEnforcedStyle)
include(::RuboCop::Cop::RangeHelp)
+ extend(::RuboCop::Cop::AutoCorrector)
def alternative_style; end
- def autocorrect(node); end
def hash_rockets_check(pairs); end
def no_mixed_keys_check(pairs); end
def on_hash(node); end
@@ -8568,6 +8614,7 @@ class RuboCop::Cop::Style::HashSyntax < ::RuboCop::Cop::Cop
def acceptable_19_syntax_symbol?(sym_name); end
def argument_without_space?(node); end
+ def autocorrect(corrector, node); end
def autocorrect_hash_rockets(corrector, pair_node); end
def autocorrect_no_mixed_keys(corrector, pair_node); end
def autocorrect_ruby19(corrector, pair_node); end
@@ -8976,6 +9023,7 @@ module RuboCop::Cop::Style::MethodCallWithArgsParentheses::OmitParentheses
def allowed_camel_case_method_call?(node); end
def allowed_chained_call_with_parentheses?(node); end
def allowed_multiline_call_with_parentheses?(node); end
+ def allowed_string_interpolation_method_call?(node); end
def ambigious_literal?(node); end
def assigned_before?(node, target); end
def auto_correct(corrector, node); end
@@ -8989,6 +9037,7 @@ module RuboCop::Cop::Style::MethodCallWithArgsParentheses::OmitParentheses
def hash_literal?(node); end
def hash_literal_in_arguments?(node); end
def inside_endless_method_def?(node); end
+ def inside_string_interpolation?(node); end
def legitimate_call_with_parentheses?(node); end
def logical_operator?(node); end
def offense_range(node); end
@@ -8997,6 +9046,7 @@ module RuboCop::Cop::Style::MethodCallWithArgsParentheses::OmitParentheses
def regexp_slash_literal?(node); end
def splat?(node); end
def super_call_without_arguments?(node); end
+ def syntax_like_method_call?(node); end
def ternary_if?(node); end
def unary_literal?(node); end
end
@@ -9350,6 +9400,8 @@ end
class RuboCop::Cop::Style::NegatedIfElseCondition < ::RuboCop::Cop::Base
include(::RuboCop::Cop::RangeHelp)
+ include(::RuboCop::Cop::VisibilityHelp)
+ include(::RuboCop::Cop::CommentsHelp)
extend(::RuboCop::Cop::AutoCorrector)
def double_negation?(param0 = T.unsafe(nil)); end
@@ -9362,6 +9414,7 @@ class RuboCop::Cop::Style::NegatedIfElseCondition < ::RuboCop::Cop::Base
def corrected_ancestor?(node); end
def if_else?(node); end
def negated_condition?(node); end
+ def node_with_comments(node); end
def swap_branches(corrector, node); end
class << self
@@ -10014,6 +10067,7 @@ end
RuboCop::Cop::Style::RedundantAssignment::MSG = T.let(T.unsafe(nil), String)
class RuboCop::Cop::Style::RedundantBegin < ::RuboCop::Cop::Base
+ include(::RuboCop::Cop::RangeHelp)
extend(::RuboCop::Cop::AutoCorrector)
def on_block(node); end
@@ -10023,9 +10077,12 @@ class RuboCop::Cop::Style::RedundantBegin < ::RuboCop::Cop::Base
private
+ def any_ancestor_assignment_node?(node); end
def contain_rescue_or_ensure?(node); end
def empty_begin?(node); end
def register_offense(node); end
+ def replace_begin_with_statement(corrector, offense_range, node); end
+ def valid_begin_assignment?(node); end
def valid_context_using_only_begin?(node); end
end
@@ -10471,16 +10528,17 @@ RuboCop::Cop::Style::RegexpLiteral::MSG_USE_PERCENT_R = T.let(T.unsafe(nil), Str
RuboCop::Cop::Style::RegexpLiteral::MSG_USE_SLASHES = T.let(T.unsafe(nil), String)
-class RuboCop::Cop::Style::RescueModifier < ::RuboCop::Cop::Cop
+class RuboCop::Cop::Style::RescueModifier < ::RuboCop::Cop::Base
include(::RuboCop::Cop::Alignment)
+ include(::RuboCop::Cop::RangeHelp)
include(::RuboCop::Cop::RescueNode)
+ extend(::RuboCop::Cop::AutoCorrector)
- def autocorrect(node); end
def on_resbody(node); end
private
- def corrected_block(node, parenthesized); end
+ def correct_rescue_block(corrector, node, parenthesized); end
def indentation_and_offset(node, parenthesized); end
def parenthesized?(node); end
end
@@ -10744,6 +10802,7 @@ class RuboCop::Cop::Style::SoleNestedConditional < ::RuboCop::Cop::Base
def allow_modifier?; end
def arguments_range(node); end
+ def assigned_variables(condition); end
def autocorrect(corrector, node, if_branch); end
def correct_for_basic_condition_style(corrector, node, if_branch, and_operator); end
def correct_for_comment(corrector, node, if_branch); end
@@ -10752,6 +10811,7 @@ class RuboCop::Cop::Style::SoleNestedConditional < ::RuboCop::Cop::Base
def offending_branch?(branch); end
def replacement_condition(and_operator, condition); end
def requrie_parentheses?(condition); end
+ def use_variable_assignment_in_condition?(condition, if_branch); end
def wrap_condition?(node); end
end
@@ -10841,6 +10901,18 @@ RuboCop::Cop::Style::StderrPuts::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Style::StderrPuts::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
+class RuboCop::Cop::Style::StringChars < ::RuboCop::Cop::Base
+ extend(::RuboCop::Cop::AutoCorrector)
+
+ def on_send(node); end
+end
+
+RuboCop::Cop::Style::StringChars::BAD_ARGUMENTS = T.let(T.unsafe(nil), Array)
+
+RuboCop::Cop::Style::StringChars::MSG = T.let(T.unsafe(nil), String)
+
+RuboCop::Cop::Style::StringChars::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
+
class RuboCop::Cop::Style::StringConcatenation < ::RuboCop::Cop::Base
extend(::RuboCop::Cop::AutoCorrector)
@@ -12046,12 +12118,39 @@ RuboCop::Cop::VisibilityHelp::VISIBILITY_SCOPES = T.let(T.unsafe(nil), Array)
class RuboCop::DirectiveComment
def initialize(comment); end
+ def all_cops?; end
def comment; end
+ def cop_names; end
def cops; end
+ def disabled?; end
+ def enabled_all?; end
+ def line_number; end
def match?(cop_names); end
+ def match_captures; end
+ def mode; end
def range; end
+ def single_line?; end
+
+ private
+
+ def all_cop_names; end
+ def parsed_cop_names; end
+
+ class << self
+ def before_comment(line); end
+ end
end
+RuboCop::DirectiveComment::COPS_PATTERN = T.let(T.unsafe(nil), String)
+
+RuboCop::DirectiveComment::COP_NAMES_PATTERN = T.let(T.unsafe(nil), String)
+
+RuboCop::DirectiveComment::COP_NAME_PATTERN = T.let(T.unsafe(nil), String)
+
+RuboCop::DirectiveComment::DIRECTIVE_COMMENT_REGEXP = T.let(T.unsafe(nil), Regexp)
+
+RuboCop::DirectiveComment::REDUNDANT_COP = T.let(T.unsafe(nil), String)
+
class RuboCop::Error < ::StandardError
end
| false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.