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
3f96d963f7a2e5ff0f084bcb16e7f95e5aa72cfd.json
style: fix inconsistent code style for shell scripts
Library/Homebrew/utils/analytics.sh
@@ -10,7 +10,7 @@ migrate-legacy-uuid-file() { if [[ -f "${legacy_uuid_file}" ]] then - analytics_uuid="$(<"${legacy_uuid_file}")" + analytics_uuid="$(cat "${legacy_uuid_file}")" if [[ -n "${analytics_uuid}" ]] then git config --file="${HOMEBREW_REPOSITORY}/.git/config" --replace-all homebrew.analyticsuuid "${analytics_uuid}" 2>/dev/null @@ -32,7 +32,7 @@ setup-analytics() { local message_seen analytics_disabled message_seen="$(git config --file="${git_config_file}" --get homebrew.analyticsmessage 2>/dev/null)" analytics_disabled="$(git config --file="${git_config_file}" --get homebrew.analyticsdisabled 2>/dev/null)" - if [[ "${message_seen}" != "true" || "${analytics_disabled}" = "true" ]] + if [[ "${message_seen}" != "true" || "${analytics_disabled}" == "true" ]] then # Internal variable for brew's use, to differentiate from user-supplied setting export HOMEBREW_NO_ANALYTICS_THIS_RUN="1"
true
Other
Homebrew
brew
3f96d963f7a2e5ff0f084bcb16e7f95e5aa72cfd.json
style: fix inconsistent code style for shell scripts
Library/Homebrew/utils/lock.sh
@@ -8,7 +8,7 @@ lock() { local lock_dir="${HOMEBREW_PREFIX}/var/homebrew/locks" local lock_file="${lock_dir}/${name}" [[ -d "${lock_dir}" ]] || mkdir -p "${lock_dir}" - if ! [[ -w "${lock_dir}" ]] + if [[ ! -w "${lock_dir}" ]] then odie <<EOS Can't create ${name} lock in ${lock_dir}!
true
Other
Homebrew
brew
3f96d963f7a2e5ff0f084bcb16e7f95e5aa72cfd.json
style: fix inconsistent code style for shell scripts
Library/Homebrew/utils/ruby.sh
@@ -8,14 +8,14 @@ which_all() { fi local executable entries entry retcode=1 - IFS=':' read -r -a entries <<< "${PATH}" # `readarray -d ':' -t` seems not applicable on WSL Bash + IFS=':' read -r -a entries <<<"${PATH}" # `readarray -d ':' -t` seems not applicable on WSL Bash for entry in "${entries[@]}" do executable="${entry}/$1" if [[ -x "${executable}" ]] then echo "${executable}" - retcode=0 # present + retcode=0 # present fi done @@ -46,7 +46,8 @@ find_ruby() { local ruby_exec while read -r ruby_exec do - if test_ruby "${ruby_exec}"; then + if test_ruby "${ruby_exec}" + then echo "${ruby_exec}" break fi @@ -90,7 +91,7 @@ setup-ruby-path() { local upgrade_fail local install_fail - if [[ -n ${HOMEBREW_MACOS} ]] + if [[ -n "${HOMEBREW_MACOS}" ]] then upgrade_fail="Failed to upgrade Homebrew Portable Ruby!" install_fail="Failed to install Homebrew Portable Ruby (and your system version is too old)!" @@ -109,8 +110,8 @@ If there's no Homebrew Portable Ruby available for your processor: vendor_ruby_root="${vendor_dir}/portable-ruby/current" vendor_ruby_path="${vendor_ruby_root}/bin/ruby" vendor_ruby_terminfo="${vendor_ruby_root}/share/terminfo" - vendor_ruby_latest_version=$(<"${vendor_dir}/portable-ruby-version") - vendor_ruby_current_version=$(readlink "${vendor_ruby_root}") + vendor_ruby_latest_version="$(cat "${vendor_dir}/portable-ruby-version")" + vendor_ruby_current_version="$(readlink "${vendor_ruby_root}")" unset HOMEBREW_RUBY_PATH @@ -123,12 +124,12 @@ If there's no Homebrew Portable Ruby available for your processor: then HOMEBREW_RUBY_PATH="${vendor_ruby_path}" TERMINFO_DIRS="${vendor_ruby_terminfo}" - if [[ ${vendor_ruby_current_version} != "${vendor_ruby_latest_version}" ]] + if [[ "${vendor_ruby_current_version}" != "${vendor_ruby_latest_version}" ]] then brew vendor-install ruby || odie "${upgrade_fail}" fi else - HOMEBREW_RUBY_PATH=$(find_ruby) + HOMEBREW_RUBY_PATH="$(find_ruby)" if need_vendored_ruby then brew vendor-install ruby || odie "${install_fail}"
true
Other
Homebrew
brew
3f96d963f7a2e5ff0f084bcb16e7f95e5aa72cfd.json
style: fix inconsistent code style for shell scripts
bin/brew
@@ -114,7 +114,7 @@ then # Skip if variable value is empty. [[ -z "${!VAR}" ]] && continue - FILTERED_ENV+=( "${VAR}=${!VAR}" ) + FILTERED_ENV+=("${VAR}=${!VAR}") done exec /usr/bin/env -i "${FILTERED_ENV[@]}" /bin/bash "${HOMEBREW_LIBRARY}/Homebrew/brew.sh" "$@"
true
Other
Homebrew
brew
3f96d963f7a2e5ff0f084bcb16e7f95e5aa72cfd.json
style: fix inconsistent code style for shell scripts
docs/Common-Issues.md
@@ -17,14 +17,14 @@ After running `brew update`, you receive a Git error warning about untracked fil This is caused by an old bug in in the `update` code that has long since been fixed. However, the nature of the bug requires that you do the following: ```sh -cd $(brew --repository) +cd "$(brew --repository)" git reset --hard FETCH_HEAD ``` If `brew doctor` still complains about uncommitted modifications, also run this command: ```sh -cd $(brew --repository)/Library +cd "$(brew --repository)/Library" git clean -fd ``` @@ -71,7 +71,7 @@ Please report this bug: This happens because an old version of the upgrade command is hanging around for some reason. The fix: ```sh -cd $(brew --repository)/Library/Contributions/examples +cd "$(brew --repository)/Library/Contributions/examples" git clean -n # if this doesn't list anything that you want to keep, then git clean -f # this will remove untracked files ```
true
Other
Homebrew
brew
3f96d963f7a2e5ff0f084bcb16e7f95e5aa72cfd.json
style: fix inconsistent code style for shell scripts
docs/FAQ.md
@@ -55,7 +55,7 @@ Homebrew doesn't support arbitrary mixing and matching of formula versions, so e Which is usually: `~/Library/Caches/Homebrew` ## My Mac `.app`s don’t find Homebrew utilities! -GUI apps on macOS don’t have Homebrew's prefix in their `PATH` by default. If you're on Mountain Lion or later, you can fix this by running `sudo launchctl config user path "$(brew --prefix)/bin:$PATH"` and then rebooting, as documented in `man launchctl`. Note that this sets the launchctl `PATH` for *all users*. For earlier versions of macOS, see [this page](https://developer.apple.com/legacy/library/qa/qa1067/_index.html). +GUI apps on macOS don’t have Homebrew's prefix in their `PATH` by default. If you're on Mountain Lion or later, you can fix this by running `sudo launchctl config user path "$(brew --prefix)/bin:${PATH}"` and then rebooting, as documented in `man launchctl`. Note that this sets the launchctl `PATH` for *all users*. For earlier versions of macOS, see [this page](https://developer.apple.com/legacy/library/qa/qa1067/_index.html). ## How do I contribute to Homebrew? Read our [contribution guidelines](https://github.com/Homebrew/brew/blob/HEAD/CONTRIBUTING.md#contributing-to-homebrew). @@ -84,7 +84,7 @@ We aim to bottle everything. ```sh brew install hub brew update -cd $(brew --repository) +cd "$(brew --repository)" hub pull someone_else ```
true
Other
Homebrew
brew
3f96d963f7a2e5ff0f084bcb16e7f95e5aa72cfd.json
style: fix inconsistent code style for shell scripts
docs/Formula-Cookbook.md
@@ -361,7 +361,7 @@ Everything is built on Git, so contribution is easy: ```sh brew update # required in more ways than you think (initialises the brew git repository if you don't already have it) -cd $(brew --repository homebrew/core) +cd "$(brew --repository homebrew/core)" # Create a new git branch for your formula so your pull request is easy to # modify if any changes come up during review. git checkout -b <some-descriptive-name> origin/master
true
Other
Homebrew
brew
3f96d963f7a2e5ff0f084bcb16e7f95e5aa72cfd.json
style: fix inconsistent code style for shell scripts
docs/Gems,-Eggs-and-Perl-Modules.md
@@ -118,7 +118,7 @@ Then put the appropriate incantation in your shell’s startup, e.g. for [`local::lib`](https://metacpan.org/pod/local::lib) docs. ```sh -eval $(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib) +eval "$(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib)" ``` Now (after you restart your shell) `cpan` or `perl -MCPAN -eshell` etc.
true
Other
Homebrew
brew
3f96d963f7a2e5ff0f084bcb16e7f95e5aa72cfd.json
style: fix inconsistent code style for shell scripts
docs/Homebrew-and-Python.md
@@ -77,7 +77,7 @@ For brewed Python, modules installed with `pip3` or `python3 setup.py install` w The system Python may not know which compiler flags to set in order to build bindings for software installed in Homebrew so you may need to run: ```sh -CFLAGS=-I$(brew --prefix)/include LDFLAGS=-L$(brew --prefix)/lib pip install <package> +CFLAGS="-I$(brew --prefix)/include" LDFLAGS="-L$(brew --prefix)/lib" pip install <package> ``` ## Virtualenv
true
Other
Homebrew
brew
3f96d963f7a2e5ff0f084bcb16e7f95e5aa72cfd.json
style: fix inconsistent code style for shell scripts
docs/Homebrew-linuxbrew-core-Maintainer-Guide.md
@@ -44,9 +44,9 @@ variable, or let `hub fork` add a remote for you. ```bash brew install hub -cd $(brew --repository homebrew/core) +cd "$(brew --repository homebrew/core)" git remote add homebrew https://github.com/Homebrew/homebrew-core.git -hub fork --remote-name=$HOMEBREW_GITHUB_USER +hub fork --remote-name="${HOMEBREW_GITHUB_USER}" ``` Now, let's make sure that our local branch `master` is clean and that @@ -56,7 +56,7 @@ your fork is up-to-date with Homebrew/linuxbrew-core: git checkout master git fetch origin master git reset --hard origin/master -git push --force $HOMEBREW_GITHUB_USER master +git push --force "${HOMEBREW_GITHUB_USER}" master ``` Strictly speaking, there is no need for `git reset --hard @@ -220,8 +220,9 @@ manually, tap `Homebrew/homebrew-linux-dev` and run the following command where the merge commit is `HEAD`: ```sh -for formula in $(brew find-formulae-to-bottle); do - brew request-bottle $formula +for formula in $(brew find-formulae-to-bottle) +do + brew request-bottle "${formula}" done ```
true
Other
Homebrew
brew
3f96d963f7a2e5ff0f084bcb16e7f95e5aa72cfd.json
style: fix inconsistent code style for shell scripts
docs/Homebrew-on-Linux.md
@@ -31,10 +31,10 @@ The prefix `/home/linuxbrew/.linuxbrew` was chosen so that users without admin a Follow the *Next steps* instructions to add Homebrew to your `PATH` and to your bash shell profile script, either `~/.profile` on Debian/Ubuntu or `~/.bash_profile` on CentOS/Fedora/Red Hat. ```sh -test -d ~/.linuxbrew && eval $(~/.linuxbrew/bin/brew shellenv) -test -d /home/linuxbrew/.linuxbrew && eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv) -test -r ~/.bash_profile && echo "eval \$($(brew --prefix)/bin/brew shellenv)" >>~/.bash_profile -echo "eval \$($(brew --prefix)/bin/brew shellenv)" >>~/.profile +test -d ~/.linuxbrew && eval "$(~/.linuxbrew/bin/brew shellenv)" +test -d /home/linuxbrew/.linuxbrew && eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" +test -r ~/.bash_profile && echo "eval \"\$($(brew --prefix)/bin/brew shellenv)\"" >>~/.bash_profile +echo "eval \"\$($(brew --prefix)/bin/brew shellenv)\"" >>~/.profile ``` You're done! Try installing a package: @@ -86,7 +86,7 @@ Extract or `git clone` Homebrew wherever you want. Use `/home/linuxbrew/.linuxbr git clone https://github.com/Homebrew/brew ~/.linuxbrew/Homebrew mkdir ~/.linuxbrew/bin ln -s ~/.linuxbrew/Homebrew/bin/brew ~/.linuxbrew/bin -eval $(~/.linuxbrew/bin/brew shellenv) +eval "$(~/.linuxbrew/bin/brew shellenv)" ``` ## Homebrew on Linux Community
true
Other
Homebrew
brew
3f96d963f7a2e5ff0f084bcb16e7f95e5aa72cfd.json
style: fix inconsistent code style for shell scripts
docs/How-To-Open-a-Homebrew-Pull-Request.md
@@ -15,7 +15,7 @@ Depending on the change you want to make, you need to send the pull request to t * This creates a personal remote repository that you can push to. This is needed because only Homebrew maintainers have push access to the main repositories. 2. Change to the directory containing your Homebrew installation: ```sh - cd $(brew --repository) + cd "$(brew --repository)" ``` 3. Add your pushable forked repository as a new remote: ```sh @@ -29,7 +29,7 @@ Depending on the change you want to make, you need to send the pull request to t * This creates a personal remote repository that you can push to. This is needed because only Homebrew maintainers have push access to the main repositories. 2. Change to the directory containing Homebrew formulae: ```sh - cd $(brew --repository homebrew/core) + cd "$(brew --repository homebrew/core)" ``` 3. Add your pushable forked repository as a new remote: ```sh
true
Other
Homebrew
brew
3f96d963f7a2e5ff0f084bcb16e7f95e5aa72cfd.json
style: fix inconsistent code style for shell scripts
docs/How-to-Build-Software-Outside-Homebrew-with-Homebrew-keg-only-Dependencies.md
@@ -27,21 +27,21 @@ Useful, reliable alternatives exist should you wish to use `keg_only` tools outs You can set flags to give configure scripts or Makefiles a nudge in the right direction. An example of flag setting: ```sh -./configure --prefix=/Users/Dave/Downloads CFLAGS=-I$(brew --prefix)/opt/openssl/include LDFLAGS=-L$(brew --prefix)/opt/openssl/lib +./configure --prefix=/Users/Dave/Downloads CFLAGS="-I$(brew --prefix)/opt/openssl/include" LDFLAGS="-L$(brew --prefix)/opt/openssl/lib" ``` An example using `pip`: ```sh -CFLAGS=-I$(brew --prefix)/opt/icu4c/include LDFLAGS=-L$(brew --prefix)/opt/icu4c/lib pip install pyicu +CFLAGS="-I$(brew --prefix)/opt/icu4c/include" LDFLAGS="-L$(brew --prefix)/opt/icu4c/lib" pip install pyicu ``` ### `PATH` modification You can temporarily prepend your `PATH` with the tool’s `bin` directory, such as: ```sh -export PATH=$(brew --prefix)/opt/openssl/bin:$PATH +export PATH="$(brew --prefix)/opt/openssl/bin:${PATH}" ``` This will prepend that folder to your `PATH`, ensuring any build script that searches the `PATH` will find it first. @@ -55,7 +55,7 @@ If the tool you are attempting to build is [pkg-config](https://en.wikipedia.org An example of this is: ```sh -export PKG_CONFIG_PATH=$(brew --prefix)/opt/openssl/lib/pkgconfig +export PKG_CONFIG_PATH="$(brew --prefix)/opt/openssl/lib/pkgconfig" ``` If you’re curious about the `PKG_CONFIG_PATH` variable `man pkg-config` goes into more detail.
true
Other
Homebrew
brew
3f96d963f7a2e5ff0f084bcb16e7f95e5aa72cfd.json
style: fix inconsistent code style for shell scripts
docs/Manpage.md
@@ -572,7 +572,7 @@ Print export statements. When run in a shell, this installation of Homebrew will The variables `HOMEBREW_PREFIX`, `HOMEBREW_CELLAR` and `HOMEBREW_REPOSITORY` are also exported to avoid querying them multiple times. The variable `HOMEBREW_SHELLENV_PREFIX` will be exported to avoid adding duplicate entries to the environment variables. -Consider adding evaluation of this command's output to your dotfiles (e.g. `~/.profile`, `~/.bash_profile`, or `~/.zprofile`) with: `eval $(brew shellenv)` +Consider adding evaluation of this command's output to your dotfiles (e.g. `~/.profile`, `~/.bash_profile`, or `~/.zprofile`) with: `eval "$(brew shellenv)"` ### `tap` [*`options`*] [*`user`*`/`*`repo`*] [*`URL`*]
true
Other
Homebrew
brew
3f96d963f7a2e5ff0f084bcb16e7f95e5aa72cfd.json
style: fix inconsistent code style for shell scripts
docs/Shell-Completion.md
@@ -13,13 +13,16 @@ Shell completions for external Homebrew commands are not automatically installed To make Homebrew's completions available in `bash`, you must source the definitions as part of your shell's startup. Add the following to your `~/.bash_profile` (or, if it doesn't exist, `~/.profile`): ```sh -if type brew &>/dev/null; then +if type brew &>/dev/null +then HOMEBREW_PREFIX="$(brew --prefix)" - if [[ -r "${HOMEBREW_PREFIX}/etc/profile.d/bash_completion.sh" ]]; then + if [[ -r "${HOMEBREW_PREFIX}/etc/profile.d/bash_completion.sh" ]] + then source "${HOMEBREW_PREFIX}/etc/profile.d/bash_completion.sh" else - for COMPLETION in "${HOMEBREW_PREFIX}/etc/bash_completion.d/"*; do - [[ -r "$COMPLETION" ]] && source "$COMPLETION" + for COMPLETION in "${HOMEBREW_PREFIX}/etc/bash_completion.d/"* + do + [[ -r "${COMPLETION}" ]] && source "${COMPLETION}" done fi fi @@ -35,8 +38,9 @@ If you are using the `bash` formula as your shell (i.e. `bash` >= v4) you should To make Homebrew's completions available in `zsh`, you must get the Homebrew-managed zsh site-functions on your `FPATH` before initialising `zsh`'s completion facility. Add the following to your `~/.zshrc` file: ```sh -if type brew &>/dev/null; then - FPATH=$(brew --prefix)/share/zsh/site-functions:$FPATH +if type brew &>/dev/null +then + FPATH="$(brew --prefix)/share/zsh/site-functions:${FPATH}" autoload -Uz compinit compinit @@ -46,7 +50,7 @@ fi This must be done before `compinit` is called. Note that if you are using Oh My Zsh, it will call `compinit` for you, so this must be done before you call `oh-my-zsh.sh`. This may be done by appending the following line to your `~/.zprofile` after Homebrew's initialization, instead of modifying your `~/.zshrc` as above: ```sh -FPATH=$(brew --prefix)/share/zsh/site-functions:$FPATH +FPATH="$(brew --prefix)/share/zsh/site-functions:${FPATH}" ``` You may also need to forcibly rebuild `zcompdump`:
true
Other
Homebrew
brew
3f96d963f7a2e5ff0f084bcb16e7f95e5aa72cfd.json
style: fix inconsistent code style for shell scripts
docs/Tips-N'-Tricks.md
@@ -28,14 +28,14 @@ In the case of Erlang, this requires renaming the file from `otp_src_R13B03` to `brew --cache -s erlang` will print the correct name of the cached download. This means instead of manually renaming a formula, you can -run `mv the_tarball $(brew --cache -s <formula>)`. +run `mv the_tarball "$(brew --cache -s <formula>)"`. You can also pre-cache the download by using the command `brew fetch <formula>` which also displays the SHA-256 hash. This can be useful for updating formulae to new versions. ## Installing stuff without the Xcode CLT ```sh -brew sh # or: eval $(brew --env) +brew sh # or: eval "$(brew --env)" gem install ronn # or c-programs ```
true
Other
Homebrew
brew
3f96d963f7a2e5ff0f084bcb16e7f95e5aa72cfd.json
style: fix inconsistent code style for shell scripts
manpages/brew.1
@@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "BREW" "1" "August 2021" "Homebrew" "brew" +.TH "BREW" "1" "September 2021" "Homebrew" "brew" . .SH "NAME" \fBbrew\fR \- The Missing Package Manager for macOS (or Linux) @@ -796,7 +796,7 @@ Search for \fItext\fR in the given database\. Print export statements\. When run in a shell, this installation of Homebrew will be added to your \fBPATH\fR, \fBMANPATH\fR, and \fBINFOPATH\fR\. . .P -The variables \fBHOMEBREW_PREFIX\fR, \fBHOMEBREW_CELLAR\fR and \fBHOMEBREW_REPOSITORY\fR are also exported to avoid querying them multiple times\. The variable \fBHOMEBREW_SHELLENV_PREFIX\fR will be exported to avoid adding duplicate entries to the environment variables\. Consider adding evaluation of this command\'s output to your dotfiles (e\.g\. \fB~/\.profile\fR, \fB~/\.bash_profile\fR, or \fB~/\.zprofile\fR) with: \fBeval $(brew shellenv)\fR +The variables \fBHOMEBREW_PREFIX\fR, \fBHOMEBREW_CELLAR\fR and \fBHOMEBREW_REPOSITORY\fR are also exported to avoid querying them multiple times\. The variable \fBHOMEBREW_SHELLENV_PREFIX\fR will be exported to avoid adding duplicate entries to the environment variables\. Consider adding evaluation of this command\'s output to your dotfiles (e\.g\. \fB~/\.profile\fR, \fB~/\.bash_profile\fR, or \fB~/\.zprofile\fR) with: \fBeval "$(brew shellenv)"\fR . .SS "\fBtap\fR [\fIoptions\fR] [\fIuser\fR\fB/\fR\fIrepo\fR] [\fIURL\fR]" Tap a formula repository\.
true
Other
Homebrew
brew
414935fb391117f7449adc8b78fc6758c5a3e5b1.json
shims: enforce usage of Swift-bundled Clang on Linux Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
Library/Homebrew/shims/linux/super/swift
@@ -0,0 +1 @@ +../../super/swift \ No newline at end of file
true
Other
Homebrew
brew
414935fb391117f7449adc8b78fc6758c5a3e5b1.json
shims: enforce usage of Swift-bundled Clang on Linux Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
Library/Homebrew/shims/super/cc
@@ -79,6 +79,8 @@ class Cmd "#{ENV["HOMEBREW_PREFIX"]}/opt/llvm/bin/#{Regexp.last_match(1)}" when /\w\+\+(-\d+(\.\d)?)?$/ case ENV["HOMEBREW_CC"] + when "swift_clang" + "#{ENV["HOMEBREW_PREFIX"]}/opt/swift/libexec/bin/clang++" when /clang/ "clang++" when /llvm-gcc/ @@ -91,6 +93,8 @@ class Cmd # HOMEBREW_CC regardless of what name under which the tool was invoked. if ENV["HOMEBREW_CC"] == "llvm_clang" "#{ENV["HOMEBREW_PREFIX"]}/opt/llvm/bin/clang" + elsif ENV["HOMEBREW_CC"] == "swift_clang" + "#{ENV["HOMEBREW_PREFIX"]}/opt/swift/libexec/bin/clang" else ENV["HOMEBREW_CC"] end
true
Other
Homebrew
brew
414935fb391117f7449adc8b78fc6758c5a3e5b1.json
shims: enforce usage of Swift-bundled Clang on Linux Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
Library/Homebrew/shims/super/swift
@@ -0,0 +1,15 @@ +#!/bin/bash + +# Ensure we use Swift's clang when performing Swift builds. + +export CC="clang" +export CXX="clang++" + +# swift_clang isn't a shim but is used to ensure the cc shim +# points to the compiler inside the swift keg +export HOMEBREW_CC="swift_clang" +export HOMEBREW_CXX="swift_clang++" + +# HOMEBREW_OPT is set by extend/ENV/super.rb +# shellcheck disable=SC2154 +exec "${HOMEBREW_OPT}/swift/bin/swift" "$@"
true
Other
Homebrew
brew
fc056cec59fb752840fe2a7da224d05b70b09860.json
docs: update documentation for shell requirement
docs/Installation.md
@@ -16,7 +16,7 @@ it does it too. You have to confirm everything it will do before it starts. * Command Line Tools (CLT) for Xcode: `xcode-select --install`, [developer.apple.com/downloads](https://developer.apple.com/downloads) or [Xcode](https://itunes.apple.com/us/app/xcode/id497799835) <sup>[3](#3)</sup> -* A Bourne-compatible shell for installation (e.g. `bash` or `zsh`) <sup>[4](#4)</sup> +* The Bourne-again shell for installation (i.e. `bash`) <sup>[4](#4)</sup> ## Git Remote Mirroring @@ -75,5 +75,5 @@ Apple Developer account on older versions of Mac OS X. Sign up for free [here](https://developer.apple.com/register/index.action). <a name="4"><sup>4</sup></a> The one-liner installation method found on -[brew.sh](https://brew.sh) requires a Bourne-compatible shell (e.g. bash or -zsh). Notably, fish, tcsh and csh will not work. +[brew.sh](https://brew.sh) requires the Bourne-again shell, i.e. bash. +Notably, zsh, fish, tcsh and csh will not work.
false
Other
Homebrew
brew
deef3539a87400b7aa15ae537b1c89f48baa5c64.json
Update RBI files for parallel.
Library/Homebrew/sorbet/rbi/gems/parallel@1.21.0.rbi
@@ -27,7 +27,7 @@ module Parallel def create_workers(job_factory, options, &block); end def extract_count_from_options(options); end def process_incoming_jobs(read, write, job_factory, options, &block); end - def replace_worker(job_factory, workers, i, options, blk); end + def replace_worker(job_factory, workers, index, options, blk); end def with_instrumentation(item, index, options); end def work_direct(job_factory, options, &block); end def work_in_processes(job_factory, options, &blk); end
false
Other
Homebrew
brew
4bd7b50a8263fcc845bf1f2b95940c2d87f37ee2.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
@@ -3110,6 +3110,143 @@ class DevelopmentTools extend ::T::Private::Methods::SingletonMethodHooks end +class DidYouMean::ClassNameChecker + def class_name(); end + + def class_names(); end + + def corrections(); end + + def initialize(exception); end + + def scopes(); end +end + +module DidYouMean::Correctable + def corrections(); end + + def original_message(); end + + def spell_checker(); end + + def to_s(); end +end + +module DidYouMean::Jaro + def self.distance(str1, str2); end +end + +module DidYouMean::JaroWinkler + def self.distance(str1, str2); end +end + +class DidYouMean::KeyErrorChecker + def corrections(); end + + def initialize(key_error); end +end + +class DidYouMean::KeyErrorChecker +end + +module DidYouMean::Levenshtein + def self.distance(str1, str2); end + + def self.min3(a, b, c); end +end + +class DidYouMean::MethodNameChecker + def corrections(); end + + def initialize(exception); end + + def method_name(); end + + def method_names(); end + + def names_to_exclude(); end + + def receiver(); end + RB_RESERVED_WORDS = ::T.let(nil, ::T.untyped) +end + +class DidYouMean::NullChecker + def corrections(); end + + def initialize(*arg); end +end + +class DidYouMean::PlainFormatter + def message_for(corrections); end +end + +class DidYouMean::PlainFormatter +end + +class DidYouMean::RequirePathChecker + def corrections(); end + + def initialize(exception); end + + def path(); end +end + +class DidYouMean::RequirePathChecker + def self.requireables(); end +end + +class DidYouMean::TreeSpellChecker + def augment(); end + + def correct(input); end + + def dictionary(); end + + def dictionary_without_leaves(); end + + def dimensions(); end + + def find_leaves(path); end + + def initialize(dictionary:, separator: T.unsafe(nil), augment: T.unsafe(nil)); end + + def plausible_dimensions(input); end + + def possible_paths(states); end + + def separator(); end + + def tree_depth(); end +end + +class DidYouMean::TreeSpellChecker +end + +class DidYouMean::VariableNameChecker + def corrections(); end + + def cvar_names(); end + + def initialize(exception); end + + def ivar_names(); end + + def lvar_names(); end + + def method_names(); end + + def name(); end + RB_RESERVED_WORDS = ::T.let(nil, ::T.untyped) +end + +module DidYouMean + def self.correct_error(error_class, spell_checker); end + + def self.formatter(); end + + def self.formatter=(formatter); end +end + class Dir def children(); end @@ -5155,6 +5292,11 @@ class KeyError include ::DidYouMean::Correctable end +module Language::Java + extend ::T::Private::Methods::MethodHooks + extend ::T::Private::Methods::SingletonMethodHooks +end + module Language::Node extend ::T::Private::Methods::MethodHooks extend ::T::Private::Methods::SingletonMethodHooks @@ -5772,6 +5914,11 @@ class Object def self.yaml_tag(url); end end +module OnOS + extend ::T::Private::Methods::MethodHooks + extend ::T::Private::Methods::SingletonMethodHooks +end + class OpenSSL::ASN1::ASN1Data def indefinite_length(); end
false
Other
Homebrew
brew
3e15023269326bb9c34ca63e360f3178983f7376.json
test/os/mac: fix uses_from_macos_elements tests.
Library/Homebrew/test/os/mac/formula_spec.rb
@@ -33,8 +33,8 @@ expect(f.class.stable.deps.first.name).to eq("foo") expect(f.class.head.deps.first.name).to eq("foo") - expect(f.class.stable.uses_from_macos_elements).to be_empty - expect(f.class.head.uses_from_macos_elements).to be_empty + expect(f.class.stable.uses_from_macos_elements).to eq(["foo"]) + expect(f.class.head.uses_from_macos_elements).to eq(["foo"]) end end
true
Other
Homebrew
brew
3e15023269326bb9c34ca63e360f3178983f7376.json
test/os/mac: fix uses_from_macos_elements tests.
Library/Homebrew/test/os/mac/software_spec_spec.rb
@@ -23,7 +23,7 @@ spec.uses_from_macos("foo", since: :high_sierra) expect(spec.deps.first.name).to eq("foo") - expect(spec.uses_from_macos_elements).to be_empty + expect(spec.uses_from_macos_elements).to eq(["foo"]) end it "works with tags" do
true
Other
Homebrew
brew
e2552d19a65c0f192fe5554f9996f7e5efa5135b.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
@@ -32477,6 +32477,11 @@ module Utils::Svn extend ::T::Private::Methods::SingletonMethodHooks end +class Utils::TopologicalHash + extend ::T::Private::Methods::MethodHooks + extend ::T::Private::Methods::SingletonMethodHooks +end + module Utils extend ::T::Private::Methods::MethodHooks extend ::T::Private::Methods::SingletonMethodHooks
false
Other
Homebrew
brew
b5bc6368b7f79a8c70dae389d48df3964b8c3843.json
cmd/vendor-install.sh: update artifact URL
Library/Homebrew/cmd/vendor-install.sh
@@ -37,7 +37,7 @@ then ruby_URLs=() if [[ -n "${HOMEBREW_ARTIFACT_DOMAIN}" ]] then - ruby_URLs+=("${HOMEBREW_ARTIFACT_DOMAIN}/bottles-portable-ruby/${ruby_FILENAME}") + ruby_URLs+=("${HOMEBREW_ARTIFACT_DOMAIN}/v2/homebrew/portable-ruby/portable-ruby/blobs/sha256:${ruby_SHA}") fi if [[ -n "${HOMEBREW_BOTTLE_DOMAIN}" ]] then
false
Other
Homebrew
brew
5c6d2b154fdc3bcc82bd8b7b1015c500386785d2.json
utils/ruby.sh: remove dependency for `which` command
Library/Homebrew/utils/ruby.sh
@@ -1,9 +1,31 @@ export HOMEBREW_REQUIRED_RUBY_VERSION=2.6.3 +# Search given executable in all PATH entries (remove dependency for `which` command) +which_all() { + if [[ $# -ne 1 ]] + then + return 1 + fi + + local executable entries entry retcode=1 + IFS=':' read -r -a entries <<< "${PATH}" # `readarray -d ':' -t` seems not applicable on WSL Bash + for entry in "${entries[@]}" + do + executable="${entry}/$1" + if [[ -x "${executable}" ]] + then + echo "${executable}" + retcode=0 # present + fi + done + + return "${retcode}" +} + # HOMEBREW_LIBRARY is from the user environment # shellcheck disable=SC2154 test_ruby() { - if [[ ! -x $1 ]] + if [[ ! -x "$1" ]] then return 1 fi @@ -15,22 +37,23 @@ test_ruby() { # HOMEBREW_MACOS is set by brew.sh # HOMEBREW_PATH is set by global.rb -# SC2230 falsely flags `which -a` -# shellcheck disable=SC2154,SC2230 +# shellcheck disable=SC2154 find_ruby() { if [[ -n "${HOMEBREW_MACOS}" ]] then echo "/System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby" else - IFS=$'\n' # Do word splitting on new lines only - for ruby_exec in $(which -a ruby 2>/dev/null) $(PATH=${HOMEBREW_PATH} which -a ruby 2>/dev/null) + local ruby_exec + while read -r ruby_exec do if test_ruby "${ruby_exec}"; then echo "${ruby_exec}" break fi - done - IFS=$' \t\n' # Restore IFS to its default value + done < <( + which_all ruby + PATH="${HOMEBREW_PATH}" which_all ruby + ) fi }
false
Other
Homebrew
brew
14c2afe1d84af5657a3af0f85e194aa619f94661.json
Fix empty gem RBIs for non-vendored dependencies
Library/Homebrew/sorbet/tapioca/require.rb
@@ -1,4 +1,25 @@ # typed: strict # frozen_string_literal: true -# Add your extra requires here +# This should not be made a constant or Tapioca will think it is part of a gem. +dependency_require_map = { + "activesupport" => "active_support", + "ruby-macho" => "macho", +}.freeze + +Bundler.definition.locked_gems.specs.each do |spec| + name = spec.name + + # sorbet(-static) gem contains executables rather than a library + next if name == "sorbet" + next if name == "sorbet-static" + + name = dependency_require_map[name] if dependency_require_map.key?(name) + + require name +rescue LoadError + raise unless name.include?("-") + + name = name.tr("-", "/") + require name +end
false
Other
Homebrew
brew
188ac3413b6abf689294b281898e89be956f0d5c.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/parlour.rbi
@@ -160,5 +160,8 @@ module Cask sig { returns(T::Boolean) } def quarantine?; end + + sig { returns(T::Boolean) } + def quiet?; end end end
false
Other
Homebrew
brew
80bf12d63ffedf7828bc4ef935b39f6199b9aa25.json
Update RBI files for sorbet.
Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi
@@ -18912,10 +18912,6 @@ class REXML::Validation::ValidationException def initialize(msg); end end -class REXML::XPath - def self.match(element, path=T.unsafe(nil), namespaces=T.unsafe(nil), variables=T.unsafe(nil), options=T.unsafe(nil)); end -end - class REXML::XPathParser DEBUG = ::T.let(nil, ::T.untyped) end
true
Other
Homebrew
brew
80bf12d63ffedf7828bc4ef935b39f6199b9aa25.json
Update RBI files for sorbet.
Library/Homebrew/sorbet/rbi/parlour.rbi
@@ -160,5 +160,8 @@ module Cask sig { returns(T::Boolean) } def quarantine?; end + + sig { returns(T::Boolean) } + def quiet?; end end end
true
Other
Homebrew
brew
15e8852128bfe0da12c02d105fabccbed3758b8e.json
upgrade: add install_formula helper method
Library/Homebrew/install.rb
@@ -212,7 +212,10 @@ def install_formula?( elsif f.linked? message = "#{f.name} #{f.linked_version} is already installed" if f.outdated? && !head - return true unless Homebrew::EnvConfig.no_install_upgrade? + unless Homebrew::EnvConfig.no_install_upgrade? + puts "#{message} but outdated" + return true + end onoe <<~EOS #{message} @@ -315,28 +318,9 @@ def install_formula(formula_installer) f.print_tap_action - if f.linked? && f.outdated? && !f.head? && !Homebrew::EnvConfig.no_install_upgrade? - puts "#{f.full_name} #{f.linked_version} is installed but outdated" - kegs = Upgrade.outdated_kegs(f) - linked_kegs = kegs.select(&:linked?) - Upgrade.print_upgrade_message(f, formula_installer.options) - end + upgrade = f.linked? && f.outdated? && !f.head? && !Homebrew::EnvConfig.no_install_upgrade? - kegs.each(&:unlink) if kegs.present? - - formula_installer.install - formula_installer.finish - rescue FormulaInstallationAlreadyAttemptedError - # We already attempted to install f as part of the dependency tree of - # another formula. In that case, don't generate an error, just move on. - nil - ensure - # Re-link kegs if upgrade fails - begin - linked_kegs.each(&:link) if linked_kegs.present? && !f.latest_version_installed? - rescue - nil - end + Upgrade.install_formula(formula_installer, upgrade: upgrade) end private_class_method :install_formula end
true
Other
Homebrew
brew
15e8852128bfe0da12c02d105fabccbed3758b8e.json
upgrade: add install_formula helper method
Library/Homebrew/upgrade.rb
@@ -164,42 +164,50 @@ def create_formula_installer( def upgrade_formula(formula_installer, dry_run: false, verbose: false) formula = formula_installer.formula - kegs = outdated_kegs(formula) - linked_kegs = kegs.select(&:linked?) - if dry_run print_dry_run_dependencies(formula, formula_installer.compute_dependencies) return end formula_installer.check_installation_already_attempted - print_upgrade_message(formula, formula_installer.options) + install_formula(formula_installer, upgrade: true) + rescue BuildError => e + e.dump(verbose: verbose) + puts + Homebrew.failed = true + end + private_class_method :upgrade_formula + + def install_formula(formula_installer, upgrade:) + formula = formula_installer.formula + + if upgrade + print_upgrade_message(formula, formula_installer.options) + + kegs = outdated_kegs(formula) + linked_kegs = kegs.select(&:linked?) + end # first we unlink the currently active keg for this formula otherwise it is # possible for the existing build to interfere with the build we are about to # do! Seriously, it happens! - kegs.each(&:unlink) + kegs.each(&:unlink) if kegs.present? formula_installer.install formula_installer.finish rescue FormulaInstallationAlreadyAttemptedError # We already attempted to upgrade f as part of the dependency tree of # another formula. In that case, don't generate an error, just move on. nil - rescue BuildError => e - e.dump(verbose: verbose) - puts - Homebrew.failed = true ensure # restore previous installation state if build failed begin - linked_kegs.each(&:link) unless formula.latest_version_installed? + linked_kegs.each(&:link) if linked_kegs.present? && !f.latest_version_installed? rescue nil end end - private_class_method :upgrade_formula def check_broken_dependents(installed_formulae) CacheStoreDatabase.use(:linkage) do |db|
true
Other
Homebrew
brew
b0668f4e312c4890972768915233a56fc395e691.json
Use `-s` flag in `uname` call Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
Library/Homebrew/os.rb
@@ -40,7 +40,7 @@ def self.kernel_version # @api public sig { returns(String) } def self.uname - @uname ||= Utils.safe_popen_read("uname").chomp + @uname ||= Utils.safe_popen_read("uname", "-s").chomp end ::OS_VERSION = ENV["HOMEBREW_OS_VERSION"]
false
Other
Homebrew
brew
e8c26e2da9a4888a801045d1681c13d434837ef7.json
use keyword argument
Library/Homebrew/cmd/list.rb
@@ -104,7 +104,7 @@ def list puts full_cask_names if full_cask_names.present? end elsif args.cask? - list_casks(args.named.to_casks, args) + list_casks(args.named.to_casks, args: args) elsif args.pinned? || args.versions? filtered_list args: args elsif args.no_named? @@ -135,7 +135,7 @@ def list formula_names, cask_names = args.named.to_formulae_to_casks(method: :default_kegs) formula_names.each { |keg| PrettyListing.new keg } if formula_names.present? - list_casks(cask_names, args) if cask_names.present? + list_casks(cask_names, args: args) if cask_names.present? end end @@ -168,7 +168,7 @@ def filtered_list(args:) end end - def list_casks(casks, args) + def list_casks(casks, args:) Cask::Cmd::List.list_casks( *casks, one: args.public_send(:"1?"),
false
Other
Homebrew
brew
3751d9d69141f16d97627c2e7503035f8c35a0b7.json
Update Sorbet RBIs
Library/Homebrew/sorbet/rbi/gems/ecma-re-validator@0.3.0.rbi
@@ -0,0 +1,8 @@ +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `ecma-re-validator` gem. +# Please instead update this file by running `bin/tapioca sync`. + +# typed: true + +# THIS IS AN EMPTY RBI FILE. +# see https://github.com/Shopify/tapioca/blob/master/README.md#manual-gem-requires
true
Other
Homebrew
brew
3751d9d69141f16d97627c2e7503035f8c35a0b7.json
Update Sorbet RBIs
Library/Homebrew/sorbet/rbi/gems/hana@1.3.7.rbi
@@ -0,0 +1,8 @@ +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `hana` gem. +# Please instead update this file by running `bin/tapioca sync`. + +# typed: true + +# THIS IS AN EMPTY RBI FILE. +# see https://github.com/Shopify/tapioca/blob/master/README.md#manual-gem-requires
true
Other
Homebrew
brew
3751d9d69141f16d97627c2e7503035f8c35a0b7.json
Update Sorbet RBIs
Library/Homebrew/sorbet/rbi/gems/json_schemer@0.2.18.rbi
@@ -0,0 +1,8 @@ +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `json_schemer` gem. +# Please instead update this file by running `bin/tapioca sync`. + +# typed: true + +# THIS IS AN EMPTY RBI FILE. +# see https://github.com/Shopify/tapioca/blob/master/README.md#manual-gem-requires
true
Other
Homebrew
brew
3751d9d69141f16d97627c2e7503035f8c35a0b7.json
Update Sorbet RBIs
Library/Homebrew/sorbet/rbi/gems/uri_template@0.7.0.rbi
@@ -0,0 +1,8 @@ +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `uri_template` gem. +# Please instead update this file by running `bin/tapioca sync`. + +# typed: true + +# THIS IS AN EMPTY RBI FILE. +# see https://github.com/Shopify/tapioca/blob/master/README.md#manual-gem-requires
true
Other
Homebrew
brew
3751d9d69141f16d97627c2e7503035f8c35a0b7.json
Update Sorbet RBIs
Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi
@@ -7465,6 +7465,16 @@ module ERB::Util def self.unwrapped_html_escape(s); end end +module EcmaReValidator + INVALID_REGEXP = ::T.let(nil, ::T.untyped) + INVALID_TOKENS = ::T.let(nil, ::T.untyped) + UNICODE_CHARACTERS = ::T.let(nil, ::T.untyped) +end + +module EcmaReValidator + def self.valid?(input); end +end + class EmbeddedPatch extend ::T::Private::Methods::MethodHooks extend ::T::Private::Methods::SingletonMethodHooks @@ -8555,6 +8565,110 @@ class HTTP::Cookie def self.parse(set_cookie, origin, options=T.unsafe(nil), &block); end end +module Hana + VERSION = ::T.let(nil, ::T.untyped) +end + +class Hana::Patch + def apply(doc); end + + def initialize(is); end + FROM = ::T.let(nil, ::T.untyped) + VALID = ::T.let(nil, ::T.untyped) + VALUE = ::T.let(nil, ::T.untyped) +end + +class Hana::Patch::Exception +end + +class Hana::Patch::Exception +end + +class Hana::Patch::FailedTestException + def initialize(path, value); end + + def path(); end + + def path=(path); end + + def value(); end + + def value=(value); end +end + +class Hana::Patch::FailedTestException +end + +class Hana::Patch::IndexError +end + +class Hana::Patch::IndexError +end + +class Hana::Patch::InvalidObjectOperationException +end + +class Hana::Patch::InvalidObjectOperationException +end + +class Hana::Patch::InvalidPath +end + +class Hana::Patch::InvalidPath +end + +class Hana::Patch::MissingTargetException +end + +class Hana::Patch::MissingTargetException +end + +class Hana::Patch::ObjectOperationOnArrayException +end + +class Hana::Patch::ObjectOperationOnArrayException +end + +class Hana::Patch::OutOfBoundsException +end + +class Hana::Patch::OutOfBoundsException +end + +class Hana::Patch +end + +class Hana::Pointer + include ::Enumerable + def each(&block); end + + def eval(object); end + + def initialize(path); end + ESC = ::T.let(nil, ::T.untyped) +end + +class Hana::Pointer::Exception +end + +class Hana::Pointer::Exception +end + +class Hana::Pointer::FormatError +end + +class Hana::Pointer::FormatError +end + +class Hana::Pointer + def self.eval(list, object); end + + def self.parse(path); end +end + +module Hana +end + class Hardware::CPU extend ::T::Private::Methods::SingletonMethodHooks def self.lm?(); end @@ -11347,6 +11461,193 @@ JSON::State = JSON::Ext::Generator::State JSON::UnparserError = JSON::GeneratorError +module JSONSchemer + DEFAULT_META_SCHEMA = ::T.let(nil, ::T.untyped) + DRAFT_CLASS_BY_META_SCHEMA = ::T.let(nil, ::T.untyped) + FILE_URI_REF_RESOLVER = ::T.let(nil, ::T.untyped) + VERSION = ::T.let(nil, ::T.untyped) + WINDOWS_URI_PATH_REGEX = ::T.let(nil, ::T.untyped) +end + +class JSONSchemer::CachedRefResolver + def call(uri); end + + def initialize(&ref_resolver); end +end + +class JSONSchemer::CachedRefResolver +end + +module JSONSchemer::Errors +end + +module JSONSchemer::Errors + def self.pretty(error); end +end + +module JSONSchemer::Format + def iri_escape(data); end + + def parse_uri_scheme(data); end + + def valid_date_time?(data); end + + def valid_email?(data); end + + def valid_hostname?(data); end + + def valid_ip?(data, type); end + + def valid_json?(data); end + + def valid_json_pointer?(data); end + + def valid_relative_json_pointer?(data); end + + def valid_spec_format?(data, format); end + + def valid_uri?(data); end + + def valid_uri_reference?(data); end + + def valid_uri_template?(data); end + DATE_TIME_OFFSET_REGEX = ::T.let(nil, ::T.untyped) + EMAIL_REGEX = ::T.let(nil, ::T.untyped) + HOSTNAME_REGEX = ::T.let(nil, ::T.untyped) + INVALID_QUERY_REGEX = ::T.let(nil, ::T.untyped) + JSON_POINTER_REGEX = ::T.let(nil, ::T.untyped) + JSON_POINTER_REGEX_STRING = ::T.let(nil, ::T.untyped) + LABEL_REGEX_STRING = ::T.let(nil, ::T.untyped) + RELATIVE_JSON_POINTER_REGEX = ::T.let(nil, ::T.untyped) +end + +module JSONSchemer::Format +end + +class JSONSchemer::InvalidFileURI +end + +class JSONSchemer::InvalidFileURI +end + +class JSONSchemer::InvalidRefResolution +end + +class JSONSchemer::InvalidRefResolution +end + +class JSONSchemer::InvalidSymbolKey +end + +class JSONSchemer::InvalidSymbolKey +end + +module JSONSchemer::Schema +end + +class JSONSchemer::Schema::Base + include ::JSONSchemer::Format + def ids(); end + + def initialize(schema, format: T.unsafe(nil), insert_property_defaults: T.unsafe(nil), before_property_validation: T.unsafe(nil), after_property_validation: T.unsafe(nil), formats: T.unsafe(nil), keywords: T.unsafe(nil), ref_resolver: T.unsafe(nil)); end + + def valid?(data); end + + def valid_instance?(instance); end + + def validate(data); end + + def validate_instance(instance, &block); end + BOOLEANS = ::T.let(nil, ::T.untyped) + DEFAULT_REF_RESOLVER = ::T.let(nil, ::T.untyped) + ID_KEYWORD = ::T.let(nil, ::T.untyped) + INSERT_DEFAULT_PROPERTY = ::T.let(nil, ::T.untyped) + NET_HTTP_REF_RESOLVER = ::T.let(nil, ::T.untyped) + RUBY_REGEX_ANCHORS_TO_ECMA_262 = ::T.let(nil, ::T.untyped) +end + +class JSONSchemer::Schema::Base::Instance + def after_property_validation(); end + + def after_property_validation=(_); end + + def before_property_validation(); end + + def before_property_validation=(_); end + + def data(); end + + def data=(_); end + + def data_pointer(); end + + def data_pointer=(_); end + + def merge(data: T.unsafe(nil), data_pointer: T.unsafe(nil), schema: T.unsafe(nil), schema_pointer: T.unsafe(nil), parent_uri: T.unsafe(nil), before_property_validation: T.unsafe(nil), after_property_validation: T.unsafe(nil)); end + + def parent_uri(); end + + def parent_uri=(_); end + + def schema(); end + + def schema=(_); end + + def schema_pointer(); end + + def schema_pointer=(_); end +end + +class JSONSchemer::Schema::Base::Instance + def self.[](*arg); end + + def self.members(); end +end + +class JSONSchemer::Schema::Base +end + +class JSONSchemer::Schema::Draft4 + ID_KEYWORD = ::T.let(nil, ::T.untyped) + SUPPORTED_FORMATS = ::T.let(nil, ::T.untyped) +end + +class JSONSchemer::Schema::Draft4 +end + +class JSONSchemer::Schema::Draft6 + SUPPORTED_FORMATS = ::T.let(nil, ::T.untyped) +end + +class JSONSchemer::Schema::Draft6 +end + +class JSONSchemer::Schema::Draft7 + SUPPORTED_FORMATS = ::T.let(nil, ::T.untyped) +end + +class JSONSchemer::Schema::Draft7 +end + +module JSONSchemer::Schema +end + +class JSONSchemer::UnknownRef +end + +class JSONSchemer::UnknownRef +end + +class JSONSchemer::UnsupportedMetaSchema +end + +class JSONSchemer::UnsupportedMetaSchema +end + +module JSONSchemer + def self.schema(schema, **options); end +end + class Keg::ConflictError extend ::T::Private::Methods::MethodHooks extend ::T::Private::Methods::SingletonMethodHooks @@ -13992,8 +14293,6 @@ end class Net::HTTPAlreadyReported end -Net::HTTPClientError::EXCEPTION_TYPE = Net::HTTPServerException - Net::HTTPClientErrorCode = Net::HTTPClientError class Net::HTTPEarlyHints @@ -14005,9 +14304,13 @@ end Net::HTTPFatalErrorCode = Net::HTTPClientError -Net::HTTPInformation::EXCEPTION_TYPE = Net::HTTPError +class Net::HTTPInformation +end + +Net::HTTPInformationCode::EXCEPTION_TYPE = Net::HTTPError -Net::HTTPInformationCode = Net::HTTPInformation +class Net::HTTPInformation +end class Net::HTTPLoopDetected HAS_BODY = ::T.let(nil, ::T.untyped) @@ -14055,8 +14358,6 @@ end class Net::HTTPRangeNotSatisfiable end -Net::HTTPRedirection::EXCEPTION_TYPE = Net::HTTPRetriableError - Net::HTTPRedirectionCode = Net::HTTPRedirection Net::HTTPRequestURITooLarge = Net::HTTPURITooLong @@ -14065,8 +14366,6 @@ Net::HTTPResponceReceiver = Net::HTTPResponse Net::HTTPRetriableCode = Net::HTTPRedirection -Net::HTTPServerError::EXCEPTION_TYPE = Net::HTTPFatalError - Net::HTTPServerErrorCode = Net::HTTPServerError Net::HTTPSession = Net::HTTP @@ -31354,6 +31653,630 @@ module URI def self.get_encoding(label); end end +module URITemplate + def +(other, *args, &block); end + + def /(other, *args, &block); end + + def ==(other, *args, &block); end + + def >>(other, *args, &block); end + + def absolute?(); end + + def concat(other, *args, &block); end + + def concat_without_coercion(other); end + + def eq(other, *args, &block); end + + def eq_without_coercion(other); end + + def expand(variables=T.unsafe(nil)); end + + def expand_partial(variables=T.unsafe(nil)); end + + def host?(); end + + def path_concat(other, *args, &block); end + + def path_concat_without_coercion(other); end + + def pattern(); end + + def relative?(); end + + def scheme?(); end + + def static_characters(); end + + def to_s(); end + + def tokens(); end + + def type(); end + + def variables(); end + HOST_REGEX = ::T.let(nil, ::T.untyped) + SCHEME_REGEX = ::T.let(nil, ::T.untyped) + URI_SPLIT = ::T.let(nil, ::T.untyped) + VERSIONS = ::T.let(nil, ::T.untyped) +end + +module URITemplate::ClassMethods + def convert(x); end + + def included(base); end + + def try_convert(x); end +end + +module URITemplate::ClassMethods +end + +class URITemplate::Colon + include ::URITemplate + def extract(uri); end + + def initialize(pattern); end + + def to_r(); end + + def tokenize!(); end + VAR = ::T.let(nil, ::T.untyped) +end + +class URITemplate::Colon::InvalidValue + include ::URITemplate::InvalidValue + def generate_message(); end + + def initialize(variable, value); end + + def value(); end + + def variable(); end +end + +class URITemplate::Colon::InvalidValue::SplatIsNotAnArray +end + +class URITemplate::Colon::InvalidValue::SplatIsNotAnArray +end + +class URITemplate::Colon::InvalidValue +end + +class URITemplate::Colon::Token +end + +class URITemplate::Colon::Token::Splat + def index(); end + + def initialize(index); end + SPLAT = ::T.let(nil, ::T.untyped) +end + +class URITemplate::Colon::Token::Splat +end + +class URITemplate::Colon::Token::Static + include ::URITemplate::Literal + include ::URITemplate::Token + def initialize(str); end + + def to_r(); end +end + +class URITemplate::Colon::Token::Static +end + +class URITemplate::Colon::Token::Variable + include ::URITemplate::Expression + include ::URITemplate::Token + def expand(vars); end + + def initialize(name); end + + def name(); end + + def to_r(); end +end + +class URITemplate::Colon::Token::Variable +end + +class URITemplate::Colon::Token +end + +class URITemplate::Colon + extend ::URITemplate::ClassMethods +end + +module URITemplate::Expression + include ::URITemplate::Token + def expression?(); end + + def literal?(); end + + def variables(); end +end + +module URITemplate::Expression +end + +module URITemplate::Invalid +end + +module URITemplate::Invalid +end + +module URITemplate::InvalidValue +end + +module URITemplate::InvalidValue +end + +module URITemplate::Literal + include ::URITemplate::Token + def ends_with_slash?(); end + + def expand(_); end + + def expand_partial(_); end + + def expression?(); end + + def literal?(); end + + def size(); end + + def starts_with_slash?(); end + + def string(); end + + def to_s(); end + SLASH = ::T.let(nil, ::T.untyped) +end + +module URITemplate::Literal +end + +class URITemplate::RFC6570 + include ::URITemplate + def ===(*args, &block); end + + def extract(uri_or_match, post_processing=T.unsafe(nil)); end + + def extract_matchdata(matchdata, post_processing); end + + def extract_simple(uri_or_match); end + + def initialize(pattern_or_tokens, options=T.unsafe(nil)); end + + def level(); end + + def match(*args, &block); end + + def options(); end + + def to_r(); end + + def tokenize!(); end + CHARACTER_CLASSES = ::T.let(nil, ::T.untyped) + CONVERT_RESULT = ::T.let(nil, ::T.untyped) + CONVERT_VALUES = ::T.let(nil, ::T.untyped) + DEFAULT_PROCESSING = ::T.let(nil, ::T.untyped) + EXPRESSION = ::T.let(nil, ::T.untyped) + LITERAL = ::T.let(nil, ::T.untyped) + NO_PROCESSING = ::T.let(nil, ::T.untyped) + OPERATORS = ::T.let(nil, ::T.untyped) + TYPE = ::T.let(nil, ::T.untyped) + URI = ::T.let(nil, ::T.untyped) + VAR = ::T.let(nil, ::T.untyped) +end + +module URITemplate::RFC6570::ClassMethods + def try_convert(x); end + + def valid?(pattern); end +end + +module URITemplate::RFC6570::ClassMethods +end + +class URITemplate::RFC6570::Expression + include ::URITemplate::Expression + include ::URITemplate::Token + def arity(); end + + def cut(str, chars); end + + def decode(x, split=T.unsafe(nil)); end + + def empty_literals?(list); end + + def escape(x); end + + def expand(vars); end + + def expand_partial(vars); end + + def extract(position, matched); end + + def initialize(vars); end + + def level(); end + + def pair(key, value, max_length=T.unsafe(nil), &block); end + + def regex_builder(); end + + def transform_array(name, ary, expand, max_length); end + + def transform_hash(name, hsh, expand, max_length); end + + def unescape(x); end + BASE_LEVEL = ::T.let(nil, ::T.untyped) + CHARACTER_CLASS = ::T.let(nil, ::T.untyped) + COMMA = ::T.let(nil, ::T.untyped) + LIST_CONNECTOR = ::T.let(nil, ::T.untyped) + OPERATOR = ::T.let(nil, ::T.untyped) + PAIR_CONNECTOR = ::T.let(nil, ::T.untyped) + PAIR_IF_EMPTY = ::T.let(nil, ::T.untyped) + PREFIX = ::T.let(nil, ::T.untyped) + SEPARATOR = ::T.let(nil, ::T.untyped) + SPLITTER = ::T.let(nil, ::T.untyped) +end + +class URITemplate::RFC6570::Expression::Basic +end + +URITemplate::RFC6570::Expression::Basic::BULK_FOLLOW_UP = URITemplate::RFC6570::Expression::Basic + +URITemplate::RFC6570::Expression::Basic::FOLLOW_UP = URITemplate::RFC6570::Expression::Basic + +class URITemplate::RFC6570::Expression::Basic +end + +module URITemplate::RFC6570::Expression::ClassMethods + def generate_hash_extractor(max_length); end + + def hash_extractor(max_length); end + + def hash_extractors(); end + + def regex_builder(); end +end + +module URITemplate::RFC6570::Expression::ClassMethods +end + +class URITemplate::RFC6570::Expression::FormQuery + BASE_LEVEL = ::T.let(nil, ::T.untyped) + OPERATOR = ::T.let(nil, ::T.untyped) + PREFIX = ::T.let(nil, ::T.untyped) + SEPARATOR = ::T.let(nil, ::T.untyped) +end + +URITemplate::RFC6570::Expression::FormQuery::BULK_FOLLOW_UP = URITemplate::RFC6570::Expression::FormQueryContinuation + +URITemplate::RFC6570::Expression::FormQuery::FOLLOW_UP = URITemplate::RFC6570::Expression::Basic + +class URITemplate::RFC6570::Expression::FormQuery +end + +class URITemplate::RFC6570::Expression::FormQueryContinuation + BASE_LEVEL = ::T.let(nil, ::T.untyped) + OPERATOR = ::T.let(nil, ::T.untyped) + PREFIX = ::T.let(nil, ::T.untyped) + SEPARATOR = ::T.let(nil, ::T.untyped) +end + +URITemplate::RFC6570::Expression::FormQueryContinuation::BULK_FOLLOW_UP = URITemplate::RFC6570::Expression::FormQueryContinuation + +URITemplate::RFC6570::Expression::FormQueryContinuation::FOLLOW_UP = URITemplate::RFC6570::Expression::Basic + +class URITemplate::RFC6570::Expression::FormQueryContinuation +end + +class URITemplate::RFC6570::Expression::Fragment + BASE_LEVEL = ::T.let(nil, ::T.untyped) + CHARACTER_CLASS = ::T.let(nil, ::T.untyped) + OPERATOR = ::T.let(nil, ::T.untyped) + PREFIX = ::T.let(nil, ::T.untyped) +end + +URITemplate::RFC6570::Expression::Fragment::BULK_FOLLOW_UP = URITemplate::RFC6570::Expression::Reserved + +URITemplate::RFC6570::Expression::Fragment::FOLLOW_UP = URITemplate::RFC6570::Expression::Reserved + +class URITemplate::RFC6570::Expression::Fragment +end + +class URITemplate::RFC6570::Expression::Label + BASE_LEVEL = ::T.let(nil, ::T.untyped) + OPERATOR = ::T.let(nil, ::T.untyped) + PREFIX = ::T.let(nil, ::T.untyped) + SEPARATOR = ::T.let(nil, ::T.untyped) +end + +URITemplate::RFC6570::Expression::Label::BULK_FOLLOW_UP = URITemplate::RFC6570::Expression::Label + +URITemplate::RFC6570::Expression::Label::FOLLOW_UP = URITemplate::RFC6570::Expression::Label + +class URITemplate::RFC6570::Expression::Label +end + +class URITemplate::RFC6570::Expression::Named + def self_pair(key, value, max_length=T.unsafe(nil), &block); end + + def to_r_source(); end +end + +class URITemplate::RFC6570::Expression::Named +end + +class URITemplate::RFC6570::Expression::Path + BASE_LEVEL = ::T.let(nil, ::T.untyped) + OPERATOR = ::T.let(nil, ::T.untyped) + PREFIX = ::T.let(nil, ::T.untyped) + SEPARATOR = ::T.let(nil, ::T.untyped) +end + +URITemplate::RFC6570::Expression::Path::BULK_FOLLOW_UP = URITemplate::RFC6570::Expression::Path + +URITemplate::RFC6570::Expression::Path::FOLLOW_UP = URITemplate::RFC6570::Expression::Path + +class URITemplate::RFC6570::Expression::Path +end + +class URITemplate::RFC6570::Expression::PathParameters + BASE_LEVEL = ::T.let(nil, ::T.untyped) + OPERATOR = ::T.let(nil, ::T.untyped) + PAIR_IF_EMPTY = ::T.let(nil, ::T.untyped) + PREFIX = ::T.let(nil, ::T.untyped) + SEPARATOR = ::T.let(nil, ::T.untyped) +end + +URITemplate::RFC6570::Expression::PathParameters::BULK_FOLLOW_UP = URITemplate::RFC6570::Expression::PathParameters + +URITemplate::RFC6570::Expression::PathParameters::FOLLOW_UP = URITemplate::RFC6570::Expression::PathParameters + +class URITemplate::RFC6570::Expression::PathParameters +end + +class URITemplate::RFC6570::Expression::Reserved + BASE_LEVEL = ::T.let(nil, ::T.untyped) + CHARACTER_CLASS = ::T.let(nil, ::T.untyped) + OPERATOR = ::T.let(nil, ::T.untyped) +end + +URITemplate::RFC6570::Expression::Reserved::BULK_FOLLOW_UP = URITemplate::RFC6570::Expression::Reserved + +URITemplate::RFC6570::Expression::Reserved::FOLLOW_UP = URITemplate::RFC6570::Expression::Reserved + +class URITemplate::RFC6570::Expression::Reserved +end + +class URITemplate::RFC6570::Expression::Unnamed + def self_pair(_, value, max_length=T.unsafe(nil), &block); end + + def to_r_source(); end +end + +class URITemplate::RFC6570::Expression::Unnamed +end + +class URITemplate::RFC6570::Expression + extend ::URITemplate::RFC6570::Expression::ClassMethods +end + +class URITemplate::RFC6570::Invalid + include ::URITemplate::Invalid + def initialize(source, position); end + + def pattern(); end + + def position(); end +end + +class URITemplate::RFC6570::Invalid +end + +class URITemplate::RFC6570::Literal + include ::URITemplate::Literal + include ::URITemplate::Token + def initialize(string); end + + def level(); end + + def to_r_source(*_); end +end + +class URITemplate::RFC6570::Literal +end + +class URITemplate::RFC6570::RegexBuilder + def <<(arg); end + + def capture(&block); end + + def character_class(max_length=T.unsafe(nil), min=T.unsafe(nil)); end + + def character_class_with_comma(max_length=T.unsafe(nil), min=T.unsafe(nil)); end + + def escaped_pair_connector(); end + + def escaped_prefix(); end + + def escaped_separator(); end + + def group(capture=T.unsafe(nil)); end + + def initialize(expression_class); end + + def join(); end + + def length(*args); end + + def lookahead(); end + + def negative_lookahead(); end + + def push(*args); end + + def reluctant(); end + + def separated_list(first=T.unsafe(nil), length=T.unsafe(nil), min=T.unsafe(nil), &block); end +end + +class URITemplate::RFC6570::RegexBuilder +end + +class URITemplate::RFC6570::Token +end + +class URITemplate::RFC6570::Token +end + +class URITemplate::RFC6570::Tokenizer + include ::Enumerable + def each(&blk); end + + def initialize(source, ops); end + + def source(); end +end + +class URITemplate::RFC6570::Tokenizer +end + +module URITemplate::RFC6570::Utils + include ::URITemplate::Utils + include ::URITemplate::Utils::StringEncoding + include ::URITemplate::Utils::StringEncoding::Encode + include ::URITemplate::Utils::Escaping::Pure + def def?(value); end +end + +module URITemplate::RFC6570::Utils + extend ::URITemplate::RFC6570::Utils + extend ::URITemplate::Utils + extend ::URITemplate::Utils::StringEncoding + extend ::URITemplate::Utils::StringEncoding::Encode + extend ::URITemplate::Utils::Escaping::Pure +end + +class URITemplate::RFC6570 + extend ::URITemplate::ClassMethods + extend ::Forwardable + extend ::URITemplate::RFC6570::ClassMethods +end + +module URITemplate::Token + def ends_with_slash?(); end + + def expand(variables); end + + def expand_partial(variables); end + + def host?(); end + + def scheme?(); end + + def size(); end + + def starts_with_slash?(); end + + def to_s(); end + + def variables(); end + EMPTY_ARRAY = ::T.let(nil, ::T.untyped) +end + +module URITemplate::Token +end + +module URITemplate::Utils + include ::URITemplate::Utils::StringEncoding + include ::URITemplate::Utils::StringEncoding::Encode + include ::URITemplate::Utils::Escaping::Pure + def compact_regexp(rx); end + + def object_to_param(object); end + + def pair_array?(a); end + + def pair_array_to_hash(x, careful=T.unsafe(nil)); end + + def pair_array_to_hash2(x); end + + def use_unicode?(); end + KCODE_UTF8 = ::T.let(nil, ::T.untyped) +end + +module URITemplate::Utils::Escaping +end + +module URITemplate::Utils::Escaping::Pure + def escape_uri(s); end + + def escape_url(s); end + + def unescape_uri(s); end + + def unescape_url(s); end + + def using_escape_utils?(); end + PCT = ::T.let(nil, ::T.untyped) + URI_ESCAPED = ::T.let(nil, ::T.untyped) + URL_ESCAPED = ::T.let(nil, ::T.untyped) +end + +module URITemplate::Utils::Escaping::Pure +end + +module URITemplate::Utils::Escaping +end + +module URITemplate::Utils::StringEncoding + include ::URITemplate::Utils::StringEncoding::Encode +end + +module URITemplate::Utils::StringEncoding::Encode + def force_utf8(str); end + + def to_ascii(str); end + + def to_utf8(str); end +end + +module URITemplate::Utils::StringEncoding::Encode +end + +module URITemplate::Utils::StringEncoding +end + +module URITemplate::Utils + extend ::URITemplate::Utils + extend ::URITemplate::Utils::StringEncoding + extend ::URITemplate::Utils::StringEncoding::Encode + extend ::URITemplate::Utils::Escaping::Pure +end + +module URITemplate + extend ::URITemplate::ClassMethods + def self.apply(a, method, b, *args); end + + def self.coerce(a, b); end + + def self.coerce_first_arg(meth); end + + def self.new(*args); end + + def self.resolve_class(*args); end +end + module URL::BlockDSL::PageWithURL extend ::T::Private::Methods::MethodHooks extend ::T::Private::Methods::SingletonMethodHooks
true
Other
Homebrew
brew
3751d9d69141f16d97627c2e7503035f8c35a0b7.json
Update Sorbet RBIs
Library/Homebrew/sorbet/rbi/todo.rbi
@@ -4,7 +4,6 @@ # typed: strong module ::StackProf; end module DependencyCollector::Compat; 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
e7d3dc853273c6b1c0279178aa27b5fa2c2246e6.json
workflows/triage: limit concurrent runs
.github/workflows/triage.yml
@@ -12,6 +12,8 @@ on: schedule: - cron: "0 */3 * * *" # every 3 hours +concurrency: triage-${{ github.ref }} + jobs: review: runs-on: ubuntu-latest
false
Other
Homebrew
brew
698f4a8f6999d3faee87ae6321274b58d7ae13e8.json
Add process_type to service DSL This enables mpd to be run with the "Interactive" value, which avoids performance issues such as skipping when playing music. See this PR, where this was done previously: https://github.com/Homebrew/homebrew-core/pull/19410 The ProcessType plist key was lost in the conversion to the service DSL: https://github.com/Homebrew/homebrew-core/commit/483ad1fdfa29f10441b5de4386173e68f4b11555
Library/Homebrew/service.rb
@@ -13,6 +13,11 @@ class Service RUN_TYPE_INTERVAL = "interval" RUN_TYPE_CRON = "cron" + PROCESS_TYPE_BACKGROUND = "background" + PROCESS_TYPE_STANDARD = "standard" + PROCESS_TYPE_INTERACTIVE = "interactive" + PROCESS_TYPE_ADAPTIVE = "adaptive" + # sig { params(formula: Formula).void } def initialize(formula, &block) @formula = formula @@ -119,6 +124,22 @@ def restart_delay(value = nil) end end + sig { params(type: T.nilable(String)).returns(T.nilable(String)) } + def process_type(type = nil) + case T.unsafe(type) + when nil + @process_type + when PROCESS_TYPE_BACKGROUND, PROCESS_TYPE_STANDARD, PROCESS_TYPE_INTERACTIVE, PROCESS_TYPE_ADAPTIVE + @process_type = type.to_s + when String + raise TypeError, "Service#process_type allows: "\ + "'#{PROCESS_TYPE_BACKGROUND}'/'#{PROCESS_TYPE_STANDARD}'/"\ + "'#{PROCESS_TYPE_INTERACTIVE}'/'#{PROCESS_TYPE_ADAPTIVE}'" + else + raise TypeError, "Service#process_type expects a String" + end + end + sig { params(type: T.nilable(T.any(String, Symbol))).returns(T.nilable(String)) } def run_type(type = nil) case T.unsafe(type) @@ -193,6 +214,7 @@ def to_plist base[:KeepAlive] = @keep_alive if @keep_alive == true base[:LegacyTimers] = @macos_legacy_timers if @macos_legacy_timers == true base[:TimeOut] = @restart_delay if @restart_delay.present? + base[:ProcessType] = @process_type.capitalize if @process_type.present? base[:WorkingDirectory] = @working_dir if @working_dir.present? base[:RootDirectory] = @root_dir if @root_dir.present? base[:StandardInPath] = @input_path if @input_path.present?
true
Other
Homebrew
brew
698f4a8f6999d3faee87ae6321274b58d7ae13e8.json
Add process_type to service DSL This enables mpd to be run with the "Interactive" value, which avoids performance issues such as skipping when playing music. See this PR, where this was done previously: https://github.com/Homebrew/homebrew-core/pull/19410 The ProcessType plist key was lost in the conversion to the service DSL: https://github.com/Homebrew/homebrew-core/commit/483ad1fdfa29f10441b5de4386173e68f4b11555
Library/Homebrew/test/service_spec.rb
@@ -76,6 +76,7 @@ root_dir var working_dir var keep_alive true + process_type "interactive" restart_delay 30 macos_legacy_timers true end @@ -101,6 +102,8 @@ \t<string>homebrew.mxcl.formula_name</string> \t<key>LegacyTimers</key> \t<true/> + \t<key>ProcessType</key> + \t<string>Interactive</string> \t<key>ProgramArguments</key> \t<array> \t\t<string>#{HOMEBREW_PREFIX}/opt/formula_name/bin/beanstalkd</string> @@ -165,6 +168,7 @@ root_dir var working_dir var keep_alive true + process_type "interactive" restart_delay 30 macos_legacy_timers true end
true
Other
Homebrew
brew
0c3e49092c2e807092d157f3723d712a807e37b1.json
upgrade: use topological sort to upgrade formulae
Library/Homebrew/cask.rb
@@ -20,6 +20,5 @@ require "cask/pkg" require "cask/quarantine" require "cask/staged" -require "cask/topological_hash" require "cask/url" require "cask/utils"
true
Other
Homebrew
brew
0c3e49092c2e807092d157f3723d712a807e37b1.json
upgrade: use topological sort to upgrade formulae
Library/Homebrew/cask/installer.rb
@@ -3,8 +3,8 @@ require "formula_installer" require "unpack_strategy" +require "utils/topological_hash" -require "cask/topological_hash" require "cask/config" require "cask/download" require "cask/staged" @@ -290,43 +290,14 @@ def arch_dependencies "but you are running #{@current_arch}." end - def graph_dependencies(cask_or_formula, acc = TopologicalHash.new) - return acc if acc.key?(cask_or_formula) - - if cask_or_formula.is_a?(Cask) - formula_deps = cask_or_formula.depends_on.formula.map { |f| Formula[f] } - cask_deps = cask_or_formula.depends_on.cask.map { |c| CaskLoader.load(c, config: nil) } - else - formula_deps = cask_or_formula.deps.reject(&:build?).map(&:to_formula) - cask_deps = cask_or_formula.requirements.map(&:cask).compact - .map { |c| CaskLoader.load(c, config: nil) } - end - - acc[cask_or_formula] ||= [] - acc[cask_or_formula] += formula_deps - acc[cask_or_formula] += cask_deps - - formula_deps.each do |f| - graph_dependencies(f, acc) - end - - cask_deps.each do |c| - graph_dependencies(c, acc) - end - - acc - end - def collect_cask_and_formula_dependencies return @cask_and_formula_dependencies if @cask_and_formula_dependencies - graph = graph_dependencies(@cask) + graph = ::Utils::TopologicalHash.graph_package_dependencies(@cask) raise CaskSelfReferencingDependencyError, cask.token if graph[@cask].include?(@cask) - primary_container.dependencies.each do |dep| - graph_dependencies(dep, graph) - end + ::Utils::TopologicalHash.graph_package_dependencies(primary_container.dependencies, graph) begin @cask_and_formula_dependencies = graph.tsort - [@cask]
true
Other
Homebrew
brew
0c3e49092c2e807092d157f3723d712a807e37b1.json
upgrade: use topological sort to upgrade formulae
Library/Homebrew/cask/topological_hash.rb
@@ -1,21 +0,0 @@ -# typed: true -# frozen_string_literal: true - -require "tsort" - -module Cask - # Topologically sortable hash map. - class TopologicalHash < Hash - include TSort - - private - - def tsort_each_node(&block) - each_key(&block) - end - - def tsort_each_child(node, &block) - fetch(node).each(&block) - end - end -end
true
Other
Homebrew
brew
0c3e49092c2e807092d157f3723d712a807e37b1.json
upgrade: use topological sort to upgrade formulae
Library/Homebrew/test/utils/topological_hash_spec.rb
@@ -0,0 +1,99 @@ +# typed: false +# frozen_string_literal: true + +require "utils/topological_hash" + +describe Utils::TopologicalHash do + describe "#tsort" do + it "returns a topologically sorted array" do + hash = described_class.new + hash[1] = [2, 3] + hash[2] = [3] + hash[3] = [] + hash[4] = [] + expect(hash.tsort).to eq [3, 2, 1, 4] + end + end + + describe "#strongly_connected_components" do + it "returns an array of arrays" do + hash = described_class.new + hash[1] = [2] + hash[2] = [3, 4] + hash[3] = [2] + hash[4] = [] + expect(hash.strongly_connected_components).to eq [[4], [2, 3], [1]] + end + end + + describe "::graph_package_dependencies" do + it "returns a topological hash" do + formula1 = formula "homebrew-test-formula1" do + url "foo" + version "0.5" + end + + formula2 = formula "homebrew-test-formula2" do + url "foo" + version "0.5" + depends_on "homebrew-test-formula1" + end + + formula3 = formula "homebrew-test-formula3" do + url "foo" + version "0.5" + depends_on "homebrew-test-formula4" + end + + formula4 = formula "homebrew-test-formula4" do + url "foo" + version "0.5" + depends_on "homebrew-test-formula3" + end + + cask1 = Cask::Cask.new("homebrew-test-cask1") do + url "foo" + version "1.2.3" + end + + cask2 = Cask::Cask.new("homebrew-test-cask2") do + url "foo" + version "1.2.3" + depends_on cask: "homebrew-test-cask1" + depends_on formula: "homebrew-test-formula1" + end + + cask3 = Cask::Cask.new("homebrew-test-cask3") do + url "foo" + version "1.2.3" + depends_on cask: "homebrew-test-cask2" + end + + stub_formula_loader formula1 + stub_formula_loader formula2 + stub_formula_loader formula3 + stub_formula_loader formula4 + + stub_cask_loader cask1 + stub_cask_loader cask2 + stub_cask_loader cask3 + + packages = [formula1, formula2, formula3, formula4, cask1, cask2, cask3] + expect(described_class.graph_package_dependencies(packages)).to eq({ + formula1 => [], + formula2 => [formula1], + formula3 => [formula4], + formula4 => [formula3], + cask1 => [], + cask2 => [formula1, cask1], + cask3 => [cask2], + }) + + sorted = [formula1, cask1, cask2, cask3, formula2] + expect(described_class.graph_package_dependencies([cask3, cask2, cask1, formula2, formula1]).tsort).to eq sorted + expect(described_class.graph_package_dependencies([cask3, formula2]).tsort).to eq sorted + + expect { described_class.graph_package_dependencies([formula3, formula4]).tsort }.to raise_error TSort::Cyclic + end + end +end
true
Other
Homebrew
brew
0c3e49092c2e807092d157f3723d712a807e37b1.json
upgrade: use topological sort to upgrade formulae
Library/Homebrew/upgrade.rb
@@ -6,6 +6,7 @@ require "development_tools" require "messages" require "cleanup" +require "utils/topological_hash" module Homebrew # Helper functions for upgrading formulae. @@ -42,6 +43,14 @@ def upgrade_formulae( end end + dependency_graph = Utils::TopologicalHash.graph_package_dependencies(formulae_to_install) + begin + formulae_to_install = dependency_graph.tsort & formulae_to_install + rescue TSort::Cyclic + # Failed to sort formulae topologically because there are cyclic + # dependencies. Let FormulaInstaller handle it. + end + formula_installers = formulae_to_install.map do |formula| Migrator.migrate_if_needed(formula, force: force, dry_run: dry_run) begin
true
Other
Homebrew
brew
0c3e49092c2e807092d157f3723d712a807e37b1.json
upgrade: use topological sort to upgrade formulae
Library/Homebrew/utils/topological_hash.rb
@@ -0,0 +1,63 @@ +# typed: true +# frozen_string_literal: true + +require "tsort" + +module Utils + # Topologically sortable hash map. + class TopologicalHash < Hash + extend T::Sig + + include TSort + + sig { + params( + packages: T.any(Cask::Cask, Formula, T::Array[T.any(Cask::Cask, Formula)]), + accumulator: TopologicalHash, + ).returns(TopologicalHash) + } + def self.graph_package_dependencies(packages, accumulator = TopologicalHash.new) + packages = Array(packages) + + packages.each do |cask_or_formula| + next accumulator if accumulator.key?(cask_or_formula) + + if cask_or_formula.is_a?(Cask::Cask) + formula_deps = cask_or_formula.depends_on + .formula + .map { |f| Formula[f] } + cask_deps = cask_or_formula.depends_on + .cask + .map { |c| Cask::CaskLoader.load(c, config: nil) } + else + formula_deps = cask_or_formula.deps + .reject(&:build?) + .map(&:to_formula) + cask_deps = cask_or_formula.requirements + .map(&:cask) + .compact + .map { |c| Cask::CaskLoader.load(c, config: nil) } + end + + accumulator[cask_or_formula] ||= [] + accumulator[cask_or_formula] += formula_deps + accumulator[cask_or_formula] += cask_deps + + graph_package_dependencies(formula_deps, accumulator) + graph_package_dependencies(cask_deps, accumulator) + end + + accumulator + end + + private + + def tsort_each_node(&block) + each_key(&block) + end + + def tsort_each_child(node, &block) + fetch(node).each(&block) + end + end +end
true
Other
Homebrew
brew
342fb409f88eb31cf99c4b7437c08e1e3002dee9.json
Update RBI files for rubocop-rails.
Library/Homebrew/sorbet/rbi/gems/rubocop-rails@2.12.0.rbi
@@ -383,10 +383,10 @@ class RuboCop::Cop::Rails::ContentTag < ::RuboCop::Cop::Base private def allowed_argument?(argument); end - def autocorrect(corrector, node); end + def allowed_name?(argument); end + def autocorrect(corrector, node, preferred_method); end def corrected_ancestor?(node); end def correction_range(node); end - def method_name?(node); end end RuboCop::Cop::Rails::ContentTag::MSG = T.let(T.unsafe(nil), String) @@ -755,13 +755,15 @@ class RuboCop::Cop::Rails::HttpPositionalArguments < ::RuboCop::Cop::Base def correction_template(node); end def format_arg?(node); end def highlight_range(node); end + def in_routing_block?(node); end def needs_conversion?(data); end def special_keyword_arg?(node); end end RuboCop::Cop::Rails::HttpPositionalArguments::KEYWORD_ARGS = T.let(T.unsafe(nil), Array) RuboCop::Cop::Rails::HttpPositionalArguments::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Rails::HttpPositionalArguments::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) +RuboCop::Cop::Rails::HttpPositionalArguments::ROUTING_METHODS = T.let(T.unsafe(nil), Array) class RuboCop::Cop::Rails::HttpStatus < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle @@ -906,7 +908,9 @@ class RuboCop::Cop::Rails::LexicallyScopedActionFilter < ::RuboCop::Cop::Base private + def aliased_action_methods(node, defined_methods); end def array_values(node); end + def defined_action_methods(block); end def message(methods, parent); end end @@ -924,7 +928,7 @@ class RuboCop::Cop::Rails::LinkToBlank < ::RuboCop::Cop::Base private - def add_rel(send_node, offence_node, corrector); end + def add_rel(send_node, offense_node, corrector); end def append_to_rel(rel_node, corrector); end def autocorrect(corrector, send_node, node, option_nodes); end def contains_noopener?(value); end @@ -1014,13 +1018,17 @@ RuboCop::Cop::Rails::OrderById::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Rails::OrderById::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) class RuboCop::Cop::Rails::Output < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + def io_output?(param0 = T.unsafe(nil)); end def on_send(node); end def output?(param0 = T.unsafe(nil)); end private def match_gvar?(sym); end + def offense_range(node); end end RuboCop::Cop::Rails::Output::MSG = T.let(T.unsafe(nil), String) @@ -1256,6 +1264,17 @@ end RuboCop::Cop::Rails::RedundantReceiverInWithOptions::MSG = T.let(T.unsafe(nil), String) +class RuboCop::Cop::Rails::RedundantTravelBack < ::RuboCop::Cop::Base + include ::RuboCop::Cop::RangeHelp + extend ::RuboCop::Cop::AutoCorrector + extend ::RuboCop::Cop::TargetRailsVersion + + def on_send(node); end +end + +RuboCop::Cop::Rails::RedundantTravelBack::MSG = T.let(T.unsafe(nil), String) +RuboCop::Cop::Rails::RedundantTravelBack::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) + class RuboCop::Cop::Rails::ReflectionClassName < ::RuboCop::Cop::Base def association_with_reflection(param0 = T.unsafe(nil)); end def on_send(node); end @@ -1476,6 +1495,8 @@ RuboCop::Cop::Rails::SaveBang::MSG = T.let(T.unsafe(nil), String) RuboCop::Cop::Rails::SaveBang::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) class RuboCop::Cop::Rails::ScopeArgs < ::RuboCop::Cop::Base + extend ::RuboCop::Cop::AutoCorrector + def on_send(node); end def scope?(param0 = T.unsafe(nil)); end end
false
Other
Homebrew
brew
c90e63b2998312e4c9aa029599df2c0b184faaa6.json
os: add `uname` method This will allow us to replace code like os = if OS.mac? "Darwin" else "Linux" end with a call to `OS.uname`. Doing rg '= (if )?OS\.(mac|linux)\?' returns about 70 matches, so there are probably at least a handful of formulae that could be simplified by this.
Library/Homebrew/os.rb
@@ -35,6 +35,14 @@ def self.kernel_version @kernel_version ||= Version.new(Utils.safe_popen_read("uname", "-r").chomp) end + # Get the kernel name. + # + # @api public + sig { returns(String) } + def self.uname + @uname ||= Utils.safe_popen_read("uname").chomp + end + ::OS_VERSION = ENV["HOMEBREW_OS_VERSION"] CI_GLIBC_VERSION = "2.23"
false
Other
Homebrew
brew
d742ea94f74d6b1a8770092a648fa4b161bdc8cd.json
os/mac/pkgconfig/12: update version info
Library/Homebrew/os/mac/pkgconfig/12/expat.pc
@@ -5,7 +5,7 @@ libdir=${exec_prefix}/lib includedir=${prefix}/include Name: expat -Version: 2.2.8 +Version: 2.4.1 Description: expat XML parser URL: http://www.libexpat.org Libs: -L${libdir} -lexpat
true
Other
Homebrew
brew
d742ea94f74d6b1a8770092a648fa4b161bdc8cd.json
os/mac/pkgconfig/12: update version info
Library/Homebrew/os/mac/pkgconfig/12/libcurl.pc
@@ -5,11 +5,11 @@ # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # -# Copyright (C) 2001 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al. +# Copyright (C) 2001 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms -# are also available at https://curl.haxx.se/docs/copyright.html. +# are also available at https://curl.se/docs/copyright.html. # # You may opt to use, copy, modify, merge, publish, distribute and/or sell # copies of the Software, and permit persons to whom the Software is @@ -28,13 +28,13 @@ prefix=${homebrew_sdkroot}/usr exec_prefix=/usr libdir=${exec_prefix}/lib includedir=${prefix}/include -supported_protocols="DICT FILE FTP FTPS GOPHER HTTP HTTPS IMAP IMAPS LDAP LDAPS POP3 POP3S RTSP SMB SMBS SMTP SMTPS TELNET TFTP" -supported_features="AsynchDNS IPv6 Largefile GSS-API Kerberos SPNEGO MultiSSL NTLM NTLM_WB SSL libz HTTP2 UnixSockets HTTPS-proxy" +supported_protocols="DICT FILE FTP FTPS GOPHER GOPHERS HTTP HTTPS IMAP IMAPS LDAP LDAPS MQTT POP3 POP3S RTSP SMB SMBS SMTP SMTPS TELNET TFTP" +supported_features="alt-svc AsynchDNS GSS-API HSTS HTTP2 HTTPS-proxy IPv6 Kerberos Largefile libz MultiSSL NTLM NTLM_WB SPNEGO SSL UnixSockets" Name: libcurl -URL: https://curl.haxx.se/ +URL: https://curl.se/ Description: Library to transfer files with ftp, http, etc. -Version: 7.64.1 +Version: 7.77.0 Libs: -L${libdir} -lcurl Libs.private: -lldap -lz Cflags:
true
Other
Homebrew
brew
d742ea94f74d6b1a8770092a648fa4b161bdc8cd.json
os/mac/pkgconfig/12: update version info
Library/Homebrew/os/mac/pkgconfig/12/sqlite3.pc
@@ -6,7 +6,7 @@ includedir=${prefix}/include Name: SQLite Description: SQL database engine -Version: 3.32.3 +Version: 3.36.0 Libs: -L${libdir} -lsqlite3 Libs.private: Cflags:
true
Other
Homebrew
brew
a0093bd64730006200039a27913303d4479d2590.json
test/support/fixtures/bottles: add fixtures for Monterey
Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.arm64_monterey.bottle.tar.gz
@@ -0,0 +1 @@ +testball_bottle-0.1.yosemite.bottle.tar.gz \ No newline at end of file
true
Other
Homebrew
brew
a0093bd64730006200039a27913303d4479d2590.json
test/support/fixtures/bottles: add fixtures for Monterey
Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.monterey.bottle.tar.gz
@@ -0,0 +1 @@ +testball_bottle-0.1.yosemite.bottle.tar.gz \ No newline at end of file
true
Other
Homebrew
brew
c6aea445a38e333568c5d45bdd05ddb60b27b22d.json
formula_auditor: allow uses_from_macos for aliases. This will enable https://github.com/Homebrew/homebrew-core/pull/84910 which will enable https://github.com/Homebrew/brew/pull/12008.
Library/Homebrew/formula_auditor.rb
@@ -263,7 +263,9 @@ def audit_deps next unless @core_tap - if self.class.aliases.include?(dep.name) + # we want to allow uses_from_macos for aliases but not bare dependencies + if self.class.aliases.include?(dep.name) && + (spec.uses_from_macos_elements.blank? || spec.uses_from_macos_elements.exclude?(dep.name)) problem "Dependency '#{dep.name}' is an alias; use the canonical name '#{dep.to_formula.full_name}'." end
false
Other
Homebrew
brew
ebc4cce4569acc946a5078e672021c05bcad6e4c.json
rubocops/lines: add some OS cop comments/exceptions. Exclude and comment the cases the autocorrect currently doesn't work. Follow-up from #11955.
Library/Homebrew/rubocops/lines.rb
@@ -368,6 +368,9 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node) block_node = offending_node.parent next if block_node.type != :block + # TODO: could fix corrector to handle this but punting for now. + next if block_node.single_line? + source_range = offending_node.source_range.join(offending_node.parent.loc.begin) corrector.replace(source_range, if_method_and_class) end @@ -383,6 +386,9 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node) block_node = offending_node.parent next if block_node.type != :block + # TODO: could fix corrector to handle this but punting for now. + next if block_node.single_line? + source_range = offending_node.source_range.join(offending_node.parent.loc.begin) corrector.replace(source_range, if_method_and_class) end @@ -414,6 +420,8 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node) problem "Don't use '#{if_method_and_class}', use '#{on_method_name} do' instead." do |corrector| if_node = method.parent next if if_node.type != :if + + # TODO: could fix corrector to handle this but punting for now. next if if_node.unless? corrector.replace(if_node.source_range, "#{on_method_name} do\n#{if_node.body.source}\nend")
false
Other
Homebrew
brew
a6e4e195c197a70c9c47f75992ed1b82f6656d3a.json
rubocops/lines: recommend on_os/OS.os? based on context. Recommend the use of `on_macos` and `on_linux` unless we're in `def install`, `def post_install` or `test do` in which case recommend `OS.mac?` and `OS.linux?` instead.
Library/Homebrew/formula.rb
@@ -64,7 +64,7 @@ class Formula include Utils::Shebang include Utils::Shell include Context - include OnOS + include OnOS # TODO: 3.3.0: deprecate OnOS usage in instance methods. extend Enumerable extend Forwardable extend Cachable
true
Other
Homebrew
brew
a6e4e195c197a70c9c47f75992ed1b82f6656d3a.json
rubocops/lines: recommend on_os/OS.os? based on context. Recommend the use of `on_macos` and `on_linux` unless we're in `def install`, `def post_install` or `test do` in which case recommend `OS.mac?` and `OS.linux?` instead.
Library/Homebrew/formula_support.rb
@@ -69,7 +69,7 @@ class BottleDisableReason def initialize(type, reason) @type = type @reason = reason - # TODO: 3.3.0 should deprecate this behaviour as it was only needed for + # TODO: 3.3.0: deprecate this behaviour as it was only needed for # Homebrew/core (where we don't want unneeded or disabled bottles any more) # odeprecated "bottle :#{@type}" if valid? end
true
Other
Homebrew
brew
a6e4e195c197a70c9c47f75992ed1b82f6656d3a.json
rubocops/lines: recommend on_os/OS.os? based on context. Recommend the use of `on_macos` and `on_linux` unless we're in `def install`, `def post_install` or `test do` in which case recommend `OS.mac?` and `OS.linux?` instead.
Library/Homebrew/rubocops/lines.rb
@@ -347,6 +347,82 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node) end end + # This cop makes sure that OS conditionals are consistent. + # + # @api private + class OSConditionals < FormulaCop + extend AutoCorrector + + def audit_formula(_node, _class_node, _parent_class_node, body_node) + no_on_os_method_names = [:install, :post_install].freeze + no_on_os_block_names = [:test].freeze + [[:on_macos, :mac?], [:on_linux, :linux?]].each do |on_method_name, if_method_name| + if_method_and_class = "if OS.#{if_method_name}" + no_on_os_method_names.each do |formula_method_name| + method_node = find_method_def(body_node, formula_method_name) + next unless method_node + next unless method_called_ever?(method_node, on_method_name) + + problem "Don't use '#{on_method_name}' in 'def #{formula_method_name}', " \ + "use '#{if_method_and_class}' instead." do |corrector| + block_node = offending_node.parent + next if block_node.type != :block + + source_range = offending_node.source_range.join(offending_node.parent.loc.begin) + corrector.replace(source_range, if_method_and_class) + end + end + + no_on_os_block_names.each do |formula_block_name| + block_node = find_block(body_node, formula_block_name) + next unless block_node + next unless method_called_in_block?(block_node, on_method_name) + + problem "Don't use '#{on_method_name}' in '#{formula_block_name} do', " \ + "use '#{if_method_and_class}' instead." do |corrector| + block_node = offending_node.parent + next if block_node.type != :block + + source_range = offending_node.source_range.join(offending_node.parent.loc.begin) + corrector.replace(source_range, if_method_and_class) + end + end + + find_instance_method_call(body_node, "OS", if_method_name) do |method| + valid = T.let(false, T::Boolean) + method.each_ancestor do |ancestor| + valid_method_names = case ancestor.type + when :def + no_on_os_method_names + when :block + no_on_os_block_names + else + next + end + next unless valid_method_names.include?(ancestor.method_name) + + valid = true + break + end + next if valid + + # TODO: temporarily allow this for linuxbrew-core merge. + next if method&.parent&.parent&.source&.start_with?("revision OS.mac?") + next if method&.parent&.source&.match?(/revision \d unless OS\.mac\?/) + + offending_node(method) + problem "Don't use '#{if_method_and_class}', use '#{on_method_name} do' instead." do |corrector| + if_node = method.parent + next if if_node.type != :if + next if if_node.unless? + + corrector.replace(if_node.source_range, "#{on_method_name} do\n#{if_node.body.source}\nend") + end + end + end + end + end + # This cop checks for other miscellaneous style violations. # # @api private
true
Other
Homebrew
brew
a6e4e195c197a70c9c47f75992ed1b82f6656d3a.json
rubocops/lines: recommend on_os/OS.os? based on context. Recommend the use of `on_macos` and `on_linux` unless we're in `def install`, `def post_install` or `test do` in which case recommend `OS.mac?` and `OS.linux?` instead.
Library/Homebrew/rubocops/shared/helper_functions.rb
@@ -113,8 +113,10 @@ def find_node_method_by_name(node, method_name) nil end - # Sets the given node as the offending node when required in custom cops. - def offending_node(node) + # Gets/sets the given node as the offending node when required in custom cops. + def offending_node(node = nil) + return @offensive_node if node.nil? + @offensive_node = node end
true
Other
Homebrew
brew
a6e4e195c197a70c9c47f75992ed1b82f6656d3a.json
rubocops/lines: recommend on_os/OS.os? based on context. Recommend the use of `on_macos` and `on_linux` unless we're in `def install`, `def post_install` or `test do` in which case recommend `OS.mac?` and `OS.linux?` instead.
Library/Homebrew/test/rubocops/text/on_os_conditionals_spec.rb
@@ -0,0 +1,86 @@ +# typed: false +# frozen_string_literal: true + +require "rubocops/lines" + +describe RuboCop::Cop::FormulaAudit::OSConditionals do + subject(:cop) { described_class.new } + + context "when auditing OS conditionals" do + it "reports an offense when `OS.linux?` is used on Formula class" do + expect_offense(<<~RUBY, "/homebrew-core/Formula/foo.rb") + class Foo < Formula + desc "foo" + if OS.linux? + ^^^^^^^^^ Don't use 'if OS.linux?', use 'on_linux do' instead. + url 'https://brew.sh/linux-1.0.tgz' + else + url 'https://brew.sh/linux-1.0.tgz' + end + end + RUBY + end + + it "reports an offense when `OS.mac?` is used on Formula class" do + expect_offense(<<~RUBY, "/homebrew-core/Formula/foo.rb") + class Foo < Formula + desc "foo" + if OS.mac? + ^^^^^^^ Don't use 'if OS.mac?', use 'on_macos do' instead. + url 'https://brew.sh/mac-1.0.tgz' + else + url 'https://brew.sh/linux-1.0.tgz' + end + end + RUBY + end + + it "reports an offense when `on_macos` is used in install method" do + expect_offense(<<~RUBY, "/homebrew-core/Formula/foo.rb") + class Foo < Formula + desc "foo" + url 'https://brew.sh/foo-1.0.tgz' + + def install + on_macos do + ^^^^^^^^ Don't use 'on_macos' in 'def install', use 'if OS.mac?' instead. + true + end + end + end + RUBY + end + + it "reports an offense when `on_linux` is used in install method" do + expect_offense(<<~RUBY, "/homebrew-core/Formula/foo.rb") + class Foo < Formula + desc "foo" + url 'https://brew.sh/foo-1.0.tgz' + + def install + on_linux do + ^^^^^^^^ Don't use 'on_linux' in 'def install', use 'if OS.linux?' instead. + true + end + end + end + RUBY + end + + it "reports an offense when `on_macos` is used in test block" do + expect_offense(<<~RUBY, "/homebrew-core/Formula/foo.rb") + class Foo < Formula + desc "foo" + url 'https://brew.sh/foo-1.0.tgz' + + test do + on_macos do + ^^^^^^^^ Don't use 'on_macos' in 'test do', use 'if OS.mac?' instead. + true + end + end + end + RUBY + end + end +end
true
Other
Homebrew
brew
c80bcc3f3d7602c2e88aa6e7a2103e4048bf9196.json
Exclude bot commmits from new release notes
.github/release.yml
@@ -0,0 +1,5 @@ +changelog: + exclude: + authors: + - dependabot + - BrewTestBot
false
Other
Homebrew
brew
2b6e58063694e2a676d647dfa247d61229623d62.json
ENV/super: add `shims_path` helper method. This allows us to stop repeatedly hardcoding this on macOS/Linux in formulae.
Library/Homebrew/extend/ENV/super.rb
@@ -29,6 +29,13 @@ def self.extended(base) base.run_time_deps = [] end + # The location of Homebrew's shims on this OS. + # @public + sig { returns(Pathname) } + def self.shims_path + HOMEBREW_SHIMS_PATH/"super" + end + # @private sig { returns(T.nilable(Pathname)) } def self.bin; end
true
Other
Homebrew
brew
2b6e58063694e2a676d647dfa247d61229623d62.json
ENV/super: add `shims_path` helper method. This allows us to stop repeatedly hardcoding this on macOS/Linux in formulae.
Library/Homebrew/extend/os/linux/extend/ENV/super.rb
@@ -4,9 +4,15 @@ module Superenv extend T::Sig + # The location of Homebrew's shims on Linux. + # @public + def self.shims_path + HOMEBREW_SHIMS_PATH/"linux/super" + end + # @private def self.bin - (HOMEBREW_SHIMS_PATH/"linux/super").realpath + shims_path.realpath end # @private
true
Other
Homebrew
brew
2b6e58063694e2a676d647dfa247d61229623d62.json
ENV/super: add `shims_path` helper method. This allows us to stop repeatedly hardcoding this on macOS/Linux in formulae.
Library/Homebrew/extend/os/mac/extend/ENV/super.rb
@@ -5,13 +5,19 @@ module Superenv extend T::Sig class << self + # The location of Homebrew's shims on macOS. + # @public + def shims_path + HOMEBREW_SHIMS_PATH/"mac/super" + end + undef bin # @private def bin return unless DevelopmentTools.installed? - (HOMEBREW_SHIMS_PATH/"mac/super").realpath + shims_path.realpath end end
true
Other
Homebrew
brew
669d7fd79dee4952ac78a65d4dc84e67d57cf717.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
@@ -31529,6 +31529,11 @@ class Utils::Bottles::Tag extend ::T::Private::Methods::SingletonMethodHooks end +module Utils::Curl + extend ::T::Private::Methods::MethodHooks + extend ::T::Private::Methods::SingletonMethodHooks +end + module Utils::Inreplace extend ::T::Private::Methods::MethodHooks extend ::T::Private::Methods::SingletonMethodHooks
false
Other
Homebrew
brew
1f0f08c30d418356b0378f5460647e3425653204.json
Remove redundant begin
Library/Homebrew/sandbox.rb
@@ -115,20 +115,18 @@ def exec(*args) end write_to_pty = proc do - begin - # Update the window size whenever the parent terminal's window size changes. - old_winch = trap(:WINCH, &winch) - winch.call(nil) + # Update the window size whenever the parent terminal's window size changes. + old_winch = trap(:WINCH, &winch) + winch.call(nil) - stdin_thread = Thread.new { IO.copy_stream($stdin, w) } + stdin_thread = Thread.new { IO.copy_stream($stdin, w) } - r.each_char { |c| print(c) } + r.each_char { |c| print(c) } - Process.wait(pid) - ensure - stdin_thread&.kill - trap(:WINCH, old_winch) - end + Process.wait(pid) + ensure + stdin_thread&.kill + trap(:WINCH, old_winch) end if $stdin.tty?
false
Other
Homebrew
brew
f88966a8a53198106f01475b7c09ef08ef00e0e9.json
Use curl options where appropriate
Library/Homebrew/api.rb
@@ -27,7 +27,7 @@ def fetch(endpoint, json: true) return cache[endpoint] if cache.present? && cache.key?(endpoint) api_url = "#{API_DOMAIN}/#{endpoint}" - output = Utils::Curl.curl_output("--fail", "--max-time", "5", api_url) + output = Utils::Curl.curl_output("--fail", api_url, max_time: 5) raise ArgumentError, "No file found at #{Tty.underline}#{api_url}#{Tty.reset}" unless output.success? cache[endpoint] = if json
true
Other
Homebrew
brew
f88966a8a53198106f01475b7c09ef08ef00e0e9.json
Use curl options where appropriate
Library/Homebrew/download_strategy.rb
@@ -558,7 +558,7 @@ def curl_output(*args, **options) end def curl(*args, **options) - args << "--connect-timeout" << "15" unless mirrors.empty? + options[:connect_timeout] = 15 unless mirrors.empty? super(*_curl_args, *args, **_curl_opts, **command_output_options, **options) end end
true
Other
Homebrew
brew
f88966a8a53198106f01475b7c09ef08ef00e0e9.json
Use curl options where appropriate
Library/Homebrew/livecheck/strategy.rb
@@ -39,8 +39,6 @@ module Strategy DEFAULT_CURL_ARGS = [ # Follow redirections to handle mirrors, relocations, etc. "--location", - "--connect-timeout", CURL_CONNECT_TIMEOUT, - "--max-time", CURL_MAX_TIME ].freeze # `curl` arguments used in `Strategy#page_headers` method. @@ -62,12 +60,14 @@ module Strategy # Baseline `curl` options used in {Strategy} methods. DEFAULT_CURL_OPTIONS = { - print_stdout: false, - print_stderr: false, - debug: false, - verbose: false, - timeout: CURL_PROCESS_TIMEOUT, - retries: 0, + print_stdout: false, + print_stderr: false, + debug: false, + verbose: false, + timeout: CURL_PROCESS_TIMEOUT, + connect_timeout: CURL_CONNECT_TIMEOUT, + max_time: CURL_MAX_TIME, + retries: 0, }.freeze # HTTP response head(s) and body are typically separated by a double
true
Other
Homebrew
brew
f88966a8a53198106f01475b7c09ef08ef00e0e9.json
Use curl options where appropriate
Library/Homebrew/utils/curl.rb
@@ -214,8 +214,13 @@ def curl_check_http_content(url, url_type, specs: {}, user_agents: [:default], if url != secure_url user_agents.each do |user_agent| secure_details = begin - curl_http_content_headers_and_checksum(secure_url, specs: specs, hash_needed: true, - user_agent: user_agent, use_homebrew_curl: use_homebrew_curl) + curl_http_content_headers_and_checksum( + secure_url, + specs: specs, + hash_needed: true, + use_homebrew_curl: use_homebrew_curl, + user_agent: user_agent, + ) rescue Timeout::Error next end @@ -231,8 +236,13 @@ def curl_check_http_content(url, url_type, specs: {}, user_agents: [:default], details = nil user_agents.each do |user_agent| details = - curl_http_content_headers_and_checksum(url, specs: specs, hash_needed: hash_needed, - user_agent: user_agent, use_homebrew_curl: use_homebrew_curl) + curl_http_content_headers_and_checksum( + url, + specs: specs, + hash_needed: hash_needed, + use_homebrew_curl: use_homebrew_curl, + user_agent: user_agent, + ) break if http_status_ok?(details[:status]) end @@ -297,16 +307,21 @@ def curl_check_http_content(url, url_type, specs: {}, user_agents: [:default], "The #{url_type} #{url} may be able to use HTTPS rather than HTTP. Please verify it in a browser." end - def curl_http_content_headers_and_checksum(url, specs: {}, hash_needed: false, - user_agent: :default, use_homebrew_curl: false) + def curl_http_content_headers_and_checksum( + url, specs: {}, hash_needed: false, + use_homebrew_curl: false, user_agent: :default + ) file = Tempfile.new.tap(&:close) specs = specs.flat_map { |option, argument| ["--#{option.to_s.tr("_", "-")}", argument] } - max_time = hash_needed ? "600" : "25" + max_time = hash_needed ? 600 : 25 output, _, status = curl_output( - *specs, "--dump-header", "-", "--output", file.path, "--location", - "--connect-timeout", "15", "--max-time", max_time, "--retry-max-time", max_time, url, - user_agent: user_agent, use_homebrew_curl: use_homebrew_curl + *specs, "--dump-header", "-", "--output", file.path, "--location", url, + use_homebrew_curl: use_homebrew_curl, + connect_timeout: 15, + max_time: max_time, + retry_max_time: max_time, + user_agent: user_agent ) status_code = :unknown
true
Other
Homebrew
brew
dce6b77ad05ce23850fecdafb007cd261108a30a.json
Modify syntax for readability / consistency leverage map block and guard clause for readability thx @MikeMcQuaid
Library/Homebrew/extend/os/mac/caveats.rb
@@ -37,9 +37,14 @@ def plist_caveats if f.plist_manual || f.service? command = if f.service? - f.service.command - .map { |arg| (arg =~ /\s/) ? "'#{arg}'" : arg } # wrap multi-word arguments in quotes - .join(" ") + f.service + .command + .map do |arg| + next arg unless arg.match?(/\s/) + + # quote multi-word arguments + "'#{arg}'" + end.join(" ") else f.plist_manual end
false
Other
Homebrew
brew
c88f4c064556b867ec1a3460ab9f8820453cef18.json
Use raw block to return tty to proper state
Library/Homebrew/sandbox.rb
@@ -101,32 +101,40 @@ def exec(*args) command = [SANDBOX_EXEC, "-f", seatbelt.path, *args] # Start sandbox in a pseudoterminal to prevent access of the parent terminal. T.unsafe(PTY).spawn(*command) do |r, w, pid| - # Set the PTY's window size to match the parent terminal. - # Some formula tests are sensitive to the terminal size and fail if this is not set. - winch = proc do |_sig| - w.winsize = if $stdout.tty? - # We can only use IO#winsize if the IO object is a TTY. - $stdout.winsize - else - # Otherwise, default to tput, if available. - # This relies on ncurses rather than the system's ioctl. - [Utils.popen_read("tput", "lines").to_i, Utils.popen_read("tput", "cols").to_i] + write_to_pty = proc { + # Set the PTY's window size to match the parent terminal. + # Some formula tests are sensitive to the terminal size and fail if this is not set. + winch = proc do |_sig| + w.winsize = if $stdout.tty? + # We can only use IO#winsize if the IO object is a TTY. + $stdout.winsize + else + # Otherwise, default to tput, if available. + # This relies on ncurses rather than the system's ioctl. + [Utils.popen_read("tput", "lines").to_i, Utils.popen_read("tput", "cols").to_i] + end end - end - # Update the window size whenever the parent terminal's window size changes. - old_winch = trap(:WINCH, &winch) - winch.call(nil) - $stdin.raw! if $stdin.tty? - stdin_thread = Thread.new { IO.copy_stream($stdin, w) } + begin + # Update the window size whenever the parent terminal's window size changes. + old_winch = trap(:WINCH, &winch) + winch.call(nil) + + stdin_thread = Thread.new { IO.copy_stream($stdin, w) } - r.each_char { |c| print(c) } + r.each_char { |c| print(c) } - Process.wait(pid) - ensure - stdin_thread&.kill - $stdin.cooked! if $stdin.tty? - trap(:WINCH, old_winch) + Process.wait(pid) + ensure + stdin_thread&.kill + trap(:WINCH, old_winch) + end + } + if $stdout.tty? + $stdin.raw &write_to_pty + else + write_to_pty.call + end end raise ErrorDuringExecution.new(command, status: $CHILD_STATUS) unless $CHILD_STATUS.success? rescue
false
Other
Homebrew
brew
bc4abc1fa9eaa7dec8fa51b6f5238079a74c6de8.json
Update RBI files for tapioca.
Library/Homebrew/sorbet/rbi/gems/tapioca@0.4.26.rbi
@@ -772,7 +772,7 @@ Tapioca::Compilers::Sorbet::SORBET = T.let(T.unsafe(nil), Pathname) module Tapioca::Compilers::SymbolTable; end class Tapioca::Compilers::SymbolTable::SymbolGenerator - sig { params(gem: Tapioca::Gemfile::Gem, indent: Integer).void } + sig { params(gem: Tapioca::Gemfile::GemSpec, indent: Integer).void } def initialize(gem, indent = T.unsafe(nil)); end def gem; end @@ -971,7 +971,7 @@ class Tapioca::Compilers::SymbolTable::SymbolLoader::SymbolTableParser end class Tapioca::Compilers::SymbolTableCompiler - sig { params(gem: Tapioca::Gemfile::Gem, indent: Integer).returns(String) } + sig { params(gem: Tapioca::Gemfile::GemSpec, indent: Integer).returns(String) } def compile(gem, indent = T.unsafe(nil)); end end @@ -1054,17 +1054,17 @@ class Tapioca::Gemfile sig { returns(Bundler::Definition) } def definition; end - sig { returns(T::Array[Tapioca::Gemfile::Gem]) } + sig { returns(T::Array[Tapioca::Gemfile::GemSpec]) } def dependencies; end - sig { params(gem_name: String).returns(T.nilable(Tapioca::Gemfile::Gem)) } + sig { params(gem_name: String).returns(T.nilable(Tapioca::Gemfile::GemSpec)) } def gem(gem_name); end sig { returns(T::Array[String]) } def missing_specs; end sig { void } - def require; end + def require_bundle; end private @@ -1077,7 +1077,7 @@ class Tapioca::Gemfile sig { returns(T::Array[Symbol]) } def groups; end - sig { returns([T::Array[Tapioca::Gemfile::Gem], T::Array[String]]) } + sig { returns([T::Array[Tapioca::Gemfile::GemSpec], T::Array[String]]) } def load_dependencies; end def lockfile; end @@ -1089,7 +1089,7 @@ class Tapioca::Gemfile def runtime; end end -class Tapioca::Gemfile::Gem +class Tapioca::Gemfile::GemSpec sig { params(spec: T.any(Gem::Specification, T.all(Bundler::RemoteSpecification, Bundler::StubSpecification))).void } def initialize(spec); end @@ -1140,7 +1140,7 @@ class Tapioca::Gemfile::Gem def version_string; end end -Tapioca::Gemfile::Gem::IGNORED_GEMS = T.let(T.unsafe(nil), Array) +Tapioca::Gemfile::GemSpec::IGNORED_GEMS = T.let(T.unsafe(nil), Array) Tapioca::Gemfile::Spec = T.type_alias { T.any(Gem::Specification, T.all(Bundler::RemoteSpecification, Bundler::StubSpecification)) } class Tapioca::Generator < ::Thor::Shell::Color @@ -1182,7 +1182,7 @@ class Tapioca::Generator < ::Thor::Shell::Color 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 } + sig { params(gem: Tapioca::Gemfile::GemSpec).void } def compile_gem_rbi(gem); end sig { returns(Tapioca::Compilers::SymbolTableCompiler) } @@ -1218,7 +1218,7 @@ class Tapioca::Generator < ::Thor::Shell::Color sig { params(gem_name: String, version: String).returns(Pathname) } def gem_rbi_filename(gem_name, version); end - sig { params(gem_names: T::Array[String]).returns(T::Array[Tapioca::Gemfile::Gem]) } + sig { params(gem_names: T::Array[String]).returns(T::Array[Tapioca::Gemfile::GemSpec]) } def gems_to_generate(gem_names); end sig { params(eager_load: T::Boolean).void } @@ -1316,7 +1316,7 @@ class Tapioca::Loader def load_bundle(initialize_file, require_file); end sig { params(environment_load: T::Boolean, eager_load: T::Boolean).void } - def load_rails(environment_load: T.unsafe(nil), eager_load: T.unsafe(nil)); end + def load_rails_application(environment_load: T.unsafe(nil), eager_load: T.unsafe(nil)); end private @@ -1329,15 +1329,9 @@ class Tapioca::Loader sig { void } def load_rails_engines; end - sig { void } - def load_rake; end - sig { returns(T::Array[T.untyped]) } def rails_engines; end - sig { void } - def require_bundle; end - sig { params(file: T.nilable(String)).void } def require_helper(file); end
true
Other
Homebrew
brew
bc4abc1fa9eaa7dec8fa51b6f5238079a74c6de8.json
Update RBI files for tapioca.
Library/Homebrew/sorbet/rbi/todo.rbi
@@ -10,4 +10,3 @@ module T::InterfaceWrapper::Helpers; end module T::Private::Abstract::Hooks; end module T::Private::Methods::MethodHooks; end module T::Private::Methods::SingletonMethodHooks; end -module Tapioca::Gemfile::Gem::Specification; end
true
Other
Homebrew
brew
87f5d989233476f364f9d15316ff68c6d3b6f922.json
Add test for multi-word service argument warpping
Library/Homebrew/test/caveats_spec.rb
@@ -124,7 +124,21 @@ def plist caveats = described_class.new(f).caveats expect(f.service?).to eq(true) - expect(caveats).to include("'#{f.bin}/php' 'test'") + expect(caveats).to include("#{f.bin}/php test") + expect(caveats).to include("background service") + end + + it "wraps multi-word service parameters" do + f = formula do + url "foo-1.0" + service do + run [bin/"nginx", "-g", "daemon off;"] + end + end + caveats = described_class.new(f).caveats + + expect(f.service?).to eq(true) + expect(caveats).to include("#{f.bin}/nginx -g 'daemon off;'") expect(caveats).to include("background service") end
false
Other
Homebrew
brew
a0cc4a467c6506d7e0233cb3a0030c891300e565.json
Update RBI files for sorbet.
Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi
@@ -9815,10 +9815,10 @@ module Homebrew::EnvConfig def self.force_brewed_git?(); end - def self.force_homebrew_on_linux?(); end - def self.force_homebrew_core_repo_on_linux?(); end + def self.force_homebrew_on_linux?(); end + def self.force_vendor_ruby?(); end def self.ftp_proxy(); end
false
Other
Homebrew
brew
1532c081f264a8c762b57bbfff0dd1eefc2acec5.json
Add space character in map (pacify brew style)
Library/Homebrew/extend/os/mac/caveats.rb
@@ -37,7 +37,7 @@ def plist_caveats if f.plist_manual || f.service? command = if f.service? - f.service.command.map{ |arg| "'#{arg}'" }.join(" ") + f.service.command.map { |arg| "'#{arg}'" }.join(" ") else f.plist_manual end
false
Other
Homebrew
brew
7d0a36752b6d9b0fee0b2ae650d9042335f99cd7.json
curl: echo any cookies received on a redirect
Library/Homebrew/utils/curl.rb
@@ -33,6 +33,9 @@ def curl_args(*extra_args, **options) # do not load .curlrc unless requested (must be the first argument) args << "--disable" unless Homebrew::EnvConfig.curlrc? + # echo any cookies received on a redirect + args << "--cookie-jar" << "/dev/null" + args << "--globoff" args << "--show-error"
false
Other
Homebrew
brew
999a3c66f98273329f40f85048da9f6428b4862d.json
docs: use brew --repository shorthand in Cask Cookbook
docs/Cask-Cookbook.md
@@ -297,7 +297,7 @@ There are a few different ways the `appcast` can be determined: * An appcast can be any URL hosted by the app’s developer that changes every time a new release is out or that contains the version number of the current release (e.g. a download HTML page). Webpages that only change on new version releases are preferred, as are sites that do not contain previous version strings (i.e. avoid changelog pages if the download page contains the current version number but not older ones). Example: [`razorsql.rb`](https://github.com/Homebrew/homebrew-cask/blob/645dbb8228ec2f1f217ed1431e188687aac13ca5/Casks/razorsql.rb#L6) -The [`find-appcast`](https://github.com/Homebrew/homebrew-cask/blob/HEAD/developer/bin/find-appcast) script is able to identify some of these, as well as `electron-builder` appcasts which are trickier to find by hand. Run it with `"$(brew --repository)/Library/Taps/homebrew/homebrew-cask/developer/bin/find-appcast" '</path/to/software.app>'`. +The [`find-appcast`](https://github.com/Homebrew/homebrew-cask/blob/HEAD/developer/bin/find-appcast) script is able to identify some of these, as well as `electron-builder` appcasts which are trickier to find by hand. Run it with `"$(brew --repository homebrew/cask)/developer/bin/find-appcast" '</path/to/software.app>'`. #### Parameters @@ -925,13 +925,13 @@ This is the most useful uninstall key. `pkgutil:` is often sufficient to complet IDs for the most recently-installed packages can be listed using the command: ```bash -$ "$(brew --repository)/Library/Taps/homebrew/homebrew-cask/developer/bin/list_recent_pkg_ids" +$ "$(brew --repository homebrew/cask)/developer/bin/list_recent_pkg_ids" ``` `pkgutil:` also accepts a regular expression match against multiple package IDs. The regular expressions are somewhat nonstandard. To test a `pkgutil:` regular expression against currently-installed packages, use the command: ```bash -$ "$(brew --repository)/Library/Taps/homebrew/homebrew-cask/developer/bin/list_pkg_ids_by_regexp" <regular-expression> +$ "$(brew --repository homebrew/cask)/developer/bin/list_pkg_ids_by_regexp" <regular-expression> ``` #### List Files Associated With a pkg Id @@ -949,27 +949,27 @@ Listing the associated files can help you assess whether the package included an IDs for currently loaded `launchctl` jobs can be listed using the command: ```bash -$ "$(brew --repository)/Library/Taps/homebrew/homebrew-cask/developer/bin/list_loaded_launchjob_ids" +$ "$(brew --repository homebrew/cask)/developer/bin/list_loaded_launchjob_ids" ``` IDs for all installed `launchctl` jobs can be listed using the command: ```bash -$ "$(brew --repository)/Library/Taps/homebrew/homebrew-cask/developer/bin/list_installed_launchjob_ids" +$ "$(brew --repository homebrew/cask)/developer/bin/list_installed_launchjob_ids" ``` #### `uninstall` Key `quit:` Bundle IDs for currently running Applications can be listed using the command: ```bash -$ "$(brew --repository)/Library/Taps/homebrew/homebrew-cask/developer/bin/list_running_app_ids" +$ "$(brew --repository homebrew/cask)/developer/bin/list_running_app_ids" ``` Bundle IDs inside an Application bundle on disk can be listed using the command: ```bash -$ "$(brew --repository)/Library/Taps/homebrew/homebrew-cask/developer/bin/list_ids_in_app" '/path/to/application.app' +$ "$(brew --repository homebrew/cask)/developer/bin/list_ids_in_app" '/path/to/application.app' ``` #### `uninstall` Key `signal:` @@ -1005,7 +1005,7 @@ Unlike `quit:` directives, Unix signals originate from the current user, not fro Login items associated with an Application bundle on disk can be listed using the command: ```bash -$ "$(brew --repository)/Library/Taps/homebrew/homebrew-cask/developer/bin/list_login_items_for_app" '/path/to/application.app' +$ "$(brew --repository homebrew/cask)/developer/bin/list_login_items_for_app" '/path/to/application.app' ``` Note that you will likely need to have opened the app at least once for any login items to be present. @@ -1015,13 +1015,13 @@ Note that you will likely need to have opened the app at least once for any logi IDs for currently loaded kernel extensions can be listed using the command: ```bash -$ "$(brew --repository)/Library/Taps/homebrew/homebrew-cask/developer/bin/list_loaded_kext_ids" +$ "$(brew --repository homebrew/cask)/developer/bin/list_loaded_kext_ids" ``` IDs inside a kext bundle you have located on disk can be listed using the command: ```bash -$ "$(brew --repository)/Library/Taps/homebrew/homebrew-cask/developer/bin/list_id_in_kext" '/path/to/name.kext' +$ "$(brew --repository homebrew/cask)/developer/bin/list_id_in_kext" '/path/to/name.kext' ``` #### `uninstall` Key `script:` @@ -1060,19 +1060,19 @@ Advanced users may wish to work with a `pkg` file manually, without having the p A list of files which may be installed from a `pkg` can be extracted using the command: ```bash -$ "$(brew --repository)/Library/Taps/homebrew/homebrew-cask/developer/bin/list_payload_in_pkg" '/path/to/my.pkg' +$ "$(brew --repository homebrew/cask)/developer/bin/list_payload_in_pkg" '/path/to/my.pkg' ``` Candidate application names helpful for determining the name of a Cask may be extracted from a `pkg` file using the command: ```bash -$ "$(brew --repository)/Library/Taps/homebrew/homebrew-cask/developer/bin/list_apps_in_pkg" '/path/to/my.pkg' +$ "$(brew --repository homebrew/cask)/developer/bin/list_apps_in_pkg" '/path/to/my.pkg' ``` Candidate package IDs which may be useful in a `pkgutil:` key may be extracted from a `pkg` file using the command: ```bash -$ "$(brew --repository)/Library/Taps/homebrew/homebrew-cask/developer/bin/list_ids_in_pkg" '/path/to/my.pkg' +$ "$(brew --repository homebrew/cask)/developer/bin/list_ids_in_pkg" '/path/to/my.pkg' ``` A fully manual method for finding bundle ids in a package file follows: @@ -1122,7 +1122,7 @@ The parameter doesn’t mean you should trust the source blindly, but we only ap Web browsers may obscure the direct `url` download location for a variety of reasons. Homebrew Cask supplies a script which can read extended file attributes to extract the actual source URL for most files downloaded by a browser on macOS. The script usually emits multiple candidate URLs; you may have to test each of them: ```bash -$ $(brew --repository)/Library/Taps/homebrew/homebrew-cask/developer/bin/list_url_attributes_on_file <file> +$ $(brew --repository homebrew/cask)/developer/bin/list_url_attributes_on_file <file> ``` #### Subversion URLs
true
Other
Homebrew
brew
999a3c66f98273329f40f85048da9f6428b4862d.json
docs: use brew --repository shorthand in Cask Cookbook
docs/Formula-Cookbook.md
@@ -361,7 +361,7 @@ Everything is built on Git, so contribution is easy: ```sh brew update # required in more ways than you think (initialises the brew git repository if you don't already have it) -cd $(brew --repo homebrew/core) +cd $(brew --repository homebrew/core) # Create a new git branch for your formula so your pull request is easy to # modify if any changes come up during review. git checkout -b <some-descriptive-name> origin/master @@ -542,7 +542,7 @@ Instead of `git diff | pbcopy`, for some editors `git diff >> path/to/your/formu ## Advanced formula tricks -If anything isn’t clear, you can usually figure it out by `grep`ping the `$(brew --repo homebrew/core)` directory. Please submit a pull request to amend this document if you think it will help! +If anything isn’t clear, you can usually figure it out by `grep`ping the `$(brew --repository homebrew/core)` directory. Please submit a pull request to amend this document if you think it will help! ### `livecheck` blocks
true
Other
Homebrew
brew
999a3c66f98273329f40f85048da9f6428b4862d.json
docs: use brew --repository shorthand in Cask Cookbook
docs/Homebrew-linuxbrew-core-Maintainer-Guide.md
@@ -44,7 +44,7 @@ variable, or let `hub fork` add a remote for you. ```bash brew install hub -cd $(brew --repo homebrew/core) +cd $(brew --repository homebrew/core) git remote add homebrew https://github.com/Homebrew/homebrew-core.git hub fork --remote-name=$HOMEBREW_GITHUB_USER ```
true
Other
Homebrew
brew
3e1c8ea8778d1a33f15212e33a701c969e5dfe34.json
Apply suggestions from code review
Library/Homebrew/upgrade.rb
@@ -44,7 +44,7 @@ def upgrade_formulae( formula_installers = formulae_to_install.map do |formula| Migrator.migrate_if_needed(formula, force: force) begin - fi = create_formula_installer( + fi = create_and_fetch_formula_installer( formula, flags: flags, installed_on_request: installed_on_request, @@ -89,7 +89,7 @@ def print_upgrade_message(formula, fi_options) EOS end - def create_formula_installer( + def create_and_fetch_formula_installer( formula, flags:, installed_on_request: false, @@ -137,7 +137,7 @@ def create_formula_installer( }.compact, ) end - private_class_method :create_formula_installer + private_class_method :create_and_fetch_formula_installer def upgrade_formula(formula_installer, verbose: false) formula = formula_installer.formula
false
Other
Homebrew
brew
4fc876fb2356a796e541e20b264ab7c71e3ea42e.json
Update RBI files for tapioca.
Library/Homebrew/sorbet/rbi/gems/tapioca@0.4.25.rbi
@@ -1082,6 +1082,9 @@ class Tapioca::Gemfile def lockfile; end + sig { returns([T::Array[Gem::Specification], T::Array[String]]) } + def materialize_deps; end + sig { returns(Bundler::Runtime) } def runtime; end end
true
Other
Homebrew
brew
4fc876fb2356a796e541e20b264ab7c71e3ea42e.json
Update RBI files for tapioca.
Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi
@@ -9849,6 +9849,8 @@ module Homebrew::EnvConfig def self.no_bootsnap?(); end + def self.no_cleanup_formulae(); end + def self.no_color?(); end def self.no_compat?(); end
true
Other
Homebrew
brew
4fc876fb2356a796e541e20b264ab7c71e3ea42e.json
Update RBI files for tapioca.
Library/Homebrew/sorbet/rbi/todo.rbi
@@ -10,3 +10,4 @@ module T::InterfaceWrapper::Helpers; end module T::Private::Abstract::Hooks; end module T::Private::Methods::MethodHooks; end module T::Private::Methods::SingletonMethodHooks; end +module Tapioca::Gemfile::Gem::Specification; end
true
Other
Homebrew
brew
525137f37e5be05087dfe57b426ef0251eef252c.json
Update RBI files for sorbet.
Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi
@@ -9849,6 +9849,8 @@ module Homebrew::EnvConfig def self.no_bootsnap?(); end + def self.no_cleanup_formulae(); end + def self.no_color?(); end def self.no_compat?(); end
false
Other
Homebrew
brew
05c1c5895ebe80f9737557fa320d2c30de68a001.json
Apply suggestions from code review
Library/Homebrew/brew.sh
@@ -51,8 +51,23 @@ HOMEBREW_CACHE="${HOMEBREW_CACHE:-${HOMEBREW_DEFAULT_CACHE}}" HOMEBREW_LOGS="${HOMEBREW_LOGS:-${HOMEBREW_DEFAULT_LOGS}}" HOMEBREW_TEMP="${HOMEBREW_TEMP:-${HOMEBREW_DEFAULT_TEMP}}" +# Don't need to handle a default case. +# HOMEBREW_LIBRARY set by bin/brew +# shellcheck disable=SC2249,SC2154 +case "$*" in + --cellar) echo "${HOMEBREW_CELLAR}"; exit 0 ;; + --repository|--repo) echo "${HOMEBREW_REPOSITORY}"; exit 0 ;; + --caskroom) echo "${HOMEBREW_PREFIX}/Caskroom"; exit 0 ;; + --cache) echo "${HOMEBREW_CACHE}"; exit 0 ;; + shellenv) source "${HOMEBREW_LIBRARY}/Homebrew/cmd/shellenv.sh"; homebrew-shellenv; exit 0 ;; + formulae) source "${HOMEBREW_LIBRARY}/Homebrew/cmd/formulae.sh"; homebrew-formulae; exit 0 ;; + casks) source "${HOMEBREW_LIBRARY}/Homebrew/cmd/casks.sh"; homebrew-casks; exit 0 ;; + # falls back to cmd/prefix.rb on a non-zero return + --prefix*) source "${HOMEBREW_LIBRARY}/Homebrew/prefix.sh"; homebrew-prefix "$@" && exit 0 ;; +esac + ##### -##### Next, define helper functions for prompting. +##### Next, define all helper functions. ##### # These variables are set from the user environment. @@ -110,25 +125,6 @@ odie() { exit 1 } -# Don't need to handle a default case. -# HOMEBREW_LIBRARY set by bin/brew -# shellcheck disable=SC2249,SC2154 -case "$*" in - --cellar) echo "${HOMEBREW_CELLAR}"; exit 0 ;; - --repository|--repo) echo "${HOMEBREW_REPOSITORY}"; exit 0 ;; - --caskroom) echo "${HOMEBREW_PREFIX}/Caskroom"; exit 0 ;; - --cache) echo "${HOMEBREW_CACHE}"; exit 0 ;; - shellenv) source "${HOMEBREW_LIBRARY}/Homebrew/cmd/shellenv.sh"; homebrew-shellenv; exit 0 ;; - formulae) source "${HOMEBREW_LIBRARY}/Homebrew/cmd/formulae.sh"; homebrew-formulae; exit 0 ;; - casks) source "${HOMEBREW_LIBRARY}/Homebrew/cmd/casks.sh"; homebrew-casks; exit 0 ;; - # falls back to cmd/prefix.rb on a non-zero return - --prefix*) source "${HOMEBREW_LIBRARY}/Homebrew/prefix.sh"; homebrew-prefix "$@" && exit 0 ;; -esac - -##### -##### Next, define the reset of helper functions. -##### - safe_cd() { cd "$@" >/dev/null || odie "Failed to cd to $*!" }
true
Other
Homebrew
brew
05c1c5895ebe80f9737557fa320d2c30de68a001.json
Apply suggestions from code review
Library/Homebrew/cmd/shellenv.sh
@@ -4,24 +4,14 @@ #: #: The variables `HOMEBREW_PREFIX`, `HOMEBREW_CELLAR` and `HOMEBREW_REPOSITORY` are also exported to avoid querying them multiple times. #: The variable `HOMEBREW_SHELLENV_PREFIX` will be exported to avoid adding duplicate entries to the environment variables. -#: -#: Consider adding evaluation of this command's output to your dotfiles (e.g. `~/.profile`, `~/.bash_profile`, or `~/.zprofile`) -#: with: `eval "$(/path/to/brew shellenv)"`. -#: -#: The variable `HOMEBREW_SHELLENV_PREFIX` may be inherited from the parent shell session. If you explicitly -#: modified the path variables (e.g. `PATH`) in your dotfiles which breaks the subshell varibale inheritecement, -#: please use `eval "$(HOMEBREW_SHELLENV_PREFIX='' /path/to/brew shellenv)"` to always get all the export statements. +#: Consider adding evaluation of this command's output to your dotfiles (e.g. `~/.profile`, `~/.bash_profile`, or `~/.zprofile`) with: `eval $(brew shellenv)` # HOMEBREW_CELLAR and HOMEBREW_PREFIX are set by extend/ENV/super.rb # HOMEBREW_REPOSITORY is set by bin/brew # shellcheck disable=SC2154 homebrew-shellenv() { - if [[ "${HOMEBREW_SHELLENV_PREFIX}" == "${HOMEBREW_PREFIX}" ]]; then - [[ "$(PATH="${HOMEBREW_PATH}" command -v brew)" == "${HOMEBREW_PREFIX}/bin/brew" ]] && return - opoo "You have set HOMEBREW_SHELLENV_PREFIX=\"${HOMEBREW_SHELLENV_PREFIX}\"," \ - "but the brew's executable is not present in your PATH." \ - "Please run \`brew help shellenv\` for more information." - fi + [[ "${HOMEBREW_SHELLENV_PREFIX}" == "${HOMEBREW_PREFIX}" && + "$(PATH="${HOMEBREW_PATH}" command -v brew)" == "${HOMEBREW_PREFIX}/bin/brew" ]] && return case "$(/bin/ps -p "${PPID}" -c -o comm=)" in fish | -fish)
true
Other
Homebrew
brew
05c1c5895ebe80f9737557fa320d2c30de68a001.json
Apply suggestions from code review
docs/Manpage.md
@@ -570,13 +570,7 @@ Print export statements. When run in a shell, this installation of Homebrew will The variables `HOMEBREW_PREFIX`, `HOMEBREW_CELLAR` and `HOMEBREW_REPOSITORY` are also exported to avoid querying them multiple times. The variable `HOMEBREW_SHELLENV_PREFIX` will be exported to avoid adding duplicate entries to the environment variables. - -Consider adding evaluation of this command's output to your dotfiles (e.g. `~/.profile`, `~/.bash_profile`, or `~/.zprofile`) -with: `eval "$(/path/to/brew shellenv)"`. - -The variable `HOMEBREW_SHELLENV_PREFIX` may be inherited from the parent shell session. If you explicitly -modified the path variables (e.g. `PATH`) in your dotfiles which breaks the subshell varibale inheritecement, -please use `eval "$(HOMEBREW_SHELLENV_PREFIX='' /path/to/brew shellenv)"` to always get all the export statements. +Consider adding evaluation of this command's output to your dotfiles (e.g. `~/.profile`, `~/.bash_profile`, or `~/.zprofile`) with: `eval $(brew shellenv)` ### `tap` [*`options`*] [*`user`*`/`*`repo`*] [*`URL`*]
true
Other
Homebrew
brew
05c1c5895ebe80f9737557fa320d2c30de68a001.json
Apply suggestions from code review
manpages/brew.1
@@ -792,13 +792,7 @@ Search for \fItext\fR in the given database\. Print export statements\. When run in a shell, this installation of Homebrew will be added to your \fBPATH\fR, \fBMANPATH\fR, and \fBINFOPATH\fR\. . .P -The variables \fBHOMEBREW_PREFIX\fR, \fBHOMEBREW_CELLAR\fR and \fBHOMEBREW_REPOSITORY\fR are also exported to avoid querying them multiple times\. The variable \fBHOMEBREW_SHELLENV_PREFIX\fR will be exported to avoid adding duplicate entries to the environment variables\. -. -.P -Consider adding evaluation of this command\'s output to your dotfiles (e\.g\. \fB~/\.profile\fR, \fB~/\.bash_profile\fR, or \fB~/\.zprofile\fR) with: \fBeval "$(/path/to/brew shellenv)"\fR\. -. -.P -The variable \fBHOMEBREW_SHELLENV_PREFIX\fR may be inherited from the parent shell session\. If you explicitly modified the path variables (e\.g\. \fBPATH\fR) in your dotfiles which breaks the subshell varibale inheritecement, please use \fBeval "$(HOMEBREW_SHELLENV_PREFIX=\'\' /path/to/brew shellenv)"\fR to always get all the export statements\. +The variables \fBHOMEBREW_PREFIX\fR, \fBHOMEBREW_CELLAR\fR and \fBHOMEBREW_REPOSITORY\fR are also exported to avoid querying them multiple times\. The variable \fBHOMEBREW_SHELLENV_PREFIX\fR will be exported to avoid adding duplicate entries to the environment variables\. Consider adding evaluation of this command\'s output to your dotfiles (e\.g\. \fB~/\.profile\fR, \fB~/\.bash_profile\fR, or \fB~/\.zprofile\fR) with: \fBeval $(brew shellenv)\fR . .SS "\fBtap\fR [\fIoptions\fR] [\fIuser\fR\fB/\fR\fIrepo\fR] [\fIURL\fR]" Tap a formula repository\.
true
Other
Homebrew
brew
92dd0229cb003013f99054f4b00e73fb485aa21f.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
@@ -9669,6 +9669,10 @@ module Homebrew::API::Cask extend ::T::Private::Methods::SingletonMethodHooks end +module Homebrew::API::CaskSource + extend ::T::Private::Methods::SingletonMethodHooks +end + module Homebrew::API::Formula extend ::T::Private::Methods::SingletonMethodHooks end
false
Other
Homebrew
brew
27fb6506a0ab3c4edc131818453dd9022f99e4e7.json
Apply suggestions from code review Co-authored-by: Carlo Cabrera <30379873+carlocab@users.noreply.github.com>
Library/Homebrew/cmd/shellenv.sh
@@ -19,7 +19,7 @@ homebrew-shellenv() { if [[ "${HOMEBREW_SHELLENV_PREFIX}" == "${HOMEBREW_PREFIX}" ]]; then [[ "$(PATH="${HOMEBREW_PATH}" command -v brew)" == "${HOMEBREW_PREFIX}/bin/brew" ]] && return opoo "You have set HOMEBREW_SHELLENV_PREFIX=\"${HOMEBREW_SHELLENV_PREFIX}\"," \ - "but the brew's executable does not present in your PATH." \ + "but the brew's executable is not present in your PATH." \ "Please run \`brew help shellenv\` for more information." fi
false
Other
Homebrew
brew
c56c7d91ba56c6dd0cb37369a23e7e08b4cace76.json
Update RBI files for rubocop.
Library/Homebrew/sorbet/rbi/gems/rubocop@1.20.0.rbi
@@ -875,6 +875,29 @@ end RuboCop::Cop::AmbiguousCopName::MSG = T.let(T.unsafe(nil), String) +class RuboCop::Cop::AnnotationComment + extend ::Forwardable + + def initialize(comment, keywords); end + + def annotation?; end + def bounds; end + def colon; end + def comment; end + def correct?(colon:); end + def keyword; end + def margin; end + def note; end + def space; end + + private + + def just_keyword_of_sentence?; end + def keyword_appearance?; end + def keywords; end + def split_comment(comment); end +end + module RuboCop::Cop::ArrayMinSize private @@ -1077,6 +1100,31 @@ RuboCop::Cop::Bundler::GemComment::RESTRICTIVE_VERSION_SPECIFIERS_OPTION = T.let RuboCop::Cop::Bundler::GemComment::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) RuboCop::Cop::Bundler::GemComment::VERSION_SPECIFIERS_OPTION = T.let(T.unsafe(nil), String) +class RuboCop::Cop::Bundler::GemFilename < ::RuboCop::Cop::Base + include ::RuboCop::Cop::ConfigurableEnforcedStyle + include ::RuboCop::Cop::RangeHelp + + def on_new_investigation; end + + private + + def expected_gemfile?(basename); end + def gemfile_offense?(basename); end + def gemfile_required?; end + def gems_rb_offense?(basename); end + def gems_rb_required?; end + def register_gemfile_offense(file_path, basename); end + def register_gems_rb_offense(file_path, basename); end + def register_offense(file_path, basename); end +end + +RuboCop::Cop::Bundler::GemFilename::GEMFILE_FILES = T.let(T.unsafe(nil), Array) +RuboCop::Cop::Bundler::GemFilename::GEMS_RB_FILES = T.let(T.unsafe(nil), Array) +RuboCop::Cop::Bundler::GemFilename::MSG_GEMFILE_MISMATCHED = T.let(T.unsafe(nil), String) +RuboCop::Cop::Bundler::GemFilename::MSG_GEMFILE_REQUIRED = T.let(T.unsafe(nil), String) +RuboCop::Cop::Bundler::GemFilename::MSG_GEMS_RB_MISMATCHED = T.let(T.unsafe(nil), String) +RuboCop::Cop::Bundler::GemFilename::MSG_GEMS_RB_REQUIRED = T.let(T.unsafe(nil), String) + class RuboCop::Cop::Bundler::GemVersion < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::GemDeclaration @@ -1522,11 +1570,11 @@ module RuboCop::Cop::Documentation end module RuboCop::Cop::DocumentationComment - include ::RuboCop::Cop::Style::AnnotationComment extend ::RuboCop::AST::NodePattern::Macros private + def annotation_keywords; end def documentation_comment?(node); end def interpreter_directive_comment?(comment); end def precede?(node1, node2); end @@ -1665,6 +1713,7 @@ end module RuboCop::Cop::FrozenStringLiteral private + def frozen_string_literal?(node); end def frozen_string_literal_comment_exists?; end def frozen_string_literal_specified?; end def frozen_string_literals_disabled?; end @@ -1678,7 +1727,8 @@ end RuboCop::Cop::FrozenStringLiteral::FROZEN_STRING_LITERAL = T.let(T.unsafe(nil), String) RuboCop::Cop::FrozenStringLiteral::FROZEN_STRING_LITERAL_ENABLED = T.let(T.unsafe(nil), String) -RuboCop::Cop::FrozenStringLiteral::FROZEN_STRING_LITERAL_TYPES = T.let(T.unsafe(nil), Array) +RuboCop::Cop::FrozenStringLiteral::FROZEN_STRING_LITERAL_TYPES_RUBY27 = T.let(T.unsafe(nil), Array) +RuboCop::Cop::FrozenStringLiteral::FROZEN_STRING_LITERAL_TYPES_RUBY30 = T.let(T.unsafe(nil), Array) module RuboCop::Cop::GemDeclaration extend ::RuboCop::AST::NodePattern::Macros @@ -7434,16 +7484,6 @@ end RuboCop::Cop::Style::AndOr::MSG = T.let(T.unsafe(nil), String) -module RuboCop::Cop::Style::AnnotationComment - private - - def annotation?(comment); end - def just_first_word_of_sentence?(first_word, colon, space, note); end - def keyword?(word); end - def keyword_appearance?(first_word, colon, space); end - def split_comment(comment); end -end - class RuboCop::Cop::Style::ArgumentsForwarding < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector @@ -7632,6 +7672,7 @@ class RuboCop::Cop::Style::BlockDelimiters < ::RuboCop::Cop::Base def array_or_range?(node); end def autocorrect(corrector, node); end + def begin_required?(block_node); end def braces_for_chaining_message(node); end def braces_for_chaining_style?(node); end def braces_required_message(node); end @@ -7640,6 +7681,7 @@ class RuboCop::Cop::Style::BlockDelimiters < ::RuboCop::Cop::Base def braces_style?(node); end def conditional?(node); end def correction_would_break_code?(node); end + def end_of_chain(node); end def functional_block?(node); end def functional_method?(method_name); end def get_blocks(node, &block); end @@ -7651,7 +7693,7 @@ class RuboCop::Cop::Style::BlockDelimiters < ::RuboCop::Cop::Base def procedural_oneliners_may_have_braces?; end def proper_block_style?(node); end def replace_braces_with_do_end(corrector, loc); end - def replace_do_end_with_braces(corrector, loc); end + def replace_do_end_with_braces(corrector, node); end def return_value_of_scope?(node); end def return_value_used?(node); end def semantic_block_style?(node); end @@ -7944,23 +7986,19 @@ RuboCop::Cop::Style::CommandLiteral::MSG_USE_BACKTICKS = T.let(T.unsafe(nil), St RuboCop::Cop::Style::CommandLiteral::MSG_USE_PERCENT_X = T.let(T.unsafe(nil), String) class RuboCop::Cop::Style::CommentAnnotation < ::RuboCop::Cop::Base - include ::RuboCop::Cop::Style::AnnotationComment include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector def on_new_investigation; end private - def annotation_range(comment, margin, first_word, colon, space); end - def concat_length(*args); end - def correct_annotation?(first_word, colon, space, note); end - def correct_colon_annotation?(first_word, colon, space, note); end - def correct_offense(corrector, range, first_word); end - def correct_space_annotation?(first_word, colon, space, note); end + def annotation_range(annotation); end + def correct_offense(corrector, range, keyword); end def first_comment_line?(comments, index); end def inline_comment?(comment); end - def register_offense(range, note, first_word); end + def keywords; end + def register_offense(annotation); end def requires_colon?; end end @@ -8191,7 +8229,6 @@ RuboCop::Cop::Style::DocumentDynamicEvalDefinition::MSG = T.let(T.unsafe(nil), S RuboCop::Cop::Style::DocumentDynamicEvalDefinition::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) class RuboCop::Cop::Style::Documentation < ::RuboCop::Cop::Base - include ::RuboCop::Cop::Style::AnnotationComment include ::RuboCop::Cop::DocumentationComment def constant_definition?(param0 = T.unsafe(nil)); end @@ -8218,7 +8255,6 @@ end RuboCop::Cop::Style::Documentation::MSG = T.let(T.unsafe(nil), String) class RuboCop::Cop::Style::DocumentationMethod < ::RuboCop::Cop::Base - include ::RuboCop::Cop::Style::AnnotationComment include ::RuboCop::Cop::DocumentationComment include ::RuboCop::Cop::DefNode @@ -9601,6 +9637,7 @@ end RuboCop::Cop::Style::MultipleComparison::MSG = T.let(T.unsafe(nil), String) class RuboCop::Cop::Style::MutableConstant < ::RuboCop::Cop::Base + include ::RuboCop::Cop::Style::MutableConstant::ShareableConstantValue include ::RuboCop::Cop::FrozenStringLiteral include ::RuboCop::Cop::ConfigurableEnforcedStyle extend ::RuboCop::Cop::AutoCorrector @@ -9616,16 +9653,30 @@ class RuboCop::Cop::Style::MutableConstant < ::RuboCop::Cop::Base def check(value); end def correct_splat_expansion(corrector, expr, splat_value); end def frozen_regexp_or_range_literals?(node); end - def frozen_string_literal?(node); end def immutable_literal?(node); end def mutable_literal?(value); end def on_assignment(value); end def requires_parentheses?(node); end + def shareable_constant_value?(node); end def strict_check(value); end end RuboCop::Cop::Style::MutableConstant::MSG = T.let(T.unsafe(nil), String) +module RuboCop::Cop::Style::MutableConstant::ShareableConstantValue + private + + def magic_comment_in_scope(node); end + def processed_source_till_node(node); end + def recent_shareable_value?(node); end + def shareable_constant_value_enabled?(value); end + + class << self + def magic_comment_in_scope(node); end + def recent_shareable_value?(node); end + end +end + class RuboCop::Cop::Style::NegatedIf < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::NegativeConditional
false
Other
Homebrew
brew
326321c1fdcba7717ec27e3db8cec9c0dfe15069.json
cli/parser: allow commands that look like options
Library/Homebrew/cli/parser.rb
@@ -264,6 +264,7 @@ def parse_remaining(argv, ignore_invalid_options: false) remaining = [] argv, non_options = split_non_options(argv) + allow_commands = Array(@named_args_type).include?(:command) while i < argv.count begin @@ -279,7 +280,7 @@ def parse_remaining(argv, ignore_invalid_options: false) i += 1 end rescue OptionParser::InvalidOption - if ignore_invalid_options + if ignore_invalid_options || (allow_commands && Commands.path(arg)) remaining << arg else $stderr.puts generate_help_text
true
Other
Homebrew
brew
326321c1fdcba7717ec27e3db8cec9c0dfe15069.json
cli/parser: allow commands that look like options
Library/Homebrew/test/cli/parser_spec.rb
@@ -559,5 +559,19 @@ Homebrew::CLI::MaxNamedArgumentsError, /This command does not take more than 1 formula or cask argument/ ) end + + it "accepts commands with :command" do + parser = described_class.new do + named_args :command + end + expect { parser.parse(["--prefix", "--version"]) }.not_to raise_error + end + + it "doesn't accept invalid options with :command" do + parser = described_class.new do + named_args :command + end + expect { parser.parse(["--not-a-command"]) }.to raise_error(OptionParser::InvalidOption, /--not-a-command/) + end end end
true