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 | 81f262ece3ba6215579c1a0147bc281590ea7d3d.json | utils/gems: use env shebang when installing gems | Library/Homebrew/utils/gems.rb | @@ -81,7 +81,8 @@ def install_gem!(name, version: nil, setup_gem_environment: true)
ohai_if_defined "Installing '#{name}' gem"
# `document: []` is equivalent to --no-document
# `build_args: []` stops ARGV being used as a default
- specs = Gem.install name, version, document: [], build_args: []
+ # `env_shebang: true` makes shebangs generic to allow switching between system and Portable Ruby
+ specs = Gem.install name, version, document: [], build_args: [], env_shebang: true
end
specs += specs.flat_map(&:runtime_dependencies) | false |
Other | Homebrew | brew | 75eb7c56f56883e9b36794317c06a7ba2de851aa.json | Update RBI files for bootsnap.
Autogenerated by the [vendor-gems](https://github.com/Homebrew/brew/blob/HEAD/.github/workflows/vendor-gemss.yml) workflow. | Library/Homebrew/sorbet/rbi/gems/bootsnap@1.14.0.rbi | @@ -14,12 +14,12 @@ module Bootsnap
def absolute_path?(path); end
def default_setup; end
def instrumentation=(callback); end
- def iseq_cache_supported?; end
def log!; end
def logger; end
def logger=(logger); end
def rb_get_path(fname); end
- def setup(cache_dir:, development_mode: T.unsafe(nil), load_path_cache: T.unsafe(nil), autoload_paths_cache: T.unsafe(nil), disable_trace: T.unsafe(nil), compile_cache_iseq: T.unsafe(nil), compile_cache_yaml: T.unsafe(nil), compile_cache_json: T.unsafe(nil)); end
+ def setup(cache_dir:, development_mode: T.unsafe(nil), load_path_cache: T.unsafe(nil), ignore_directories: T.unsafe(nil), compile_cache_iseq: T.unsafe(nil), compile_cache_yaml: T.unsafe(nil), compile_cache_json: T.unsafe(nil)); end
+ def unload_cache!; end
end
end
@@ -54,7 +54,7 @@ module Bootsnap::LoadPathCache
def enabled?; end
def load_path_cache; end
def loaded_features_index; end
- def setup(cache_path:, development_mode:); end
+ def setup(cache_path:, development_mode:, ignore_directories:); end
def supported?; end
def unload!; end
end
@@ -179,6 +179,8 @@ Bootsnap::LoadPathCache::Path::VOLATILE = T.let(T.unsafe(nil), Symbol)
module Bootsnap::LoadPathCache::PathScanner
class << self
def call(path); end
+ def ignored_directories; end
+ def ignored_directories=(_arg0); end
def os_path(path); end
def walk(absolute_dir_path, relative_dir_path, &block); end
end | true |
Other | Homebrew | brew | 75eb7c56f56883e9b36794317c06a7ba2de851aa.json | Update RBI files for bootsnap.
Autogenerated by the [vendor-gems](https://github.com/Homebrew/brew/blob/HEAD/.github/workflows/vendor-gemss.yml) workflow. | Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi | @@ -4281,6 +4281,7 @@ class Gem::Specification
def to_ruby(); end
LATEST_RUBY_WITHOUT_PATCH_VERSIONS = ::T.let(nil, ::T.untyped)
+ ORIGINAL_LOCAL_PLATFORM = ::T.let(nil, ::T.untyped)
end
module Gem::Specification::YamlBackfiller | true |
Other | Homebrew | brew | e21c926f9be7a770017b11f381280822b5e75fa8.json | Update Bundler to 2.3.26 | Library/Homebrew/Gemfile.lock | @@ -265,4 +265,4 @@ RUBY VERSION
ruby 2.6.8p205
BUNDLED WITH
- 2.3.24
+ 2.3.26 | true |
Other | Homebrew | brew | e21c926f9be7a770017b11f381280822b5e75fa8.json | Update Bundler to 2.3.26 | Library/Homebrew/rubyext/rubygems/defaults/operating_system.rb | @@ -1,32 +0,0 @@
-# typed: false
-# frozen_string_literal: true
-
-# Fixes universal-ruby getting confused whether to install arm64 or x86_64 macOS versions.
-# This can be removed when integrated into Bundler: https://github.com/rubygems/rubygems/pull/5978
-module Gem
- # @private
- class Specification
- if /^universal\.(?<arch>.*?)-/ =~ (CROSS_COMPILING || RUBY_PLATFORM)
- local_platform = Platform.local
- if local_platform.cpu == "universal"
- ORIGINAL_LOCAL_PLATFORM = local_platform.to_s.freeze
-
- local_platform.cpu = if arch == "arm64e" # arm64e is only permitted for Apple system binaries
- "arm64"
- else
- arch
- end
-
- def extensions_dir
- Gem.default_ext_dir_for(base_dir) ||
- File.join(base_dir, "extensions", ORIGINAL_LOCAL_PLATFORM,
- Gem.extension_api_version)
- end
- end
- end
- end
-end
-
-# This doesn't currently exist in system Ruby but it's safer to check.
-orig_file = File.join(RbConfig::CONFIG["rubylibdir"], "rubygems", "defaults", "operating_system")
-require orig_file if File.exist?(orig_file) | true |
Other | Homebrew | brew | e21c926f9be7a770017b11f381280822b5e75fa8.json | Update Bundler to 2.3.26 | Library/Homebrew/shims/ruby/bundle | @@ -1,15 +0,0 @@
-#!/usr/bin/env ruby
-# frozen_string_literal: true
-
-# Insert our system Ruby patch script, if neeeded.
-# Fixes universal-ruby getting confused whether to install arm64 or x86_64 macOS versions.
-# https://github.com/rubygems/rubygems/issues/4234
-if RUBY_PLATFORM.match?(/universal\..*-darwin/)
- rubylib = File.expand_path("../../rubyext", File.dirname(__FILE__))
- ENV["RUBYLIB"] = rubylib
- $LOAD_PATH.unshift(rubylib) unless $LOAD_PATH.include?(rubylib)
- require "rubygems/defaults/operating_system" if defined?(Gem) # Reload if already loaded.
-end
-
-require "rubygems"
-load Gem.activate_bin_path("bundler", "bundle", ">= 0.a") | true |
Other | Homebrew | brew | e21c926f9be7a770017b11f381280822b5e75fa8.json | Update Bundler to 2.3.26 | Library/Homebrew/utils/gems.rb | @@ -10,7 +10,7 @@
module Homebrew
# Keep in sync with the `Gemfile.lock`'s BUNDLED WITH.
# After updating this, run `brew vendor-gems --update=--bundler`.
- HOMEBREW_BUNDLER_VERSION = "2.3.24"
+ HOMEBREW_BUNDLER_VERSION = "2.3.26"
module_function
@@ -64,7 +64,6 @@ def setup_gem_environment!(setup_path: true)
paths = ENV.fetch("PATH").split(":")
paths.unshift(ruby_bindir) unless paths.include?(ruby_bindir)
paths.unshift(Gem.bindir) unless paths.include?(Gem.bindir)
- paths.unshift(HOMEBREW_LIBRARY_PATH/"shims/ruby") unless paths.include?(HOMEBREW_LIBRARY_PATH/"shims/ruby")
ENV["PATH"] = paths.compact.join(":")
# Set envs so the above binaries can be invoked. | true |
Other | Homebrew | brew | 90f056218cf252f28b03b5c634615b00583e2943.json | Update RBI files for rubocop-performance.
Autogenerated by the [vendor-gems](https://github.com/Homebrew/brew/blob/HEAD/.github/workflows/vendor-gemss.yml) workflow. | Library/Homebrew/sorbet/rbi/gems/rubocop-performance@1.15.1.rbi | @@ -236,6 +236,11 @@ class RuboCop::Cop::Performance::Count < ::RuboCop::Cop::Base
def autocorrect(corrector, node, selector_node, selector); end
def eligible_node?(node); end
+ def negate_block_pass_as_inline_block(node); end
+ def negate_block_pass_reject(corrector, node); end
+ def negate_block_reject(corrector, node); end
+ def negate_expression(node); end
+ def negate_reject(corrector, node); end
def source_starting_at(node); end
end
@@ -411,6 +416,7 @@ class RuboCop::Cop::Performance::MapCompact < ::RuboCop::Cop::Base
def invoke_method_after_map_compact_on_same_line?(compact_node, chained_method); end
def map_method_and_compact_method_on_same_line?(map_node, compact_node); end
def remove_compact_method(corrector, map_node, compact_node, chained_method); end
+ def use_dot?(node); end
end
RuboCop::Cop::Performance::MapCompact::MSG = T.let(T.unsafe(nil), String) | false |
Other | Homebrew | brew | 034bf72235183c66c1a03850ad240c423d6b6a3f.json | Contributors docs: adjust line breaks | docs/Acceptable-Casks.md | @@ -1,8 +1,6 @@
# Acceptable Casks
-Some casks should not go in
-[homebrew/cask](https://github.com/Homebrew/homebrew-cask). But there are
-additional [Interesting Taps and Forks](Interesting-Taps-and-Forks.md) and anyone can [start their own](Taps.md)!
+Some casks should not go in [homebrew/cask](https://github.com/Homebrew/homebrew-cask). But there are additional [Interesting Taps and Forks](Interesting-Taps-and-Forks.md) and anyone can [start their own](How-to-Create-and-Maintain-a-Tap.md)!
## Finding a Home For Your Cask
@@ -57,13 +55,11 @@ We do not accept these casks since they offer a higher-than-normal security risk
### Fonts
-Font Casks live in the [Homebrew/homebrew-cask-fonts](https://github.com/Homebrew/homebrew-cask-fonts) repository. See the font repo [CONTRIBUTING.md](https://github.com/Homebrew/homebrew-cask-fonts/blob/HEAD/CONTRIBUTING.md)
-for details.
+Font casks live in the [Homebrew/homebrew-cask-fonts](https://github.com/Homebrew/homebrew-cask-fonts) repository. See the fonts repo [CONTRIBUTING.md](https://github.com/Homebrew/homebrew-cask-fonts/blob/HEAD/CONTRIBUTING.md) for details.
### Drivers
-Driver Casks live in the [Homebrew/homebrew-cask-drivers](https://github.com/Homebrew/homebrew-cask-drivers) repository. See the drivers repo [CONTRIBUTING.md](https://github.com/Homebrew/homebrew-cask-drivers/blob/master/CONTRIBUTING.md)
-for details.
+Driver casks live in the [Homebrew/homebrew-cask-drivers](https://github.com/Homebrew/homebrew-cask-drivers) repository. See the drivers repo [CONTRIBUTING.md](https://github.com/Homebrew/homebrew-cask-drivers/blob/master/CONTRIBUTING.md) for details.
## Apps that bundle malware
| true |
Other | Homebrew | brew | 034bf72235183c66c1a03850ad240c423d6b6a3f.json | Contributors docs: adjust line breaks | docs/Acceptable-Formulae.md | @@ -1,49 +1,43 @@
# Acceptable Formulae
-Some formulae should not go in
-[homebrew/core](https://github.com/Homebrew/homebrew-core). But there are
-additional [Interesting Taps and Forks](Interesting-Taps-and-Forks.md) and anyone can start their
-own!
+Some formulae should not go in [homebrew/core](https://github.com/Homebrew/homebrew-core). But there are additional [Interesting Taps and Forks](Interesting-Taps-and-Forks.md) and anyone can start their own!
### Supported platforms in `homebrew/core`
-The formula needs to build and pass tests on the latest 3 supported macOS versions ([x86_64 and Apple Silicon/ARM](Installation.md#macos-requirements)) and on x86_64 [Linux](Linux-CI.md).
-Please have a look at the continuous integration jobs on a pull request in `homebrew/core` to see the full list of OSs.
-If upstream does not support one of these platforms, an exception can be made and the formula can be disabled for that platform.
+The formula needs to build and pass tests on the latest 3 supported macOS versions ([x86_64 and Apple Silicon/ARM](Installation.md#macos-requirements)) and on x86_64 [Linux](Linux-CI.md). Please have a look at the continuous integration jobs on a pull request in `homebrew/core` to see the full list of OSs. If upstream does not support one of these platforms, an exception can be made and the formula can be disabled for that platform.
### Dupes in `homebrew/core`
+
We now accept stuff that comes with macOS as long as it uses `keg_only :provided_by_macos` to be keg-only by default.
### Versioned formulae in `homebrew/core`
+
We now accept versioned formulae as long as they [meet the requirements](Versions.md).
### We don’t like tools that upgrade themselves
-Software that can upgrade itself does not integrate well with Homebrew's own
-upgrade functionality. The self-update functionality should be disabled (while minimising complication to the formula).
+
+Software that can upgrade itself does not integrate well with Homebrew's own upgrade functionality. The self-update functionality should be disabled (while minimising complication to the formula).
### We don’t like install scripts that download unversioned things
+
We don't like install scripts that are pulling from the `master` branch of Git repositories or unversioned, unchecksummed tarballs. These should use `resource` blocks with specific revisions or checksummed tarballs instead. Note that we now allow tools like `cargo`, `gem` and `pip` to download specifically versioned libraries during installation.
### We don’t like binary formulae
-Our policy is that formulae in the core tap
-([homebrew/core](https://github.com/Homebrew/homebrew-core)) must be open-source
-with an [Debian Free Software Guidelines license](https://wiki.debian.org/DFSGLicenses) and either built
-from source or produce cross-platform binaries (e.g. Java, Mono). Binary-only
-formulae should go to [homebrew/cask](https://github.com/Homebrew/homebrew-cask).
+
+Our policy is that formulae in the core tap ([homebrew/core](https://github.com/Homebrew/homebrew-core)) must be open-source with an [Debian Free Software Guidelines license](https://wiki.debian.org/DFSGLicenses) and either built from source or produce cross-platform binaries (e.g. Java, Mono). Binary-only formulae should go to [homebrew/cask](https://github.com/Homebrew/homebrew-cask).
Additionally, [homebrew/core](https://github.com/Homebrew/homebrew-core) formulae must also not depend on casks or any other proprietary software.
This includes automatic installation of casks at runtime.
### Stable versions
-Formulae in the core repository must have a stable version tagged by
-the upstream project. Tarballs are preferred to Git checkouts, and
-tarballs should include the version in the filename whenever possible.
-We don’t accept software without a tagged version because they regularly break
-due to upstream changes and we can’t provide [bottles](Bottles.md) for them.
+Formulae in the core repository must have a stable version tagged by the upstream project. Tarballs are preferred to Git checkouts, and tarballs should include the version in the filename whenever possible.
+
+We don’t accept software without a tagged version because they regularly break due to upstream changes and we can’t provide [bottles](Bottles.md) for them.
### Niche (or self-submitted) stuff
+
The software in question must:
* be maintained (i.e. the last release wasn't ages ago, it works without patching on all Homebrew-supported OS versions and has no outstanding, unpatched security vulnerabilities)
@@ -52,40 +46,37 @@ The software in question must:
* be used
* have a homepage
-We will reject formulae that seem too obscure, partly because they won’t
-get maintained and partly because we have to draw the line somewhere.
+We will reject formulae that seem too obscure, partly because they won’t get maintained and partly because we have to draw the line somewhere.
We frown on authors submitting their own work unless it is very popular.
-Don’t forget Homebrew is all Git underneath!
-[Maintain your own tap](How-to-Create-and-Maintain-a-Tap.md) if you have to!
+Don’t forget Homebrew is all Git underneath! [Maintain your own tap](How-to-Create-and-Maintain-a-Tap.md) if you have to!
-There may be exceptions to these rules in the main repository; we may
-include things that don't meet these criteria or reject things that do.
-Please trust that we need to use our discretion based on our experience
-running a package manager.
+There may be exceptions to these rules in the main repository; we may include things that don't meet these criteria or reject things that do. Please trust that we need to use our discretion based on our experience running a package manager.
### Stuff that builds an `.app`
-Don’t make your formula build an `.app` (native macOS Application); we
-don’t want those things in Homebrew. Encourage upstream projects to build and support a `.app` that can be distributed by [homebrew/cask](https://github.com/Homebrew/homebrew-cask) (and used without it, too).
+
+Don’t make your formula build an `.app` (native macOS Application); we don’t want those things in Homebrew. Encourage upstream projects to build and support a `.app` that can be distributed by [homebrew/cask](https://github.com/Homebrew/homebrew-cask) (and used without it, too).
### Stuff that builds a GUI by default (but doesn't have to)
+
Make it build a command-line tool or a library by default and, if the GUI is useful and would be widely used, also build the GUI. Don’t build X11/XQuartz GUIs as they are a bad user experience on macOS.
### Stuff that doesn't build with the latest, stable Xcode Clang
+
Clang is the default C/C++ compiler on macOS (and has been for a long time). Software that doesn't build with it hasn't been adequately ported to macOS.
### Stuff that requires heavy manual pre/post-install intervention
+
We're a package manager so we want to do things like resolve dependencies and set up applications for our users. If things require too much manual intervention then they aren't useful in a package manager.
## Stuff that requires vendored versions of Homebrew formulae
+
Homebrew formulae should avoid having multiple, separate, upstream projects bundled together in a single package to avoid shipping outdated/insecure versions of software that is already a formula. Veracode's [State of Software Security report](https://www.veracode.com/blog/research/announcing-state-software-security-v11-open-source-edition) concludes
> In fact, 79% of the time, developers never update third-party libraries after including them in a codebase.
For more info see [Debian's](https://www.debian.org/doc/debian-policy/ch-source.html#s-embeddedfiles) and [Fedora's](https://docs.fedoraproject.org/en-US/packaging-guidelines/#bundling) stances on this.
### Sometimes there are exceptions
-Even if all criteria are met we may not accept the formula.
-Documentation tends to lag behind current decision-making. Although some
-rejections may seem arbitrary or strange they are based on years of
-experience making Homebrew work acceptably for our users.
+
+Even if all criteria are met we may not accept the formula. Documentation tends to lag behind current decision-making. Although some rejections may seem arbitrary or strange they are based on years of experience making Homebrew work acceptably for our users. | true |
Other | Homebrew | brew | 034bf72235183c66c1a03850ad240c423d6b6a3f.json | Contributors docs: adjust line breaks | docs/Brew-Test-Bot.md | @@ -5,21 +5,15 @@ image: https://brew.sh/assets/img/brewtestbot.png
# Brew Test Bot
-`brew test-bot` is the name for the automated review and testing system funded
-by [our Kickstarter in 2013](https://www.kickstarter.com/projects/homebrew/brew-test-bot).
+`brew test-bot` is the name for the automated review and testing system funded by [our Kickstarter in 2013](https://www.kickstarter.com/projects/homebrew/brew-test-bot).
-It comprises three Mac Pros hosting virtual machines that run the
-[`test-bot.rb`](https://github.com/Homebrew/homebrew-test-bot/) external
-command to perform automated testing of commits to the master branch, pull
-requests and custom builds requested by maintainers.
+It comprises three Mac Pros hosting virtual machines that run the [`test-bot.rb`](https://github.com/Homebrew/homebrew-test-bot/) external command to perform automated testing of commits to the master branch, pull requests and custom builds requested by maintainers.
## Pull Requests
-The bot automatically builds pull requests and updates their status depending
-on the result of the job.
+The bot automatically builds pull requests and updates their status depending on the result of the job.
-For example, a job which has been queued but not yet completed will have a
-section in the pull request that looks like this:
+For example, a job which has been queued but not yet completed will have a section in the pull request that looks like this:

@@ -37,6 +31,5 @@ A passed build looks like this:
---
-On failed or passed builds you can click the "Details" link to view the result
-in GitHub Actions.
+On failed or passed builds you can click the "Details" link to view the result in GitHub Actions.
| true |
Other | Homebrew | brew | 034bf72235183c66c1a03850ad240c423d6b6a3f.json | Contributors docs: adjust line breaks | docs/How-To-Open-a-Homebrew-Pull-Request.md | @@ -5,87 +5,111 @@ The following commands are used by Homebrew contributors to set up a fork of Hom
Depending on the change you want to make, you need to send the pull request to the appropriate one of Homebrew's main repositories. If you want to submit a change to Homebrew core code (the `brew` implementation), you should open the pull request on [Homebrew/brew](https://github.com/Homebrew/brew). If you want to submit a change for a formula, you should open the pull request on the [homebrew/core](https://github.com/Homebrew/homebrew-core) tap, for casks you should open the pull request on the [homebrew/cask](https://github.com/Homebrew/homebrew-cask) tap or another [official tap](https://github.com/Homebrew), based on the formula type.
## Submit a new version of an existing formula
+
1. Use `brew bump-formula-pr` to do everything (i.e. forking, committing, pushing) with a single command. Run `brew bump-formula-pr --help` to learn more.
## Submit a new version of an existing cask
+
1. Use `brew bump-cask-pr` to do everything (i.e. forking, committing, pushing) with a single command. Run `brew bump-cask-pr --help` to learn more.
## Set up your own fork of the Homebrew repository
### Core `brew` code related pull request
1. [Fork the Homebrew/brew repository on GitHub](https://github.com/Homebrew/brew/fork).
- * 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.
+ * 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)"
- ```
+
+ ```sh
+ cd "$(brew --repository)"
+ ```
+
3. Add your pushable forked repository as a new remote:
- ```sh
- git remote add <YOUR_USERNAME> https://github.com/<YOUR_USERNAME>/brew.git
- ```
- * `<YOUR_USERNAME>` is your GitHub username, not your local machine username.
+
+ ```sh
+ git remote add <YOUR_USERNAME> https://github.com/<YOUR_USERNAME>/brew.git
+ ```
+
+ * `<YOUR_USERNAME>` is your GitHub username, not your local machine username.
### Formulae related pull request
1. [Fork the Homebrew/homebrew-core repository on GitHub](https://github.com/Homebrew/homebrew-core/fork).
- * 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.
+ * 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)"
- ```
+
+ ```sh
+ cd "$(brew --repository homebrew/core)"
+ ```
+
3. Add your pushable forked repository as a new remote:
- ```sh
- git remote add <YOUR_USERNAME> https://github.com/<YOUR_USERNAME>/homebrew-core.git
- ```
- * `<YOUR_USERNAME>` is your GitHub username, not your local machine username.
+
+ ```sh
+ git remote add <YOUR_USERNAME> https://github.com/<YOUR_USERNAME>/homebrew-core.git
+ ```
+
+ * `<YOUR_USERNAME>` is your GitHub username, not your local machine username.
### Cask related pull request
1. [Fork the Homebrew/homebrew-cask repository on GitHub](https://github.com/Homebrew/homebrew-cask/fork).
- * 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.
+ * 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 casks:
- ```sh
- cd "$(brew --repository homebrew/cask)"
- ```
+
+ ```sh
+ cd "$(brew --repository homebrew/cask)"
+ ```
+
3. Add your pushable forked repository as a new remote:
- ```sh
- git remote add <YOUR_USERNAME> https://github.com/<YOUR_USERNAME>/homebrew-cask.git
- ```
- * `<YOUR_USERNAME>` is your GitHub username, not your local machine username.
+
+ ```sh
+ git remote add <YOUR_USERNAME> https://github.com/<YOUR_USERNAME>/homebrew-cask.git
+ ```
+
+ * `<YOUR_USERNAME>` is your GitHub username, not your local machine username.
## Create your pull request from a new branch
To make a new branch and submit it for review, create a GitHub pull request with the following steps:
1. Check out the `master` branch:
- ```sh
- git checkout master
- ```
+
+ ```sh
+ git checkout master
+ ```
+
2. Retrieve new changes to the `master` branch:
- ```sh
- brew update
- ```
+
+ ```sh
+ brew update
+ ```
+
3. Create a new branch from the latest `master` branch:
- ```sh
- git checkout -b <YOUR_BRANCH_NAME> origin/master
- ```
+
+ ```sh
+ git checkout -b <YOUR_BRANCH_NAME> origin/master
+ ```
+
4. Make your changes. For formulae or casks, use `brew edit` or your favourite text editor, following all the guidelines in the [Formula Cookbook](Formula-Cookbook.md) or [Cask Cookbook](Cask-Cookbook.md).
- * If there's a `bottle do` block in the formula, don't remove or change it; we'll update it when we pull your PR.
-5. Test your changes by running the following, and ensure they all pass without issue. For changed formulae and casks, make sure you do the `brew audit` step while your changed formula/cask is installed.
- ```sh
- brew tests
- brew install --build-from-source <CHANGED_FORMULA|CHANGED_CASK>
- brew test <CHANGED_FORMULA|CHANGED_CASK>
- brew audit --strict --online <CHANGED_FORMULA|CHANGED_CASK>
- ```
+ * If there's a `bottle do` block in the formula, don't remove or change it; we'll update it when we merge your PR.
+5. Test your changes by running the following, and ensure they all pass without issue. For changed formulae and casks, make sure you do the `brew audit` step after your changed formula/cask has been installed.
+
+ ```sh
+ brew tests
+ brew install --build-from-source <CHANGED_FORMULA|CHANGED_CASK>
+ brew test <CHANGED_FORMULA|CHANGED_CASK>
+ brew audit --strict --online <CHANGED_FORMULA|CHANGED_CASK>
+ ```
+
6. [Make a separate commit](Formula-Cookbook.md#commit) for each changed formula with `git add` and `git commit`.
- * Please note that our preferred commit message format for simple version updates is "`<FORMULA_NAME> <NEW_VERSION>`", e.g. "`source-highlight 3.1.8`".
+ * Please note that our preferred commit message format for simple version updates is "`<FORMULA_NAME> <NEW_VERSION>`", e.g. "`source-highlight 3.1.8`".
7. Upload your branch of new commits to your fork:
- ```sh
- git push --set-upstream <YOUR_USERNAME> <YOUR_BRANCH_NAME>
- ```
-8. Go to the relevant repository (e.g. <https://github.com/Homebrew/brew>, <https://github.com/Homebrew/homebrew-core>, etc.) and create a pull request to request review and merging of the commits in your pushed branch. Explain why the change is needed and, if fixing a bug, how to reproduce the bug. Make sure you have done each step in the checklist that appears in your new PR.
+
+ ```sh
+ git push --set-upstream <YOUR_USERNAME> <YOUR_BRANCH_NAME>
+ ```
+
+8. Go to the relevant repository (e.g. <https://github.com/Homebrew/brew>, <https://github.com/Homebrew/homebrew-core>, etc.) and create a pull request to request review and merging of the commits from your pushed branch. Explain why the change is needed and, if fixing a bug, how to reproduce the bug. Make sure you have done each step in the checklist that appears in your new PR.
9. Await feedback or a merge from Homebrew's maintainers. We typically respond to all PRs within a couple days, but it may take up to a week, depending on the maintainers' workload.
Thank you!
@@ -96,28 +120,33 @@ To respond well to feedback:
1. Ask for clarification of anything you don't understand and for help with anything you don't know how to do.
2. Post a comment on your pull request if you've provided all the requested changes/information and it hasn't been merged after a week. Post a comment on your pull request if you're stuck and need help.
- * A `needs response` label on a PR means that the Homebrew maintainers need you to respond to previous comments.
+ * A `needs response` label on a PR means that the Homebrew maintainers need you to respond to previous comments.
3. Keep discussion in the pull request unless requested otherwise (i.e. do not email maintainers privately).
4. Do not continue discussion in closed pull requests.
5. Do not argue with Homebrew maintainers. You may disagree but unless they change their mind, please implement what they request. Ultimately they control what is included in Homebrew, as they have to support any changes that are made.
To make changes based on feedback:
1. Check out your branch again:
- ```sh
- git checkout <YOUR_BRANCH_NAME>
- ```
+
+ ```sh
+ git checkout <YOUR_BRANCH_NAME>
+ ```
+
2. Make any requested changes and commit them with `git add` and `git commit`.
3. Squash new commits into one commit per formula:
- ```sh
- git rebase --interactive origin/master
- ```
- * If you are working on a PR for a single formula, `git commit --amend` is a convenient way of keeping your commits squashed as you go.
+
+ ```sh
+ git rebase --interactive origin/master
+ ```
+
+ * If you are working on a PR for a single formula, `git commit --amend` is a convenient way of keeping your commits squashed as you go.
4. Push to your remote fork's branch and the pull request:
- ```sh
- git push --force
- ```
-Once all feedback has been addressed and if it's a change we want to include (we include most changes), then we'll add your commit to Homebrew. Note that the PR status may show up as "Closed" instead of "Merged" because of the way we merge contributions. Don't worry: you will still get author credit in the actual merged commit.
+ ```sh
+ git push --force
+ ```
+
+Once all feedback has been addressed and if it's a change we want to include (we include most changes), then we'll add your changes to Homebrew. Note that the PR status may show up as "Closed" instead of "Merged" because of the way we merge contributions. Don't worry: you will still get author credit in the actual merged commit.
Well done, you are now a Homebrew contributor! | true |
Other | Homebrew | brew | 034bf72235183c66c1a03850ad240c423d6b6a3f.json | Contributors docs: adjust line breaks | docs/How-to-Create-and-Maintain-a-Tap.md | @@ -1,87 +1,52 @@
# How to Create and Maintain a Tap
-[Taps](Taps.md) are external sources of Homebrew formulae, casks and/or external commands. They
-can be created by anyone to provide their own formulae, casks and/or external commands
-to any Homebrew user.
+[Taps](Taps.md) are external sources of Homebrew formulae, casks and/or external commands. They can be created by anyone to provide their own formulae, casks and/or external commands to any Homebrew user.
## Creating a tap
-A tap is usually a Git repository available online, but you can use anything as
-long as it’s a protocol that Git understands, or even just a directory with
-files in it.
-If hosted on GitHub, we recommend that the repository’s name start with
-`homebrew-` so the short `brew tap` command can be used.
-See the [manpage](Manpage.md) for more information on repository naming.
+A tap is usually a Git repository available online, but you can use anything as long as it’s a protocol that Git understands, or even just a directory with files in it. If hosted on GitHub, we recommend that the repository’s name start with `homebrew-` so the short `brew tap` command can be used. See the [manpage](Manpage.md) for more information on repository naming.
-The `brew tap-new` command can be used to create a new tap along with some
-template files.
+The `brew tap-new` command can be used to create a new tap along with some template files.
-Tap formulae follow the same format as the core’s ones, and can be added under
-either the `Formula` subdirectory, the `HomebrewFormula` subdirectory or the
-repository’s root. The first available directory is used, other locations will
-be ignored. We recommend use of subdirectories because it makes the repository
-organisation easier to grasp, and top-level files are not mixed with formulae.
+Tap formulae follow the same format as the core’s ones, and can be added under either the `Formula` subdirectory, the `HomebrewFormula` subdirectory or the repository’s root. The first available directory is used, other locations will be ignored. We recommend use of subdirectories because it makes the repository organisation easier to grasp, and top-level files are not mixed with formulae.
-See [homebrew/core](https://github.com/Homebrew/homebrew-core) for an example of
-a tap with a `Formula` subdirectory.
+See [homebrew/core](https://github.com/Homebrew/homebrew-core) for an example of a tap with a `Formula` subdirectory.
## Naming your formulae to avoid clashes
If your formulae have the same name as Homebrew/homebrew-core formulae they cannot be installed side-by-side. If you wish to create a different version of a formula that's in Homebrew/homebrew-core (e.g. with `option`s) consider giving it a different name e.g. `nginx-full` for more fully-featured `nginx` formula. This will allow both `nginx` and `nginx-full` to be installed at the same time (assuming one is `keg_only` or the linked files do not clash).
### Installing
-If it’s on GitHub, users can install any of your formulae with
-`brew install user/repo/formula`. Homebrew will automatically add your
-`github.com/user/homebrew-repo` tap before installing the formula.
-`user/repo/formula` points to the `github.com/user/homebrew-repo/**/formula.rb`
-file here.
+If it’s on GitHub, users can install any of your formulae with `brew install user/repo/formula`. Homebrew will automatically add your `github.com/user/homebrew-repo` tap before installing the formula. `user/repo/formula` points to the `github.com/user/homebrew-repo/**/formula.rb` file here.
-If they want to get your tap without installing any formula at the same time,
-users can add it with the [`brew tap` command](Taps.md).
+To install your tap without installing any formula at the same time, users can add it with the [`brew tap` command](Taps.md). If it’s on GitHub, they can use `brew tap user/repo`, where `user` is your GitHub username and `homebrew-repo` is your repository. If it’s hosted outside of GitHub, they have to use `brew tap user/repo <URL>`, where `user` and `repo` will be used to refer to your tap and `<URL>` is your Git clone URL.
-If it’s on GitHub, they can use `brew tap user/repo`, where `user` is your
-GitHub username and `homebrew-repo` is your repository.
-
-If it’s hosted outside of GitHub, they have to use `brew tap user/repo <URL>`,
-where `user` and `repo` will be used to refer to your tap and `<URL>` is your
-Git clone URL.
-
-Users can then install your formulae either with `brew install foo` if there’s
-no core formula with the same name, or with `brew install user/repo/foo` to
-avoid conflicts.
+Users can then install your formulae either with `brew install foo` if there’s no core formula with the same name, or with `brew install user/repo/foo` to avoid conflicts.
## Maintaining a tap
-A tap is just a Git repository so you don’t have to do anything specific when
-making modifications, apart from committing and pushing your changes.
+A tap is just a Git repository so you don’t have to do anything specific when making modifications, apart from committing and pushing your changes.
### Updating
-Once your tap is installed, Homebrew will update it each time a user runs
-`brew update`. Outdated formulae will be upgraded when a user runs
-`brew upgrade`, like core formulae.
+Once your tap is installed, Homebrew will update it each time a user runs `brew update`. Outdated formulae will be upgraded when a user runs `brew upgrade`, like core formulae.
## Casks
-Casks can also be installed from a tap.
-Casks can be included in taps with formulae, or in a tap with just casks.
-Place any cask files you wish to make available in a `Casks` directory at the top level of your tap.
+Casks can also be installed from a tap. Casks can be included in taps with formulae, or in a tap with just casks. Place any cask files you wish to make available in a `Casks` directory at the top level of your tap.
See [homebrew/cask](https://github.com/Homebrew/homebrew-cask) for an example of a tap with a `Casks` subdirectory.
### Naming
-Unlike formulae, casks must have globally unique names to avoid clashes.
-This can be achieved by e.g. prepending the cask name with your github username: `username-formula-name`.
+Unlike formulae, casks must have globally unique names to avoid clashes. This can be achieved by e.g. prepending the cask name with your github username: `username-formula-name`.
## External commands
-You can provide your tap users with custom `brew` commands by adding them in a
-`cmd` subdirectory. [Read more on external commands](External-Commands.md).
+You can provide your tap users with custom `brew` commands by adding them in a `cmd` subdirectory. [Read more on external commands](External-Commands.md).
-See [homebrew/aliases](https://github.com/Homebrew/homebrew-aliases) for an
-example of a tap with external commands.
+See [homebrew/aliases](https://github.com/Homebrew/homebrew-aliases) for an example of a tap with external commands.
## Official Vendor Taps
| true |
Other | Homebrew | brew | 034bf72235183c66c1a03850ad240c423d6b6a3f.json | Contributors docs: adjust line breaks | docs/Prose-Style-Guidelines.md | @@ -1,6 +1,7 @@
+# Prose Style Guidelines
+
<!-- vale off -->
<!-- Disable vale linting for the whole of the style guide, because it contains deliberately bad examples. -->
-# Prose Style Guidelines
This is a set of style and usage guidelines for Homebrew's prose documentation aimed at users, contributors, and maintainers (as opposed to executable computer code). It applies to documents like those in `docs` in the `Homebrew/brew` repository, announcement emails, and other communications with the Homebrew community.
| true |
Other | Homebrew | brew | 034bf72235183c66c1a03850ad240c423d6b6a3f.json | Contributors docs: adjust line breaks | docs/Rename-A-Formula.md | @@ -1,7 +1,6 @@
# Renaming a Formula
-Sometimes software and formulae need to be renamed. To rename a formula
-you need to:
+Sometimes software and formulae need to be renamed. To rename a formula you need to:
1. Rename the formula file and its class to a new formula. The new name must meet all the usual rules of formula naming. Fix any test failures that may occur due to the stricter requirements for new formulae than existing formulae (i.e. `brew audit --online --new-formula` must pass for that formula).
| true |
Other | Homebrew | brew | 034bf72235183c66c1a03850ad240c423d6b6a3f.json | Contributors docs: adjust line breaks | docs/Typechecking.md | @@ -1,20 +1,14 @@
# Type Checking With Sorbet
-The majority of the code in Homebrew is written in Ruby which is a dynamic
-language. To avail the benefits of static type checking, we have set up
-Sorbet in our codebase which provides the benefits of static type checking
-to dynamic languages like Ruby.
+The majority of the code in Homebrew is written in Ruby which is a dynamic language. To avail the benefits of static type checking, we have set up Sorbet in our codebase which provides the benefits of static type checking to dynamic languages like Ruby.
-The [Sorbet Documentation] is a good place
-to get started if you want to dive deeper into Sorbet and it's abilities.
+The [Sorbet Documentation] is a good place to get started if you want to dive deeper into Sorbet and it's abilities.
## Sorbet in the Homebrew Codebase
### Inline Type Annotations
-To add type annotations to a class or module, we need to first extend it with
-the `T::Sig` module (read this as `Type::Signature`). This adds the `sig`
-method which is used to annotate method signatures. Here's a simple example:
+To add type annotations to a class or module, we need to first extend it with the `T::Sig` module (read this as `Type::Signature`). This adds the `sig` method which is used to annotate method signatures. Here's a simple example:
```ruby
class MyClass
@@ -27,31 +21,20 @@ class MyClass
end
```
-With `params`, we specify that we have a parameter `name` which must be a
-`String` and with `returns`, we specify that this method always returns
-a `String`.
+With `params`, we specify that we have a parameter `name` which must be a `String` and with `returns`, we specify that this method always returns a `String`.
-For more information on how to express more complex types, refer to the
-official documentation:
+For more information on how to express more complex types, refer to the official documentation:
- - [Method Signatures](https://sorbet.org/docs/sigs)
- - [Class Types](https://sorbet.org/docs/class-types)
- - [Nilable Types](https://sorbet.org/docs/nilable-types)
- - [Union Types](https://sorbet.org/docs/union-types)
+- [Method Signatures](https://sorbet.org/docs/sigs)
+- [Class Types](https://sorbet.org/docs/class-types)
+- [Nilable Types](https://sorbet.org/docs/nilable-types)
+- [Union Types](https://sorbet.org/docs/union-types)
### Ruby Interface Files (`.rbi`)
-RBI files help Sorbet learn about constants, ancestors and methods
-defined in ways it doesn’t understand natively. We can also create a
-RBI file to help Sorbet understand dynamic definitions.
+RBI files help Sorbet learn about constants, ancestors and methods defined in ways it doesn’t understand natively. We can also create a RBI file to help Sorbet understand dynamic definitions.
-Sometimes it is necessary to explicitly include the `Kernel` module in
-order for Sorbet to know that methods such as `puts` are available in
-a given context. This is mostly necessary for modules since they can
-be used in both `BasicObject`s (which don't include `Kernel`) and
-`Object`s (which include `Kernel` by default). In this case, it is
-necessary to create an `.rbi` file ([example]) since re-including the
-`Kernel` module in actual code can break things.
+Sometimes it is necessary to explicitly include the `Kernel` module in order for Sorbet to know that methods such as `puts` are available in a given context. This is mostly necessary for modules since they can be used in both `BasicObject`s (which don't include `Kernel`) and `Object`s (which include `Kernel` by default). In this case, it is necessary to create an `.rbi` file ([example]) since re-including the `Kernel` module in actual code can break things.
Read more about RBI files [here](https://sorbet.org/docs/rbi).
@@ -61,69 +44,32 @@ Read more about RBI files [here](https://sorbet.org/docs/rbi).
[`Library/Homebrew/sorbet`]: https://github.com/Homebrew/brew/tree/master/Library/Homebrew/sorbet
-- The `rbi` directory contains all Ruby Interface (`.rbi`) files
- auto-generated by running `brew typecheck --update`:
+- The `rbi` directory contains all Ruby Interface (`.rbi`) files auto-generated by running `brew typecheck --update`:
- - RBI files for all gems are generated using
- [Tapioca](https://github.com/Shopify/tapioca#tapioca).
- - Definitions for dynamic code (i.e. meta-programming) are generated using
- `srb rbi hidden-definitions`.
+ - RBI files for all gems are generated using [Tapioca](https://github.com/Shopify/tapioca#tapioca).
+ - Definitions for dynamic code (i.e. meta-programming) are generated using `srb rbi hidden-definitions`.
- Definitions for missing constants are generated using `srb rbi todo`.
-- The `config` file is a newline-separated list of arguments to pass to
- `srb tc`, the same as if they’d been passed at the command-line. Arguments
- in the config file are always passed first, followed by arguments provided
- on the command-line. We use it to ignore Gem directories which we do not
- wish to type check.
+- The `config` file is a newline-separated list of arguments to pass to `srb tc`, the same as if they’d been passed at the command-line. Arguments in the config file are always passed first, followed by arguments provided on the command-line. We use it to ignore Gem directories which we do not wish to type check.
-- Every Ruby file in the codebase has a magic `# typed: <level>` comment at the
- top, where `<level>` is one of [Sorbet's strictness levels], usually `false`,
- `true` or `strict`. The `false` files only report errors related to the
- syntax, constant resolution and correctness of the method signatures, but no
- type errors. Our long-term goal is to move all `false` files to `true` and
- start reporting type errors on those files as well. Therefore, when adding
- new files, you should ideally mark it with `# typed: true` and work out any
- resulting type errors.
+- Every Ruby file in the codebase has a magic `# typed: <level>` comment at the top, where `<level>` is one of [Sorbet's strictness levels], usually `false`, `true` or `strict`. The `false` files only report errors related to the syntax, constant resolution and correctness of the method signatures, but no type errors. Our long-term goal is to move all `false` files to `true` and start reporting type errors on those files as well. Therefore, when adding new files, you should ideally mark it with `# typed: true` and work out any resulting type errors.
- [Sorbet's strictness levels]: https://sorbet.org/docs/static#file-level-granularity-strictness-levels
+[Sorbet's strictness levels]: https://sorbet.org/docs/static#file-level-granularity-strictness-levels
## Using `brew typecheck`
-When run without any arguments, `brew typecheck`, will run considering the strictness levels
-set in each of the individual Ruby files in the core Homebrew codebase. However, when
-it is run on a specific file or directory, more errors may show up since Sorbet
-cannot resolve constants defined outside the scope of the specified file. These
-problems can be solved with RBI files. Currently `brew typecheck` provides `--quiet`, `--file`,
-`--dir` and `--ignore` options but you can explore more options with `srb tc --help` and
-passing them with `srb tc`.
+When run without any arguments, `brew typecheck`, will run considering the strictness levels set in each of the individual Ruby files in the core Homebrew codebase. However, when it is run on a specific file or directory, more errors may show up since Sorbet cannot resolve constants defined outside the scope of the specified file. These problems can be solved with RBI files. Currently `brew typecheck` provides `--quiet`, `--file`, `--dir` and `--ignore` options but you can explore more options with `srb tc --help` and passing them with `srb tc`.
## Resolving Type Errors
-Sorbet reports type errors along with an error reference code, which can be used
-to look up more information on how to debug the error, or what causes the error in
-the [Sorbet Documentation]. Here is how to debug some common type errors:
-
-- Using `T.reveal_type`. In files which are `true` or higher, if we wrap a variable
- or method call in `T.reveal_type`, Sorbet will show us what type it thinks that
- variable has in the output of `srb tc`. This is particularly useful when writing
- [method signatures](https://sorbet.org/docs/sigs) and debugging. Make sure to
- remove this line from your code before committing your changes, since this is
- just a debugging tool.
-
-- One of the most frequent errors that we've encountered is: `7003: Method does not exist.`
- Since Ruby is a very dynamic language, methods can be defined in ways Sorbet cannot
- see statically. In such cases, check if the method exists at runtime, if not, then
- Sorbet has caught a future bug! But, it is also possible that even though a method
- exists at runtime, Sorbet cannot see it. In such cases, we use
- [`.rbi` files](#ruby-interface-files-rbi).
-
-- Since Sorbet does not automatically assume that Kernel is to be included in Modules,
- we may encounter many errors while trying to use methods like `puts`, `ohai`, `odebug` et cetera.
- A simple workaround for this would be to add an extra `include Kernel` line in the
- respective RBI file.
-
-- The tips above are very generic and apply to lots of cases. For some common gotchas
- when using Sorbet, refer to the [Sorbet Error Reference](https://sorbet.org/docs/error-reference)
- and [FAQ](https://sorbet.org/docs/faq).
+Sorbet reports type errors along with an error reference code, which can be used to look up more information on how to debug the error, or what causes the error in the [Sorbet Documentation]. Here is how to debug some common type errors:
+
+- Using `T.reveal_type`. In files which are `true` or higher, if we wrap a variable or method call in `T.reveal_type`, Sorbet will show us what type it thinks that variable has in the output of `srb tc`. This is particularly useful when writing [method signatures](https://sorbet.org/docs/sigs) and debugging. Make sure to remove this line from your code before committing your changes, since this is just a debugging tool.
+
+- One of the most frequent errors that we've encountered is: `7003: Method does not exist.` Since Ruby is a very dynamic language, methods can be defined in ways Sorbet cannot see statically. In such cases, check if the method exists at runtime, if not, then Sorbet has caught a future bug! But, it is also possible that even though a method exists at runtime, Sorbet cannot see it. In such cases, we use [`.rbi` files](#ruby-interface-files-rbi).
+
+- Since Sorbet does not automatically assume that Kernel is to be included in Modules, we may encounter many errors while trying to use methods like `puts`, `ohai`, `odebug` et cetera. A simple workaround for this would be to add an extra `include Kernel` line in the respective RBI file.
+
+- The tips above are very generic and apply to lots of cases. For some common gotchas when using Sorbet, refer to the [Sorbet Error Reference](https://sorbet.org/docs/error-reference) and [FAQ](https://sorbet.org/docs/faq).
[Sorbet Documentation]: https://sorbet.org/docs/overview | true |
Other | Homebrew | brew | 034bf72235183c66c1a03850ad240c423d6b6a3f.json | Contributors docs: adjust line breaks | docs/Versions.md | @@ -3,6 +3,7 @@
[homebrew/core](https://github.com/homebrew/homebrew-core) supports multiple versions of formulae with a special naming format. For example, the formula for GCC 6 is named `gcc@6.rb` and begins with `class GccAT6 < Formula`.
## Acceptable versioned formulae
+
Versioned formulae we include in [homebrew/core](https://github.com/homebrew/homebrew-core) must meet the following standards:
* Versioned software should build on all Homebrew's supported versions of macOS. | true |
Other | Homebrew | brew | bca9eb05d1c0b55176cc3659cadfe894467352fa.json | dev-cmd/unbottled: simulate target tag | Library/Homebrew/dev-cmd/unbottled.rb | @@ -44,6 +44,15 @@ def unbottled
Utils::Bottles.tag
end
+ Homebrew::SimulateSystem.os = @bottle_tag.system
+ Homebrew::SimulateSystem.arch = if Hardware::CPU::INTEL_ARCHS.include?(@bottle_tag.arch)
+ :intel
+ elsif Hardware::CPU::ARM_ARCHS.include?(@bottle_tag.arch)
+ :arm
+ else
+ raise "Unknown arch #{@bottle_tag.arch}."
+ end
+
all = args.eval_all?
if args.total?
if !all && !Homebrew::EnvConfig.eval_all?
@@ -82,6 +91,8 @@ def unbottled
end
output_unbottled(formulae, deps_hash, noun, hash, args.named.present?)
+ ensure
+ Homebrew::SimulateSystem.clear
end
def formulae_all_installs_from_args(args, all) | true |
Other | Homebrew | brew | bca9eb05d1c0b55176cc3659cadfe894467352fa.json | dev-cmd/unbottled: simulate target tag | Library/Homebrew/hardware.rb | @@ -9,15 +9,16 @@ module Hardware
class CPU
INTEL_32BIT_ARCHS = [:i386].freeze
INTEL_64BIT_ARCHS = [:x86_64].freeze
+ INTEL_ARCHS = (INTEL_32BIT_ARCHS + INTEL_64BIT_ARCHS).freeze
PPC_32BIT_ARCHS = [:ppc, :ppc32, :ppc7400, :ppc7450, :ppc970].freeze
PPC_64BIT_ARCHS = [:ppc64, :ppc64le, :ppc970].freeze
+ PPC_ARCHS = (PPC_32BIT_ARCHS + PPC_64BIT_ARCHS).freeze
ARM_64BIT_ARCHS = [:arm64, :aarch64].freeze
+ ARM_ARCHS = ARM_64BIT_ARCHS
ALL_ARCHS = [
- *INTEL_32BIT_ARCHS,
- *INTEL_64BIT_ARCHS,
- *PPC_32BIT_ARCHS,
- *PPC_64BIT_ARCHS,
- *ARM_64BIT_ARCHS,
+ *INTEL_ARCHS,
+ *PPC_ARCHS,
+ *ARM_ARCHS,
].freeze
INTEL_64BIT_OLDEST_CPU = :core2 | true |
Other | Homebrew | brew | 449b872916c29a7b9d4155b176f7aca85b8c2c84.json | CPU: fix M2 detection | Library/Homebrew/extend/os/mac/hardware/cpu.rb | @@ -152,7 +152,11 @@ def sysctl_bool(key)
end
def sysctl_int(key)
- sysctl_n(key).to_i
+ if (x = sysctl_n(key).to_i) >= 0
+ x
+ else
+ x & 0xffffffff
+ end
end
def sysctl_n(*keys) | false |
Other | Homebrew | brew | 2bc54e56e4ab6d3af50fa6ed52c57c99e1a4aab7.json | Optimize CoreTap in `.deleted_reason`
This limits the previous change to only the
core tap in `MissingFormula.deleted_reason`.
The reason for this is that the `git log` command
only becomes a performance issue when the number
of monthly commits is high which really only happens
with the core tap. | Library/Homebrew/missing_formula.rb | @@ -154,25 +154,36 @@ def deleted_reason(name, silent: false)
end
end
- commit_command = "git log --before='1 month ago' --max-count=1 --format=%H"
- month_old_commit = Utils.popen_read(commit_command).chomp
-
- # Check if the formula has been deleted in the last month
- # by comparing the diff between now and a month ago.
- diff_command = "git diff --diff-filter=D --name-only " \
- "#{month_old_commit} HEAD -- #{relative_path}"
-
- if Utils.popen_read(diff_command).blank?
- ofail "No previously deleted formula found." unless silent
- return
+ # The core tap has thousands of monthly commits making the `git log`
+ # command below a performance issue when using `brew search` or
+ # `brew info` to look for a formula that doesn't exist. This first
+ # checks if the formula existed a month ago before continuing.
+ if tap.is_a? CoreTap
+ commit_command = "git log --before='1 month ago' --max-count=1 --format=%H"
+ month_old_commit_hash = Utils.popen_read(commit_command).chomp
+
+ # Check if the formula has been deleted in the last month
+ # by comparing the diff between now and a month ago.
+ diff_command = "git diff --diff-filter=D --name-only " \
+ "#{month_old_commit_hash} HEAD -- #{relative_path}"
+
+ if Utils.popen_read(diff_command).blank?
+ ofail "No previously deleted formula found." unless silent
+ return
+ end
end
log_command = "git log --since='1 month ago' --diff-filter=D " \
"--name-only --max-count=1 " \
- "--format=%h\\\\n%B -- #{relative_path}"
- short_hash, *commit_message, relative_path =
+ "--format=%H\\\\n%h\\\\n%B -- #{relative_path}"
+ hash, short_hash, *commit_message, relative_path =
Utils.popen_read(log_command).gsub("\\n", "\n").lines.map(&:chomp)
+ if hash.blank? || short_hash.blank? || relative_path.blank?
+ ofail "No previously deleted formula found." unless silent
+ return
+ end
+
commit_message = commit_message.reject(&:empty?).join("\n ")
commit_message.sub!(/ \(#(\d+)\)$/, " (#{tap.issues_url}/\\1)") | false |
Other | Homebrew | brew | 9c22c47e4f411a0e5fbcca0462f2912efea707de.json | Cookbooks: adjust line breaks | docs/Cask-Cookbook.md | @@ -29,17 +29,15 @@ Exception: `do` blocks such as `postflight` may enclose a block of pure Ruby cod
### Efficiency
-Conditional statements are permitted, but only if they are very efficient.
-Tests on the following values are known to be acceptable:
+Conditional statements are permitted, but only if they are very efficient. Tests on the following values are known to be acceptable:
| value | examples
| ----------------------------|--------------------------------------
| `MacOS.version` | [coconutbattery.rb](https://github.com/Homebrew/homebrew-cask/blob/a11ee55e8ed8255f7dab77120dfb1fb955789559/Casks/coconutbattery.rb#L2-L16), [yasu.rb](https://github.com/Homebrew/homebrew-cask/blob/21d3f7ac8a4adac0fe474b3d4b020d284eeef88d/Casks/yasu.rb#L2-L23)
### Version Comparisons
-Tests against `MacOS.version` may use either symbolic names or version
-strings with numeric comparison operators:
+Tests against `MacOS.version` may use either symbolic names or version strings with numeric comparison operators:
```ruby
if MacOS.version <= :mojave # symbolic name
@@ -105,70 +103,67 @@ The first non-comment line in a Cask follows the form:
cask "<cask-token>" do
```
-[`<cask-token>`](#token-reference) should match the Cask filename, without the `.rb` extension,
-enclosed in single quotes.
+[`<cask-token>`](#token-reference) should match the Cask filename, without the `.rb` extension, enclosed in single quotes.
There are currently some arbitrary limitations on Cask tokens which are in the process of being removed. GitHub Actions will catch any errors during the transition.
## Stanza order
Having a common order for stanzas makes Casks easier to update and parse. Below is the complete stanza sequence (no Cask will have all stanzas). The empty lines shown here are also important, as they help to visually delineate information.
-```
-version
-sha256
+ version
+ sha256
-language
+ language
-url
-appcast
-name
-desc
-homepage
+ url
+ appcast
+ name
+ desc
+ homepage
-livecheck
+ livecheck
-auto_updates
-conflicts_with
-depends_on
-container
+ auto_updates
+ conflicts_with
+ depends_on
+ container
-suite
-app
-pkg
-installer
-binary
-manpage
-colorpicker
-dictionary
-font
-input_method
-internet_plugin
-prefpane
-qlplugin
-mdimporter
-screen_saver
-service
-audio_unit_plugin
-vst_plugin
-vst3_plugin
-artifact, target: # target: shown here as is required with `artifact`
-stage_only
+ suite
+ app
+ pkg
+ installer
+ binary
+ manpage
+ colorpicker
+ dictionary
+ font
+ input_method
+ internet_plugin
+ prefpane
+ qlplugin
+ mdimporter
+ screen_saver
+ service
+ audio_unit_plugin
+ vst_plugin
+ vst3_plugin
+ artifact, target: # target: shown here as is required with `artifact`
+ stage_only
-preflight
+ preflight
-postflight
+ postflight
-uninstall_preflight
+ uninstall_preflight
-uninstall_postflight
+ uninstall_postflight
-uninstall
+ uninstall
-zap
+ zap
-caveats
-```
+ caveats
Note that every stanza that has additional parameters (`:symbols` after a `,`) shall have them on separate lines, one per line, in alphabetical order. An exception is `target:` which typically consists of short lines.
@@ -430,8 +425,7 @@ conflicts_with formula: "macvim"
### Stanza: `depends_on`
-`depends_on` is used to declare dependencies and requirements for a Cask.
-`depends_on` is not consulted until `install` is attempted.
+`depends_on` is used to declare dependencies and requirements for a Cask. `depends_on` is not consulted until `install` is attempted.
#### depends_on cask
@@ -635,10 +629,10 @@ installer manual: "Nutstore Installer.app"
The path may be absolute, or relative to the Cask. Example (from [miniforge.rb](https://github.com/Homebrew/homebrew-cask/blob/ed2033fb3578376c3ee58a2cb459ef96fa6eb37d/Casks/miniforge.rb#L15L18)):
```ruby
- installer script: {
- executable: "Miniforge3-#{version}-MacOSX-x86_64.sh",
- args: ["-b", "-p", "#{caskroom_path}/base"],
- }
+installer script: {
+ executable: "Miniforge3-#{version}-MacOSX-x86_64.sh",
+ args: ["-b", "-p", "#{caskroom_path}/base"],
+}
```
If the `installer script:` does not require any of the key-values it can point directly to the path of the install script:
@@ -991,13 +985,13 @@ It is better to use the least-severe signals which are sufficient to stop a proc
An example, with commonly-used signals in ascending order of severity:
```ruby
- uninstall signal: [
- ["TERM", "fr.madrau.switchresx.daemon"],
- ["QUIT", "fr.madrau.switchresx.daemon"],
- ["INT", "fr.madrau.switchresx.daemon"],
- ["HUP", "fr.madrau.switchresx.daemon"],
- ["KILL", "fr.madrau.switchresx.daemon"],
- ]
+uninstall signal: [
+ ["TERM", "fr.madrau.switchresx.daemon"],
+ ["QUIT", "fr.madrau.switchresx.daemon"],
+ ["INT", "fr.madrau.switchresx.daemon"],
+ ["HUP", "fr.madrau.switchresx.daemon"],
+ ["KILL", "fr.madrau.switchresx.daemon"],
+ ]
```
Note that when multiple running processes match the given Bundle ID, all matching processes will be signaled.
@@ -1033,10 +1027,10 @@ IDs inside a kext bundle you have located on disk can be listed using the comman
`uninstall script:` introduces a series of key-value pairs describing a command which will automate completion of the uninstall. Example (from [gpgtools.rb](https://github.com/Homebrew/homebrew-cask/blob/4a0a49d1210a8202cbdd54bce2986f15049b8b61/Casks/gpgtools.rb#L33-#L37)):
```ruby
- uninstall script: {
- executable: "#{staged_path}/Uninstall.app/Contents/Resources/GPG Suite Uninstaller.app/Contents/Resources/uninstall.sh",
- sudo: true,
- }
+uninstall script: {
+ executable: "#{staged_path}/Uninstall.app/Contents/Resources/GPG Suite Uninstaller.app/Contents/Resources/uninstall.sh",
+ sudo: true,
+ }
```
It is important to note that, although `script:` in the above example does attempt to completely uninstall the `pkg`, it should not be used in detriment of [`pkgutil:`](#uninstall-key-pkgutil), but as a complement when possible.
@@ -1157,23 +1151,17 @@ SourceForge and OSDN (formerly `SourceForge.JP`) projects are common ways to dis
We prefer URLs of this format:
-```
-https://downloads.sourceforge.net/<project_name>/<filename>.<ext>
-```
+ https://downloads.sourceforge.net/<project_name>/<filename>.<ext>
Or, if it’s from [OSDN](https://osdn.jp/):
-```
-http://<subdomain>.osdn.jp/<project_name>/<release_id>/<filename>.<ext>
-```
+ http://<subdomain>.osdn.jp/<project_name>/<release_id>/<filename>.<ext>
`<subdomain>` is typically of the form `dl` or `<user>.dl`.
If these formats are not available, and the application is macOS-exclusive (otherwise a command-line download defaults to the Windows version) we prefer the use of this format:
-```
-https://sourceforge.net/projects/<project_name>/files/latest/download
-```
+ https://sourceforge.net/projects/<project_name>/files/latest/download
#### Some Providers Block Command-line Downloads
@@ -1450,11 +1438,9 @@ App Name on Disk | Simplified App Name | Cask Token | Filename
Cask taps have naming conventions specific to each tap.
-[Homebrew/cask-versions](https://github.com/Homebrew/homebrew-cask-versions/blob/HEAD/CONTRIBUTING.md#naming-versions-casks)
-
-[Homebrew/cask-fonts](https://github.com/Homebrew/homebrew-cask-fonts/blob/HEAD/CONTRIBUTING.md#naming-font-casks)
-
-[Homebrew/cask-drivers](https://github.com/Homebrew/homebrew-cask-drivers/blob/HEAD/CONTRIBUTING.md#naming-driver-casks)
+* [Homebrew/cask-versions](https://github.com/Homebrew/homebrew-cask-versions/blob/HEAD/CONTRIBUTING.md#naming-versions-casks)
+* [Homebrew/cask-fonts](https://github.com/Homebrew/homebrew-cask-fonts/blob/HEAD/CONTRIBUTING.md#naming-font-casks)
+* [Homebrew/cask-drivers](https://github.com/Homebrew/homebrew-cask-drivers/blob/HEAD/CONTRIBUTING.md#naming-driver-casks)
# Special Affixes
| true |
Other | Homebrew | brew | 9c22c47e4f411a0e5fbcca0462f2912efea707de.json | Cookbooks: adjust line breaks | docs/Formula-Cookbook.md | @@ -77,8 +77,7 @@ end
If `brew` said `Warning: Version cannot be determined from URL` when doing the `create` step, you’ll need to explicitly add the correct [`version`](https://rubydoc.brew.sh/Formula#version-class_method) to the formula and then save the formula.
-Homebrew will try to guess the formula’s name from its URL. If it fails to do
-so you can override this with `brew create <URL> --set-name <name>`.
+Homebrew will try to guess the formula’s name from its URL. If it fails to do so you can override this with `brew create <URL> --set-name <name>`.
### Fill in the `homepage`
@@ -128,13 +127,7 @@ We generally try not to duplicate system libraries and complicated tools in core
Special exceptions are OpenSSL and LibreSSL. Things that use either *should* be built using Homebrew’s shipped equivalent and our Brew Test Bot's post-install `audit` will warn if it detects you haven't done this.
-Homebrew’s OpenSSL is [`keg_only`](https://rubydoc.brew.sh/Formula#keg_only-class_method)
-to avoid conflicting with the system so sometimes formulae need to
-have environment variables set or special configuration flags passed
-to locate our OpenSSL. You can see this mechanism in the
-[`clamav`](https://github.com/Homebrew/homebrew-core/blob/89c4574ef1a6d15e92196637ff315a0a4bb3e289/Formula/clamav.rb#L37)
-formula. Usually this is unnecessary because Homebrew sets up our [build environment](https://github.com/Homebrew/brew/blob/HEAD/Library/Homebrew/extend/ENV/super.rb)
-to favour finding [`keg_only`](https://rubydoc.brew.sh/Formula#keg_only-class_method) formulae first.
+Homebrew’s OpenSSL is [`keg_only`](https://rubydoc.brew.sh/Formula#keg_only-class_method) to avoid conflicting with the system so sometimes formulae need to have environment variables set or special configuration flags passed to locate our OpenSSL. You can see this mechanism in the [`clamav`](https://github.com/Homebrew/homebrew-core/blob/89c4574ef1a6d15e92196637ff315a0a4bb3e289/Formula/clamav.rb#L37) formula. Usually this is unnecessary because Homebrew sets up our [build environment](https://github.com/Homebrew/brew/blob/HEAD/Library/Homebrew/extend/ENV/super.rb) to favour finding [`keg_only`](https://rubydoc.brew.sh/Formula#keg_only-class_method) formulae first.
**Important:** `$(brew --prefix)/bin` is NOT on the `PATH` during formula installation. If you have dependencies at build time, you must specify them and `brew` will add them to the `PATH` or create a [`Requirement`](https://rubydoc.brew.sh/Requirement).
@@ -157,20 +150,15 @@ A Symbol (e.g. `:xcode`) specifies a [`Requirement`](https://rubydoc.brew.sh/Req
A Hash (e.g. `=>`) adds information to a dependency. Given a String or Symbol, the value can be one or more of the following values:
-* `:build` means that dependency is a build-time only dependency so it can
-be skipped when installing from a bottle or when listing missing
-dependencies using `brew missing`.
-* `:test` means that dependency is only required when running `brew test`.
-* `:optional` generates an implicit `with-foo` option for the formula.
-This means that, given `depends_on "foo" => :optional`, the user must pass `--with-foo` in order to use the dependency.
-* `:recommended` generates an implicit `without-foo` option, meaning that
-the dependency is enabled by default and the user must pass
-`--without-foo` to disable this dependency. The default
-description can be overridden using the normal option syntax (in this case, the option declaration must precede the dependency):
- ```ruby
- option "with-foo", "Compile with foo bindings" # This overrides the generated description if you want to
- depends_on "foo" => :optional # Generated description would otherwise be "Build with foo support"
- ```
+* `:build` means this is a build-time only dependency so it can be skipped when installing from a bottle or when listing missing dependencies using `brew missing`.
+* `:test` means this is only required when running `brew test`.
+* `:optional` generates an implicit `with-foo` option for the formula. This means that, given `depends_on "foo" => :optional`, the user must pass `--with-foo` in order to use the dependency.
+* `:recommended` generates an implicit `without-foo` option, meaning that the dependency is enabled by default and the user must pass `--without-foo` to disable this dependency. The default description can be overridden using the normal option syntax (in this case, the option declaration must precede the dependency):
+
+ ```ruby
+ option "with-foo", "Compile with foo bindings" # This overrides the generated description if you want to
+ depends_on "foo" => :optional # Generated description would otherwise be "Build with foo support"
+ ```
* Some [`Requirement`](https://rubydoc.brew.sh/Requirement)s can also take a string specifying their minimum version that the formula depends on.
**Note:** `:optional` and `:recommended` are not allowed in Homebrew/homebrew-core as they are not tested by CI.
@@ -181,8 +169,7 @@ Sometimes there’s hard conflict between formulae, and it can’t be avoided or
A good example formula for minor conflict is [`mbedtls`](https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/mbedtls.rb), which ships and compiles a "Hello World" executable. This is obviously non-essential to `mbedtls`’s functionality, and conflict with the popular GNU [`hello`](https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/hello.rb) formula would be overkill, so we just [remove it](https://github.com/Homebrew/homebrew-core/blob/966273060ad507fea490bd931971963de8b1a1dc/Formula/mbedtls.rb#L30-L31) during the installation process.
-[`pdftohtml`](https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/pdftohtml.rb) provides an example of a serious
-conflict, where both formula ship an identically-named binary that is essential to functionality, so a [`conflicts_with`](https://rubydoc.brew.sh/Formula#conflicts_with-class_method) is preferable.
+[`pdftohtml`](https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/pdftohtml.rb) provides an example of a serious conflict, where both formula ship an identically-named binary that is essential to functionality, so a [`conflicts_with`](https://rubydoc.brew.sh/Formula#conflicts_with-class_method) is preferable.
As a general rule, [`conflicts_with`](https://rubydoc.brew.sh/Formula#conflicts_with-class_method) should be a last-resort option. It’s a fairly blunt instrument.
@@ -264,9 +251,7 @@ Check the top of the e.g. `./configure` output. Some configure scripts do not re
Add a valid test to the [`test do`](https://rubydoc.brew.sh/Formula#test-class_method) block of the formula. This will be run by `brew test foo` and the [Brew Test Bot](Brew-Test-Bot.md).
-The [`test do`](https://rubydoc.brew.sh/Formula#test-class_method) block automatically creates and changes to a temporary directory which
-is deleted after run. You can access this [`Pathname`](https://rubydoc.brew.sh/Pathname) with the [`testpath`](https://rubydoc.brew.sh/Formula#testpath-instance_method)
-function. The environment variable `HOME` is set to [`testpath`](https://rubydoc.brew.sh/Formula#testpath-instance_method) within the [`test do`](https://rubydoc.brew.sh/Formula#test-class_method) block.
+The [`test do`](https://rubydoc.brew.sh/Formula#test-class_method) block automatically creates and changes to a temporary directory which is deleted after run. You can access this [`Pathname`](https://rubydoc.brew.sh/Pathname) with the [`testpath`](https://rubydoc.brew.sh/Formula#testpath-instance_method) function. The environment variable `HOME` is set to [`testpath`](https://rubydoc.brew.sh/Formula#testpath-instance_method) within the [`test do`](https://rubydoc.brew.sh/Formula#test-class_method) block.
We want tests that don't require any user input and test the basic functionality of the application. For example `foo build-foo input.foo` is a good test and (despite their widespread use) `foo --version` and `foo --help` are bad tests. However, a bad test is better than no test at all.
@@ -285,8 +270,8 @@ assert_predicate testpath/"output.txt", :exist?
```
Some advice for specific cases:
-* If the formula is a library, compile and run some simple code that links against it. It could be taken from upstream's documentation / source examples.
-A good example is [`tinyxml2`](https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/tinyxml2.rb), which writes a small C++ source file into the test directory, compiles and links it against the tinyxml2 library and finally checks that the resulting program runs successfully.
+
+* If the formula is a library, compile and run some simple code that links against it. It could be taken from upstream's documentation / source examples. A good example is [`tinyxml2`](https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/tinyxml2.rb), which writes a small C++ source file into the test directory, compiles and links it against the tinyxml2 library and finally checks that the resulting program runs successfully.
* If the formula is for a GUI program, try to find some function that runs as command-line only, like a format conversion, reading or displaying a config file, etc.
* If the software cannot function without credentials or requires a virtual machine, docker instance, etc. to run, a test could be to try to connect with invalid credentials (or without credentials) and confirm that it fails as expected. This is preferred over mocking a dependency.
* Homebrew comes with a number of [standard test fixtures](https://github.com/Homebrew/brew/tree/master/Library/Homebrew/test/support/fixtures), including numerous sample images, sounds, and documents in various formats. You can get the file path to a test fixture with `test_fixtures("test.svg")`.
@@ -315,13 +300,11 @@ Some software installs to `man` instead of `share/man`, so check the output and
In case there are specific issues with the Homebrew packaging (compared to how the software is installed from other sources) a `caveats` block can be added to the formula to warn users. This can indicate non-standard install paths, an example from the `ruby` formula:
-```
-==> Caveats
-By default, binaries installed by gem will be placed into:
- /usr/local/lib/ruby/gems/bin
+ ==> Caveats
+ By default, binaries installed by gem will be placed into:
+ /usr/local/lib/ruby/gems/bin
-You may want to add this to your PATH.
-```
+ You may want to add this to your PATH.
### A quick word on naming
@@ -352,8 +335,7 @@ You can run `brew audit --strict --online` to test formulae for adherence to Hom
New formulae being submitted to Homebrew should run `brew audit --new-formula foo`. This command is performed by the Brew Test Bot on new submissions as part of the automated build and test process, and highlights more potential issues than the standard audit.
-Use `brew info` and check if the version guessed by Homebrew from the URL is
-correct. Add an explicit [`version`](https://rubydoc.brew.sh/Formula#version-class_method) if not.
+Use `brew info` and check if the version guessed by Homebrew from the URL is correct. Add an explicit [`version`](https://rubydoc.brew.sh/Formula#version-class_method) if not.
### Commit
@@ -376,6 +358,7 @@ The established standard for Git commit messages is:
* explain the commit thoroughly.
At Homebrew, we like to put the name of the formula up front like so: `foobar 7.3 (new formula)`.
+
This may seem crazy short, but you’ll find that forcing yourself to summarise the commit encourages you to be atomic and concise. If you can’t summarise it in 50-80 characters, you’re probably trying to commit two commits as one. For a more thorough explanation, please read Tim Pope’s excellent blog post, [A Note About Git Commit Messages](https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html).
The preferred commit message format for simple version updates is `foobar 7.3` and for fixes is `foobar: fix flibble matrix.`.
@@ -510,15 +493,13 @@ patch :p0, :DATA
with the patch data included at the end of the file:
-```
-__END__
-diff --git a/foo/showfigfonts b/foo/showfigfonts
-index 643c60b..543379c 100644
---- a/foo/showfigfonts
-+++ b/foo/showfigfonts
-@@ -14,6 +14,7 @@
-…
-```
+ __END__
+ diff --git a/foo/showfigfonts b/foo/showfigfonts
+ index 643c60b..543379c 100644
+ --- a/foo/showfigfonts
+ +++ b/foo/showfigfonts
+ @@ -14,6 +14,7 @@
+ …
Patches can also be embedded by passing a string. This makes it possible to provide multiple embedded patches while making only some of them conditional.
@@ -538,6 +519,7 @@ brew edit foo
```
Now just paste into the formula after `__END__`.
+
Instead of `git diff | pbcopy`, for some editors `git diff >> path/to/your/formula/foo.rb` might help you ensure that the patch is not touched, e.g. white space removal, indentation changes, etc.
## Advanced formula tricks
@@ -819,23 +801,25 @@ Another example would be configuration files that should not be overwritten on p
### Service files
There are two ways to add plists and systemd services to a formula, so that [`brew services`](https://github.com/Homebrew/homebrew-services) can pick it up:
+
1. If the formula already provides a file the formula can install it into the prefix like so.
-```ruby
-prefix.install_symlink "file.plist" => "#{plist_name}.plist"
-prefix.install_symlink "file.service" => "#{service_name}.service"
-```
+ ```ruby
+ prefix.install_symlink "file.plist" => "#{plist_name}.plist"
+ prefix.install_symlink "file.service" => "#{service_name}.service"
+ ```
2. If the formula does not provide a service you can generate one using the following stanza.
-```rb
-service do
- run bin/"script"
-end
-```
+
+ ```rb
+ service do
+ run bin/"script"
+ end
+ ```
#### Service block methods
-There are many more options you can set within such a block, and in this table you will find them all.
-The only required field in a `service` block is the `run` field to indicate what to run.
+
+There are many more options you can set within such a block, and in this table you will find them all. The only required field in a `service` block is the `run` field to indicate what to run.
| Method | Default | macOS | Linux | Description |
|-------------------------|--------------|-------|-------|------------------------------------------------------------------------------------------|
@@ -857,84 +841,96 @@ The only required field in a `service` block is the `run` field to indicate what
| `sockets` | - | yes | no-op | A socket that is created as an accesspoint to the service |
For services that start and keep running alive you can use the default `run_type :` like so:
+
```ruby
- service do
- run [opt_bin/"beanstalkd", "test"]
- keep_alive true
- run_type :immediate # This should be omitted since it's the default
- end
+service do
+ run [opt_bin/"beanstalkd", "test"]
+ keep_alive true
+ run_type :immediate # This should be omitted since it's the default
+end
```
If a service needs to run on an interval, use `run_type :interval` and specify an interval:
+
```ruby
- service do
- run [opt_bin/"beanstalkd", "test"]
- run_type :interval
- interval 500
- end
+service do
+ run [opt_bin/"beanstalkd", "test"]
+ run_type :interval
+ interval 500
+end
```
If a service needs to run at certain times, use `run_type :cron` and specify a time with the crontab syntax:
+
```ruby
- service do
- run [opt_bin/"beanstalkd", "test"]
- run_type :cron
- cron "5 * * * *"
- end
+service do
+ run [opt_bin/"beanstalkd", "test"]
+ run_type :cron
+ cron "5 * * * *"
+end
```
For environment variables you can specify a hash. For the path there is the helper method `std_service_path_env`.
This method will set the path to `#{HOMEBREW_PREFIX}/bin:#{HOMEBREW_PREFIX}/sbin:/usr/bin:/bin:/usr/sbin:/sbin` so the service can find other `brew` commands.
+
```rb
- service do
- run opt_bin/"beanstalkd"
- environment_variables PATH: std_service_path_env
- end
+service do
+ run opt_bin/"beanstalkd"
+ environment_variables PATH: std_service_path_env
+end
```
#### KeepAlive options
+
The standard options, keep alive regardless of any status or circomstances
+
```rb
- service do
- run [opt_bin/"beanstalkd", "test"]
- keep_alive true # or false
- end
+service do
+ run [opt_bin/"beanstalkd", "test"]
+ keep_alive true # or false
+end
```
Same as above in hash form
+
```rb
- service do
- run [opt_bin/"beanstalkd", "test"]
- keep_alive { always: true }
- end
+service do
+ run [opt_bin/"beanstalkd", "test"]
+ keep_alive { always: true }
+end
```
Keep alive until the job exits with a non-zero return code
+
```rb
- service do
- run [opt_bin/"beanstalkd", "test"]
- keep_alive { succesful_exit: true }
- end
+service do
+ run [opt_bin/"beanstalkd", "test"]
+ keep_alive { succesful_exit: true }
+end
```
Keep alive only if the job crashed
+
```rb
- service do
- run [opt_bin/"beanstalkd", "test"]
- keep_alive { crashed: true }
- end
+service do
+ run [opt_bin/"beanstalkd", "test"]
+ keep_alive { crashed: true }
+end
```
Keep alive as long as a file exists
+
```rb
- service do
- run [opt_bin/"beanstalkd", "test"]
- keep_alive { path: "/some/path" }
- end
+service do
+ run [opt_bin/"beanstalkd", "test"]
+ keep_alive { path: "/some/path" }
+end
```
#### Socket format
+
The sockets method accepts a formatted socket definition as `<type>://<host>:<port>`.
+
- `type`: `udp` or `tcp`
- `host`: The host to run the socket on. For example `0.0.0.0`
- `port`: The port the socket should listen on. | true |
Other | Homebrew | brew | e7f723e5435b434f015a0f8d55f6769c63e02f5d.json | uses_from_macos: add mandoc to allowed list
- see https://github.com/Homebrew/homebrew-core/pull/115411 | Library/Homebrew/rubocops/uses_from_macos.rb | @@ -85,6 +85,7 @@ class UsesFromMacos < FormulaCop
groff
gzip
less
+ mandoc
openssl
perl
php | false |
Other | Homebrew | brew | f81857140f70ade6b0497eb718400e707889bc58.json | docs: Fix env variable typo | Library/Homebrew/env_config.rb | @@ -204,7 +204,7 @@ module EnvConfig
},
HOMEBREW_DOCKER_REGISTRY_TOKEN: {
description: "Use this bearer token for authenticating with a Docker registry proxying GitHub Packages. " \
- "Preferred over HOMEBREW_DOCKER_REGISTRY_TOKEN_BASIC.",
+ "Preferred over HOMEBREW_DOCKER_REGISTRY_BASIC_AUTH_TOKEN.",
},
HOMEBREW_GITHUB_PACKAGES_USER: {
description: "Use this username when accessing the GitHub Packages Registry (where bottles may be stored).", | true |
Other | Homebrew | brew | f81857140f70ade6b0497eb718400e707889bc58.json | docs: Fix env variable typo | docs/Manpage.md | @@ -2123,7 +2123,7 @@ example, run `export HOMEBREW_NO_INSECURE_REDIRECT=1` rather than just
<br>Use this base64 encoded username and password for authenticating with a Docker registry proxying GitHub Packages. If HOMEBREW_DOCKER_REGISTRY_TOKEN is set, it will be used instead.
- `HOMEBREW_DOCKER_REGISTRY_TOKEN`
- <br>Use this bearer token for authenticating with a Docker registry proxying GitHub Packages. Preferred over HOMEBREW_DOCKER_REGISTRY_TOKEN_BASIC.
+ <br>Use this bearer token for authenticating with a Docker registry proxying GitHub Packages. Preferred over HOMEBREW_DOCKER_REGISTRY_BASIC_AUTH_TOKEN.
- `HOMEBREW_GITHUB_PACKAGES_USER`
<br>Use this username when accessing the GitHub Packages Registry (where bottles may be stored). | true |
Other | Homebrew | brew | f81857140f70ade6b0497eb718400e707889bc58.json | docs: Fix env variable typo | manpages/brew.1 | @@ -3091,7 +3091,7 @@ Use this base64 encoded username and password for authenticating with a Docker r
\fBHOMEBREW_DOCKER_REGISTRY_TOKEN\fR
.
.br
-Use this bearer token for authenticating with a Docker registry proxying GitHub Packages\. Preferred over HOMEBREW_DOCKER_REGISTRY_TOKEN_BASIC\.
+Use this bearer token for authenticating with a Docker registry proxying GitHub Packages\. Preferred over HOMEBREW_DOCKER_REGISTRY_BASIC_AUTH_TOKEN\.
.
.TP
\fBHOMEBREW_GITHUB_PACKAGES_USER\fR | true |
Other | Homebrew | brew | a92c9eed823a5fd9b1904ab14a1609e3a87a8fea.json | style: check more shell scripts.
We were missing a few here so add them. Also, fix the changes in
`on-create-command.sh` that this catches. | .devcontainer/on-create-command.sh | @@ -5,8 +5,9 @@ set -e
sudo chmod -R g-w,o-w /home/linuxbrew
# everything below is too slow to do unless prebuilding so skip it
-CODESPACES_ACTION_NAME="$(cat /workspaces/.codespaces/shared/environment-variables.json | jq -r '.ACTION_NAME')"
-if [ "$CODESPACES_ACTION_NAME" != "createPrebuildTemplate" ];
+CODESPACES_ACTION_NAME="$(jq --raw-output '.ACTION_NAME' /workspaces/.codespaces/shared/environment-variables.json)"
+if [[ "${CODESPACES_ACTION_NAME}" != "createPrebuildTemplate" ]]
+then
echo "Skipping slow items, not prebuilding."
exit 0
fi
@@ -22,18 +23,23 @@ brew cleanup
# install some useful development things
sudo apt-get update
-APT_GET_INSTALL="openssh-server zsh"
+
+apt_get_install() {
+ sudo apt-get install -y \
+ -o Dpkg::Options::=--force-confdef \
+ -o Dpkg::Options::=--force-confnew \
+ "$@"
+}
+
+apt_get_install \
+ openssh-server \
+ zsh
# Ubuntu 18.04 doesn't include zsh-autosuggestions
if ! grep -q "Ubuntu 18.04" /etc/issue &>/dev/null
then
- APT_GET_INSTALL="$APT_GET_INSTALL zsh-autosuggestions"
+ apt_get_install zsh-autosuggestions
fi
-sudo apt-get install -y \
- -o Dpkg::Options::=--force-confdef \
- -o Dpkg::Options::=--force-confnew \
- $APT_GET_INSTALL
-
# Start the SSH server so that `gh cs ssh` works.
sudo service ssh start | true |
Other | Homebrew | brew | a92c9eed823a5fd9b1904ab14a1609e3a87a8fea.json | style: check more shell scripts.
We were missing a few here so add them. Also, fix the changes in
`on-create-command.sh` that this catches. | Library/Homebrew/style.rb | @@ -262,12 +262,13 @@ def shell_scripts
HOMEBREW_BREW_FILE,
HOMEBREW_REPOSITORY/"completions/bash/brew",
HOMEBREW_REPOSITORY/"Dockerfile",
- *HOMEBREW_LIBRARY.glob("Homebrew/*.sh"),
+ *HOMEBREW_REPOSITORY.glob(".devcontainer/**/*.sh"),
+ *HOMEBREW_LIBRARY.glob("Homebrew/**/*.sh").reject { |path| path.to_s.include?("/vendor/") },
*HOMEBREW_LIBRARY.glob("Homebrew/shims/**/*").map(&:realpath).uniq
.reject(&:directory?)
.reject { |path| path.basename.to_s == "cc" }
.select do |path|
- %r{^#! ?/bin/(?:ba)?sh( |$)}.match?(path.read(13)) || path.extname == ".sh"
+ %r{^#! ?/bin/(?:ba)?sh( |$)}.match?(path.read(13))
end,
*HOMEBREW_LIBRARY.glob("Homebrew/{dev-,}cmd/*.sh"),
*HOMEBREW_LIBRARY.glob("Homebrew/{cask/,}utils/*.sh"), | true |
Other | Homebrew | brew | 33d3a5d7284c30f326d0f9006415d2a47ff6acf9.json | cask/artifiact/abstract_uninstall: allow wildcard entries for launchctl | Library/Homebrew/cask/artifact/abstract_uninstall.rb | @@ -90,7 +90,22 @@ def uninstall_early_script(directives, **options)
# :launchctl must come before :quit/:signal for cases where app would instantly re-launch
def uninstall_launchctl(*services, command: nil, **_)
booleans = [false, true]
+
+ all_services = []
+
+ # if launchctl item contains a wildcard, find matching process(es)
services.each do |service|
+ all_services.push(service)
+ next unless /\*/.match?(service)
+
+ find_launchctl_with_wildcard(service)
+ .map { |_, _, id| id }
+ .each do |match|
+ all_services.push(match)
+ end
+ end
+
+ all_services.each do |service|
ohai "Removing launchctl service #{service}"
booleans.each do |with_sudo|
plist_status = command.run(
@@ -268,6 +283,16 @@ def uninstall_login_item(*login_items, command: nil, upgrade: false, **_)
end
end
+ def find_launchctl_with_wildcard(search)
+ system_command!("/bin/launchctl", args: ["list"])
+ .stdout.lines.drop(1)
+ .map { |line| line.chomp.split("\t") }
+ .map { |pid, state, id| [pid.to_i, state.to_i, id] }
+ .select do |(pid, _, id)|
+ pid.nonzero? && /\A#{Regexp.escape(search).gsub("\\*", ".*")}\Z/.match?(id)
+ end
+ end
+
# :kext should be unloaded before attempting to delete the relevant file
def uninstall_kext(*kexts, command: nil, **_)
kexts.each do |kext| | false |
Other | Homebrew | brew | 9eac310468b60a4ab4ef02aeda9e513337bbb198.json | Allow multiple macOS requirements | Library/Homebrew/requirement.rb | @@ -126,7 +126,7 @@ def ==(other)
alias eql? ==
def hash
- [name, tags].hash
+ [self.class, name, tags].hash
end
sig { returns(String) } | true |
Other | Homebrew | brew | 9eac310468b60a4ab4ef02aeda9e513337bbb198.json | Allow multiple macOS requirements | Library/Homebrew/requirements/macos_requirement.rb | @@ -88,6 +88,15 @@ def message(type: :formula)
end
end
+ def ==(other)
+ super(other) && comparator == other.comparator && version == other.version
+ end
+ alias eql? ==
+
+ def hash
+ [super, comparator, version].hash
+ end
+
sig { returns(String) }
def inspect
"#<#{self.class.name}: version#{@comparator}#{@version.to_s.inspect} #{tags.inspect}>" | true |
Other | Homebrew | brew | ccb51a519d84be12cebe232e470bb0c813010c92.json | Update RBI files for zeitwerk.
Autogenerated by the [vendor-gems](https://github.com/Homebrew/brew/blob/HEAD/.github/workflows/vendor-gemss.yml) workflow. | Library/Homebrew/sorbet/rbi/gems/zeitwerk@2.6.6.rbi | @@ -28,16 +28,18 @@ module Zeitwerk::ExplicitNamespace
extend ::Zeitwerk::RealModName
class << self
- def cpaths; end
- def mutex; end
- def register(cpath, loader); end
- def tracer; end
- def unregister_loader(loader); end
+ def __register(cpath, loader); end
+ def __unregister_loader(loader); end
private
+ def cpaths; end
def disable_tracer_if_unneeded; end
+ def mutex; end
+ def register(cpath, loader); end
def tracepoint_class_callback(event); end
+ def tracer; end
+ def unregister_loader(loader); end
end
end
@@ -135,6 +137,7 @@ module Zeitwerk::Loader::Callbacks
end
module Zeitwerk::Loader::Config
+ include ::Zeitwerk::RealModName
extend ::Zeitwerk::Internal
def initialize; end
@@ -170,6 +173,7 @@ module Zeitwerk::Loader::Config
def expand_glob_patterns(glob_patterns); end
def expand_paths(paths); end
def ignored_glob_patterns; end
+ def ignored_path?(abspath); end
def ignored_paths; end
def ignores?(abspath); end
def on_load_callbacks; end
@@ -240,4 +244,8 @@ class Zeitwerk::ReloadingDisabledError < ::Zeitwerk::Error
def initialize; end
end
+class Zeitwerk::SetupRequired < ::Zeitwerk::Error
+ def initialize; end
+end
+
Zeitwerk::VERSION = T.let(T.unsafe(nil), String) | false |
Other | Homebrew | brew | 561602fa5132bf33c61cbd3dcd4306ffde014a7d.json | use Manpages method on dev-cmd/update_maintainers | Library/Homebrew/dev-cmd/update-maintainers.rb | @@ -3,9 +3,7 @@
require "cli/parser"
require "utils/github"
-
-# TODO: move function to manpages.rb and require that instead
-require "dev-cmd/generate-man-completions"
+require "manpages"
module Homebrew
extend T::Sig
@@ -61,8 +59,7 @@ def update_maintainers
if diff.status.success?
ofail "No changes to list of maintainers."
else
- # TODO: move function to manpages.rb and call that instead
- Homebrew.regenerate_man_pages(quiet: true)
+ Manpages.regenerate_man_pages(quiet: true)
puts "List of maintainers updated in the README and the generated man pages."
end
end | false |
Other | Homebrew | brew | d89344b41de6f9a51840869300924bd59962620a.json | add manpage.rb to generating homebrew manual | Library/Homebrew/dev-cmd/generate-man-completions.rb | @@ -2,20 +2,15 @@
# frozen_string_literal: true
require "formula"
-require "erb"
require "ostruct"
-require "cli/parser"
require "completions"
+require "manpages"
module Homebrew
extend T::Sig
module_function
- SOURCE_PATH = (HOMEBREW_LIBRARY_PATH/"manpages").freeze
- TARGET_MAN_PATH = (HOMEBREW_REPOSITORY/"manpages").freeze
- TARGET_DOC_PATH = (HOMEBREW_REPOSITORY/"docs").freeze
-
sig { returns(CLI::Parser) }
def generate_man_completions_args
Homebrew::CLI::Parser.new do
@@ -38,7 +33,7 @@ def generate_man_completions
odeprecated "brew generate-man-completions --fail-if-not-changed" if args.fail_if_not_changed?
Commands.rebuild_internal_commands_completion_list
- regenerate_man_pages(quiet: args.quiet?)
+ Manpages.regenerate_man_pages(quiet: args.quiet?)
Completions.update_shell_completions!
diff = system_command "git", args: [
@@ -50,218 +45,4 @@ def generate_man_completions
puts "Manpage and completions updated."
end
end
-
- # TODO: move this method and all called functions to manpages.rb
- def regenerate_man_pages(quiet:)
- Homebrew.install_bundler_gems!
-
- markup = build_man_page(quiet: quiet)
- convert_man_page(markup, TARGET_DOC_PATH/"Manpage.md")
- markup = I18n.transliterate(markup, locale: :en)
- convert_man_page(markup, TARGET_MAN_PATH/"brew.1")
- end
-
- def build_man_page(quiet:)
- template = (SOURCE_PATH/"brew.1.md.erb").read
- variables = OpenStruct.new
-
- variables[:commands] = generate_cmd_manpages(Commands.internal_commands_paths)
- variables[:developer_commands] = generate_cmd_manpages(Commands.internal_developer_commands_paths)
- variables[:official_external_commands] =
- generate_cmd_manpages(Commands.official_external_commands_paths(quiet: quiet))
- variables[:global_cask_options] = global_cask_options_manpage
- variables[:global_options] = global_options_manpage
- variables[:environment_variables] = env_vars_manpage
-
- readme = HOMEBREW_REPOSITORY/"README.md"
- variables[:lead] =
- readme.read[/(Homebrew's \[Project Leader.*\.)/, 1]
- .gsub(/\[([^\]]+)\]\([^)]+\)/, '\1')
- variables[:plc] =
- readme.read[/(Homebrew's \[Project Leadership Committee.*\.)/, 1]
- .gsub(/\[([^\]]+)\]\([^)]+\)/, '\1')
- variables[:tsc] =
- readme.read[/(Homebrew's \[Technical Steering Committee.*\.)/, 1]
- .gsub(/\[([^\]]+)\]\([^)]+\)/, '\1')
- variables[:maintainers] =
- readme.read[/(Homebrew's other current maintainers .*\.)/, 1]
- .gsub(/\[([^\]]+)\]\([^)]+\)/, '\1')
- variables[:alumni] =
- readme.read[/(Former maintainers .*\.)/, 1]
- .gsub(/\[([^\]]+)\]\([^)]+\)/, '\1')
-
- ERB.new(template, trim_mode: ">").result(variables.instance_eval { binding })
- end
-
- def sort_key_for_path(path)
- # Options after regular commands (`~` comes after `z` in ASCII table).
- path.basename.to_s.sub(/\.(rb|sh)$/, "").sub(/^--/, "~~")
- end
-
- def convert_man_page(markup, target)
- manual = target.basename(".1")
- organisation = "Homebrew"
-
- # Set the manpage date to the existing one if we're updating.
- # This avoids the only change being e.g. a new date.
- date = if target.extname == ".1" && target.exist?
- /"(\d{1,2})" "([A-Z][a-z]+) (\d{4})" "#{organisation}" "#{manual}"/ =~ target.read
- Date.parse("#{Regexp.last_match(1)} #{Regexp.last_match(2)} #{Regexp.last_match(3)}")
- else
- Date.today
- end
- date = date.strftime("%Y-%m-%d")
-
- shared_args = %W[
- --pipe
- --organization=#{organisation}
- --manual=#{target.basename(".1")}
- --date=#{date}
- ]
-
- format_flag, format_desc = target_path_to_format(target)
-
- puts "Writing #{format_desc} to #{target}"
- Utils.popen(["ronn", format_flag] + shared_args, "rb+") do |ronn|
- ronn.write markup
- ronn.close_write
- ronn_output = ronn.read
- odie "Got no output from ronn!" if ronn_output.blank?
- case format_flag
- when "--markdown"
- ronn_output = ronn_output.gsub(%r{<var>(.*?)</var>}, "*`\\1`*")
- .gsub(/\n\n\n+/, "\n\n")
- .gsub(/^(- `[^`]+`):/, "\\1") # drop trailing colons from definition lists
- .gsub(/(?<=\n\n)([\[`].+):\n/, "\\1\n<br>") # replace colons with <br> on subcommands
- when "--roff"
- ronn_output = ronn_output.gsub(%r{<code>(.*?)</code>}, "\\fB\\1\\fR")
- .gsub(%r{<var>(.*?)</var>}, "\\fI\\1\\fR")
- .gsub(/(^\[?\\fB.+): /, "\\1\n ")
- end
- target.atomic_write ronn_output
- end
- end
-
- def target_path_to_format(target)
- case target.basename
- when /\.md$/ then ["--markdown", "markdown"]
- when /\.\d$/ then ["--roff", "man page"]
- else
- odie "Failed to infer output format from '#{target.basename}'."
- end
- end
-
- def generate_cmd_manpages(cmd_paths)
- man_page_lines = []
-
- # preserve existing manpage order
- cmd_paths.sort_by(&method(:sort_key_for_path))
- .each do |cmd_path|
- cmd_man_page_lines = if (cmd_parser = CLI::Parser.from_cmd_path(cmd_path))
- next if cmd_parser.hide_from_man_page
-
- cmd_parser_manpage_lines(cmd_parser).join
- else
- cmd_comment_manpage_lines(cmd_path)
- end
-
- man_page_lines << cmd_man_page_lines
- end
-
- man_page_lines.compact.join("\n")
- end
-
- def cmd_parser_manpage_lines(cmd_parser)
- lines = [format_usage_banner(cmd_parser.usage_banner_text)]
- lines += cmd_parser.processed_options.map do |short, long, _, desc, hidden|
- next if hidden
-
- if long.present?
- next if Homebrew::CLI::Parser.global_options.include?([short, long, desc])
- next if Homebrew::CLI::Parser.global_cask_options.any? do |_, option, description:, **|
- [long, "#{long}="].include?(option) && description == desc
- end
- end
-
- generate_option_doc(short, long, desc)
- end.compact
- lines
- end
-
- def cmd_comment_manpage_lines(cmd_path)
- comment_lines = cmd_path.read.lines.grep(/^#:/)
- return if comment_lines.empty?
- return if comment_lines.first.include?("@hide_from_man_page")
-
- lines = [format_usage_banner(comment_lines.first).chomp]
- comment_lines.slice(1..-1)
- .each do |line|
- line = line.slice(4..-2)
- unless line
- lines.last << "\n"
- next
- end
-
- # Omit the common global_options documented separately in the man page.
- next if line.match?(/--(debug|help|quiet|verbose) /)
-
- # Format one option or a comma-separated pair of short and long options.
- lines << line.gsub(/^ +(-+[a-z-]+), (-+[a-z-]+) +/, "* `\\1`, `\\2`:\n ")
- .gsub(/^ +(-+[a-z-]+) +/, "* `\\1`:\n ")
- end
- lines.last << "\n"
- lines
- end
-
- sig { returns(String) }
- def global_cask_options_manpage
- lines = ["These options are applicable to the `install`, `reinstall`, and `upgrade` " \
- "subcommands with the `--cask` flag.\n"]
- lines += Homebrew::CLI::Parser.global_cask_options.map do |_, long, description:, **|
- generate_option_doc(nil, long.chomp("="), description)
- end
- lines.join("\n")
- end
-
- sig { returns(String) }
- def global_options_manpage
- lines = ["These options are applicable across multiple subcommands.\n"]
- lines += Homebrew::CLI::Parser.global_options.map do |short, long, desc|
- generate_option_doc(short, long, desc)
- end
- lines.join("\n")
- end
-
- sig { returns(String) }
- def env_vars_manpage
- lines = Homebrew::EnvConfig::ENVS.flat_map do |env, hash|
- entry = "- `#{env}`:\n <br>#{hash[:description]}\n"
- default = hash[:default_text]
- default ||= "`#{hash[:default]}`." if hash[:default]
- entry += "\n\n *Default:* #{default}\n" if default
-
- entry
- end
- lines.join("\n")
- end
-
- def generate_option_doc(short, long, desc)
- comma = (short && long) ? ", " : ""
- <<~EOS
- * #{format_short_opt(short)}#{comma}#{format_long_opt(long)}:
- #{desc}
- EOS
- end
-
- def format_short_opt(opt)
- "`#{opt}`" unless opt.nil?
- end
-
- def format_long_opt(opt)
- "`#{opt}`" unless opt.nil?
- end
-
- def format_usage_banner(usage_banner)
- usage_banner&.sub(/^(#: *\* )?/, "### ")
- end
end | true |
Other | Homebrew | brew | d89344b41de6f9a51840869300924bd59962620a.json | add manpage.rb to generating homebrew manual | Library/Homebrew/manpages.rb | @@ -0,0 +1,228 @@
+# typed: true
+# frozen_string_literal: true
+
+require "cli/parser"
+require "erb"
+
+SOURCE_PATH = (HOMEBREW_LIBRARY_PATH/"manpages").freeze
+TARGET_MAN_PATH = (HOMEBREW_REPOSITORY/"manpages").freeze
+TARGET_DOC_PATH = (HOMEBREW_REPOSITORY/"docs").freeze
+module Homebrew
+ # Helper functions for generating homebrew manual.
+ #
+ # @api private
+ module Manpages
+ extend T::Sig
+
+ module_function
+
+ def regenerate_man_pages(quiet:)
+ Homebrew.install_bundler_gems!
+
+ markup = build_man_page(quiet: quiet)
+ convert_man_page(markup, TARGET_DOC_PATH/"Manpage.md")
+ markup = I18n.transliterate(markup, locale: :en)
+ convert_man_page(markup, TARGET_MAN_PATH/"brew.1")
+ end
+
+ def build_man_page(quiet:)
+ template = (SOURCE_PATH/"brew.1.md.erb").read
+ variables = OpenStruct.new
+
+ variables[:commands] = generate_cmd_manpages(Commands.internal_commands_paths)
+ variables[:developer_commands] = generate_cmd_manpages(Commands.internal_developer_commands_paths)
+ variables[:official_external_commands] =
+ generate_cmd_manpages(Commands.official_external_commands_paths(quiet: quiet))
+ variables[:global_cask_options] = global_cask_options_manpage
+ variables[:global_options] = global_options_manpage
+ variables[:environment_variables] = env_vars_manpage
+
+ readme = HOMEBREW_REPOSITORY/"README.md"
+ variables[:lead] =
+ readme.read[/(Homebrew's \[Project Leader.*\.)/, 1]
+ .gsub(/\[([^\]]+)\]\([^)]+\)/, '\1')
+ variables[:plc] =
+ readme.read[/(Homebrew's \[Project Leadership Committee.*\.)/, 1]
+ .gsub(/\[([^\]]+)\]\([^)]+\)/, '\1')
+ variables[:tsc] =
+ readme.read[/(Homebrew's \[Technical Steering Committee.*\.)/, 1]
+ .gsub(/\[([^\]]+)\]\([^)]+\)/, '\1')
+ variables[:maintainers] =
+ readme.read[/(Homebrew's other current maintainers .*\.)/, 1]
+ .gsub(/\[([^\]]+)\]\([^)]+\)/, '\1')
+ variables[:alumni] =
+ readme.read[/(Former maintainers .*\.)/, 1]
+ .gsub(/\[([^\]]+)\]\([^)]+\)/, '\1')
+
+ ERB.new(template, trim_mode: ">").result(variables.instance_eval { binding })
+ end
+
+ def sort_key_for_path(path)
+ # Options after regular commands (`~` comes after `z` in ASCII table).
+ path.basename.to_s.sub(/\.(rb|sh)$/, "").sub(/^--/, "~~")
+ end
+
+ def convert_man_page(markup, target)
+ manual = target.basename(".1")
+ organisation = "Homebrew"
+
+ # Set the manpage date to the existing one if we're updating.
+ # This avoids the only change being e.g. a new date.
+ date = if target.extname == ".1" && target.exist?
+ /"(\d{1,2})" "([A-Z][a-z]+) (\d{4})" "#{organisation}" "#{manual}"/ =~ target.read
+ Date.parse("#{Regexp.last_match(1)} #{Regexp.last_match(2)} #{Regexp.last_match(3)}")
+ else
+ Date.today
+ end
+ date = date.strftime("%Y-%m-%d")
+
+ shared_args = %W[
+ --pipe
+ --organization=#{organisation}
+ --manual=#{target.basename(".1")}
+ --date=#{date}
+ ]
+
+ format_flag, format_desc = target_path_to_format(target)
+
+ puts "Writing #{format_desc} to #{target}"
+ Utils.popen(["ronn", format_flag] + shared_args, "rb+") do |ronn|
+ ronn.write markup
+ ronn.close_write
+ ronn_output = ronn.read
+ odie "Got no output from ronn!" if ronn_output.blank?
+ ronn_output = case format_flag
+ when "--markdown"
+ onn_output.gsub(%r{<var>(.*?)</var>}, "*`\\1`*")
+ .gsub(/\n\n\n+/, "\n\n")
+ .gsub(/^(- `[^`]+`):/, "\\1") # drop trailing colons from definition lists
+ .gsub(/(?<=\n\n)([\[`].+):\n/, "\\1\n<br>") # replace colons with <br> on subcommands
+ when "--roff"
+ ronn_output.gsub(%r{<code>(.*?)</code>}, "\\fB\\1\\fR")
+ .gsub(%r{<var>(.*?)</var>}, "\\fI\\1\\fR")
+ .gsub(/(^\[?\\fB.+): /, "\\1\n ")
+ end
+ target.atomic_write ronn_output
+ end
+ end
+
+ def target_path_to_format(target)
+ case target.basename
+ when /\.md$/ then ["--markdown", "markdown"]
+ when /\.\d$/ then ["--roff", "man page"]
+ else
+ odie "Failed to infer output format from '#{target.basename}'."
+ end
+ end
+
+ def generate_cmd_manpages(cmd_paths)
+ man_page_lines = []
+
+ # preserve existing manpage order
+ cmd_paths.sort_by(&method(:sort_key_for_path))
+ .each do |cmd_path|
+ cmd_man_page_lines = if (cmd_parser = Homebrew::CLI::Parser.from_cmd_path(cmd_path))
+ next if cmd_parser.hide_from_man_page
+
+ cmd_parser_manpage_lines(cmd_parser).join
+ else
+ cmd_comment_manpage_lines(cmd_path)
+ end
+
+ man_page_lines << cmd_man_page_lines
+ end
+
+ man_page_lines.compact.join("\n")
+ end
+
+ def cmd_parser_manpage_lines(cmd_parser)
+ lines = [format_usage_banner(cmd_parser.usage_banner_text)]
+ lines += cmd_parser.processed_options.map do |short, long, _, desc, hidden|
+ next if hidden
+
+ if long.present?
+ next if Homebrew::CLI::Parser.global_options.include?([short, long, desc])
+ next if Homebrew::CLI::Parser.global_cask_options.any? do |_, option, description:, **|
+ [long, "#{long}="].include?(option) && description == desc
+ end
+ end
+
+ generate_option_doc(short, long, desc)
+ end.compact
+ lines
+ end
+
+ def cmd_comment_manpage_lines(cmd_path)
+ comment_lines = cmd_path.read.lines.grep(/^#:/)
+ return if comment_lines.empty?
+ return if comment_lines.first.include?("@hide_from_man_page")
+
+ lines = [format_usage_banner(comment_lines.first).chomp]
+ comment_lines.slice(1..-1)
+ .each do |line|
+ line = line.slice(4..-2)
+ unless line
+ lines.last << "\n"
+ next
+ end
+
+ # Omit the common global_options documented separately in the man page.
+ next if line.match?(/--(debug|help|quiet|verbose) /)
+
+ # Format one option or a comma-separated pair of short and long options.
+ lines << line.gsub(/^ +(-+[a-z-]+), (-+[a-z-]+) +/, "* `\\1`, `\\2`:\n ")
+ .gsub(/^ +(-+[a-z-]+) +/, "* `\\1`:\n ")
+ end
+ lines.last << "\n"
+ lines
+ end
+
+ sig { returns(String) }
+ def global_cask_options_manpage
+ lines = ["These options are applicable to the `install`, `reinstall`, and `upgrade` " \
+ "subcommands with the `--cask` flag.\n"]
+ lines += Homebrew::CLI::Parser.global_cask_options.map do |_, long, description:, **|
+ generate_option_doc(nil, long.chomp("="), description)
+ end
+ lines.join("\n")
+ end
+
+ sig { returns(String) }
+ def global_options_manpage
+ lines = ["These options are applicable across multiple subcommands.\n"]
+ lines += Homebrew::CLI::Parser.global_options.map do |short, long, desc|
+ generate_option_doc(short, long, desc)
+ end
+ lines.join("\n")
+ end
+
+ sig { returns(String) }
+ def env_vars_manpage
+ lines = Homebrew::EnvConfig::ENVS.flat_map do |env, hash|
+ entry = "- `#{env}`:\n <br>#{hash[:description]}\n"
+ default = hash[:default_text]
+ default ||= "`#{hash[:default]}`." if hash[:default]
+ entry += "\n\n *Default:* #{default}\n" if default
+
+ entry
+ end
+ lines.join("\n")
+ end
+
+ def format_opt(opt)
+ "`#{opt}`" unless opt.nil?
+ end
+
+ def generate_option_doc(short, long, desc)
+ comma = (short && long) ? ", " : ""
+ <<~EOS
+ * #{format_opt(short)}#{comma}#{format_opt(long)}:
+ #{desc}
+ EOS
+ end
+
+ def format_usage_banner(usage_banner)
+ usage_banner&.sub(/^(#: *\* )?/, "### ")
+ end
+ end
+end | true |
Other | Homebrew | brew | d89344b41de6f9a51840869300924bd59962620a.json | add manpage.rb to generating homebrew manual | Library/Homebrew/manpages.rbi | @@ -0,0 +1,7 @@
+# typed: strict
+
+module Homebrew
+ module Manpages
+ include Kernel
+ end
+end | true |
Other | Homebrew | brew | bc4274fda0385029fdf5bbe51937bfb4e02eca6d.json | devcontainer/on-create-command: fix Ubuntu 18.04, add debugging.
Add some debugging information to be able to customise the prebuild/not
cases for this script.
Also, handle `zsh-autosuggestions` not being available for Ubuntu 18.04. | .devcontainer/on-create-command.sh | @@ -1,6 +1,20 @@
#!/bin/bash
set -e
+# dump information variables for debugging
+echo "==> env"
+env | grep -v TOKEN
+echo
+echo "==> /etc/os-release"
+cat /etc/os-release || true
+echo
+echo "==> /etc/lsb-release"
+cat /etc/lsb-release || true
+echo
+echo "==> /etc/issue"
+cat /etc/issue || true
+echo
+
# fix permissions so Homebrew and Bundler don't complain
sudo chmod -R g-w,o-w /home/linuxbrew
@@ -15,12 +29,18 @@ brew cleanup
# install some useful development things
sudo apt-get update
+APT_GET_INSTALL="openssh-server zsh"
+
+# Ubuntu 18.04 doesn't include zsh-autosuggestions
+if ! grep -q "Ubuntu 18.04" /etc/issue &>/dev/null
+then
+ APT_GET_INSTALL="$APT_GET_INSTALL zsh-autosuggestions"
+fi
+
sudo apt-get install -y \
-o Dpkg::Options::=--force-confdef \
-o Dpkg::Options::=--force-confnew \
- openssh-server \
- zsh \
- zsh-autosuggestions
+ $APT_GET_INSTALL
# Start the SSH server so that `gh cs ssh` works.
sudo service ssh start | false |
Other | Homebrew | brew | d477d1663acaee53ec73acf7e4c3a1b2fd256878.json | Service: add method to define a root requirement | Library/Homebrew/formula.rb | @@ -995,6 +995,8 @@ def with_logging(log_type)
# </plist>
# EOS
# end</pre>
+ #
+ # @deprecated Please use {#service} instead
def plist
nil
end
@@ -1014,6 +1016,13 @@ def service_name
# The generated launchd {.plist} file path.
sig { returns(Pathname) }
def plist_path
+ odeprecated "formula.plist_path", "formula.launchd_service_path"
+ launchd_service_path
+ end
+
+ # The generated systemd {.service} file path.
+ sig { returns(Pathname) }
+ def launchd_service_path
opt_prefix/"#{plist_name}.plist"
end
@@ -3121,7 +3130,10 @@ def patch(strip = :p1, src = nil, &block)
#
# Or perhaps you'd like to give the user a choice? Ooh fancy.
# <pre>plist_options startup: true, manual: "foo start"</pre>
+ #
+ # @deprecated Please use {#service.require_root} instead
def plist_options(options)
+ odeprecated "plist_options", "service.require_root"
@plist_startup = options[:startup]
@plist_manual = options[:manual]
end
@@ -3259,7 +3271,7 @@ def livecheck(&block)
# Service can be used to define services.
# This method evaluates the DSL specified in the service block of the
# {Formula} (if it exists) and sets the instance variables of a Service
- # object accordingly. This is used by `brew install` to generate a plist.
+ # object accordingly. This is used by `brew install` to generate a service file.
#
# <pre>service do
# run [opt_bin/"foo"] | true |
Other | Homebrew | brew | d477d1663acaee53ec73acf7e4c3a1b2fd256878.json | Service: add method to define a root requirement | Library/Homebrew/service.rb | @@ -129,6 +129,26 @@ def keep_alive(value = nil)
end
end
+ sig { params(value: T.nilable(T::Boolean)).returns(T.nilable(T::Boolean)) }
+ def require_root(value = nil)
+ case T.unsafe(value)
+ when nil
+ @require_root
+ when true, false
+ @require_root = value
+ else
+ raise TypeError, "Service#require_root expects a Boolean"
+ end
+ end
+
+ # Returns a `Boolean` describing if a service requires root access.
+ # @return [Boolean]
+ sig { returns(T::Boolean) }
+ def requires_root?
+ instance_eval(&@service_block)
+ @require_root.present? && @require_root == true
+ end
+
sig { params(value: T.nilable(String)).returns(T.nilable(T::Hash[Symbol, String])) }
def sockets(value = nil)
case T.unsafe(value) | true |
Other | Homebrew | brew | d477d1663acaee53ec73acf7e4c3a1b2fd256878.json | Service: add method to define a root requirement | Library/Homebrew/test/formula_spec.rb | @@ -733,7 +733,7 @@
expect(f.plist_name).to eq("homebrew.mxcl.formula_name")
expect(f.service_name).to eq("homebrew.formula_name")
- expect(f.plist_path).to eq(HOMEBREW_PREFIX/"opt/formula_name/homebrew.mxcl.formula_name.plist")
+ expect(f.launchd_service_path).to eq(HOMEBREW_PREFIX/"opt/formula_name/homebrew.mxcl.formula_name.plist")
expect(f.systemd_service_path).to eq(HOMEBREW_PREFIX/"opt/formula_name/homebrew.formula_name.service")
expect(f.systemd_timer_path).to eq(HOMEBREW_PREFIX/"opt/formula_name/homebrew.formula_name.timer")
end | true |
Other | Homebrew | brew | d477d1663acaee53ec73acf7e4c3a1b2fd256878.json | Service: add method to define a root requirement | Library/Homebrew/test/service_spec.rb | @@ -64,6 +64,29 @@ def stub_formula(&block)
end
end
+ describe "#requires_root?" do
+ it "returns status when set" do
+ f = stub_formula do
+ service do
+ run opt_bin/"beanstalkd"
+ require_root true
+ end
+ end
+
+ expect(f.service.requires_root?).to be(true)
+ end
+
+ it "returns status when not set" do
+ f = stub_formula do
+ service do
+ run opt_bin/"beanstalkd"
+ end
+ end
+
+ expect(f.service.requires_root?).to be(false)
+ end
+ end
+
describe "#run_type" do
it "throws for unexpected type" do
f = stub_formula do
@@ -166,6 +189,7 @@ def stub_formula(&block)
error_log_path var/"log/beanstalkd.error.log"
log_path var/"log/beanstalkd.log"
input_path var/"in/beanstalkd"
+ require_root true
root_dir var
working_dir var
keep_alive true
@@ -539,6 +563,7 @@ def stub_formula(&block)
error_log_path var/"log/beanstalkd.error.log"
log_path var/"log/beanstalkd.log"
input_path var/"in/beanstalkd"
+ require_root true
root_dir var
working_dir var
keep_alive true | true |
Other | Homebrew | brew | 7177bd587706cf2c3c15129564c08dded8becb0a.json | Update RBI files for json_schemer.
Autogenerated by the [vendor-gems](https://github.com/Homebrew/brew/blob/HEAD/.github/workflows/vendor-gemss.yml) workflow. | Library/Homebrew/sorbet/rbi/gems/json_schemer@0.2.23.rbi | @@ -14,10 +14,12 @@ module JSONSchemer
end
end
-class JSONSchemer::CachedRefResolver
- def initialize(&ref_resolver); end
+class JSONSchemer::CachedRefResolver < ::JSONSchemer::CachedResolver; end
- def call(uri); end
+class JSONSchemer::CachedResolver
+ def initialize(&resolver); end
+
+ def call(*args); end
end
JSONSchemer::DEFAULT_META_SCHEMA = T.let(T.unsafe(nil), String)
@@ -57,13 +59,14 @@ JSONSchemer::Format::LABEL_REGEX_STRING = T.let(T.unsafe(nil), String)
JSONSchemer::Format::RELATIVE_JSON_POINTER_REGEX = T.let(T.unsafe(nil), Regexp)
class JSONSchemer::InvalidFileURI < ::StandardError; end
class JSONSchemer::InvalidRefResolution < ::StandardError; end
+class JSONSchemer::InvalidRegexpResolution < ::StandardError; end
class JSONSchemer::InvalidSymbolKey < ::StandardError; end
module JSONSchemer::Schema; end
class JSONSchemer::Schema::Base
include ::JSONSchemer::Format
- 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 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), regexp_resolver: T.unsafe(nil)); end
def valid?(data); end
def validate(data); end
@@ -78,7 +81,6 @@ class JSONSchemer::Schema::Base
def child(schema); end
def custom_format?(format); end
- def ecma_262_regex(pattern); end
def error(instance, type, details = T.unsafe(nil)); end
def format?; end
def formats; end
@@ -87,8 +89,10 @@ class JSONSchemer::Schema::Base
def keywords; end
def pointer_uri(schema, pointer); end
def ref_resolver; end
+ def regexp_resolver; end
def resolve_ids(schema, ids = T.unsafe(nil), parent_uri = T.unsafe(nil), pointer = T.unsafe(nil)); end
def resolve_ref(uri); end
+ def resolve_regexp(pattern); end
def root; end
def safe_strict_decode64(data); end
def spec_format?(format); end
@@ -108,6 +112,7 @@ end
JSONSchemer::Schema::Base::BOOLEANS = T.let(T.unsafe(nil), Set)
JSONSchemer::Schema::Base::DEFAULT_REF_RESOLVER = T.let(T.unsafe(nil), Proc)
+JSONSchemer::Schema::Base::ECMA_262_REGEXP_RESOLVER = T.let(T.unsafe(nil), Proc)
JSONSchemer::Schema::Base::ID_KEYWORD = T.let(T.unsafe(nil), String)
JSONSchemer::Schema::Base::INSERT_DEFAULT_PROPERTY = T.let(T.unsafe(nil), Proc)
| false |
Other | Homebrew | brew | e77dafd413a09452588952ae5f0fa0756485d757.json | Update RBI files for rubocop-rails.
Autogenerated by the [vendor-gems](https://github.com/Homebrew/brew/blob/HEAD/.github/workflows/vendor-gemss.yml) workflow. | Library/Homebrew/sorbet/rbi/gems/rubocop-rails@2.17.2.rbi | @@ -175,6 +175,24 @@ RuboCop::Cop::Rails::ActionFilter::FILTER_METHODS = T.let(T.unsafe(nil), Array)
RuboCop::Cop::Rails::ActionFilter::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Rails::ActionFilter::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
+class RuboCop::Cop::Rails::ActionOrder < ::RuboCop::Cop::Base
+ include ::RuboCop::Cop::VisibilityHelp
+ include ::RuboCop::Cop::DefNode
+ extend ::RuboCop::Cop::AutoCorrector
+
+ def action_declarations(param0, param1); end
+ def on_class(node); end
+
+ private
+
+ def actions; end
+ def expected_order; end
+ def find_index(node); end
+ def register_offense(previous, current); end
+end
+
+RuboCop::Cop::Rails::ActionOrder::MSG = T.let(T.unsafe(nil), String)
+
class RuboCop::Cop::Rails::ActiveRecordAliases < ::RuboCop::Cop::Base
extend ::RuboCop::Cop::AutoCorrector
@@ -695,6 +713,10 @@ class RuboCop::Cop::Rails::EagerEvaluationLogMessage < ::RuboCop::Cop::Base
def replacement_range(node); end
def replacement_source(node, arguments); end
+
+ class << self
+ def autocorrect_incompatible_with; end
+ end
end
RuboCop::Cop::Rails::EagerEvaluationLogMessage::MSG = T.let(T.unsafe(nil), String)
@@ -1059,6 +1081,15 @@ end
RuboCop::Cop::Rails::I18nLocaleTexts::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Rails::I18nLocaleTexts::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
+class RuboCop::Cop::Rails::IgnoredColumnsAssignment < ::RuboCop::Cop::Base
+ extend ::RuboCop::Cop::AutoCorrector
+
+ def on_send(node); end
+end
+
+RuboCop::Cop::Rails::IgnoredColumnsAssignment::MSG = T.let(T.unsafe(nil), String)
+RuboCop::Cop::Rails::IgnoredColumnsAssignment::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
+
class RuboCop::Cop::Rails::IgnoredSkipActionFilterOption < ::RuboCop::Cop::Base
def filter_options(param0 = T.unsafe(nil)); end
def on_send(node); end
@@ -1325,8 +1356,11 @@ class RuboCop::Cop::Rails::Pluck < ::RuboCop::Cop::Base
private
- def message(value, node); end
+ def message(replacement, node); end
def offense_range(node); end
+ def register_offense(node, key); end
+ def use_block_argument_in_key?(block_argument, key); end
+ def use_one_block_argument?(argument); end
end
RuboCop::Cop::Rails::Pluck::MSG = T.let(T.unsafe(nil), String)
@@ -1398,11 +1432,13 @@ class RuboCop::Cop::Rails::Presence < ::RuboCop::Cop::Base
private
def build_source_for_or_method(other); end
+ def current(node); end
def ignore_if_node?(node); end
def ignore_other_node?(node); end
def message(node, receiver, other); end
+ def method_range(node); end
def register_offense(node, receiver, other); end
- def replacement(receiver, other); end
+ def replacement(receiver, other, left_sibling); end
end
RuboCop::Cop::Rails::Presence::MSG = T.let(T.unsafe(nil), String)
@@ -2236,6 +2272,18 @@ RuboCop::Cop::Rails::WhereNot::NOT_IN_ANONYMOUS_RE = T.let(T.unsafe(nil), Regexp
RuboCop::Cop::Rails::WhereNot::NOT_IN_NAMED_RE = T.let(T.unsafe(nil), Regexp)
RuboCop::Cop::Rails::WhereNot::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
+class RuboCop::Cop::Rails::WhereNotWithMultipleConditions < ::RuboCop::Cop::Base
+ def on_send(node); end
+ def where_not_call?(param0 = T.unsafe(nil)); end
+
+ private
+
+ def multiple_arguments_hash?(hash); end
+end
+
+RuboCop::Cop::Rails::WhereNotWithMultipleConditions::MSG = T.let(T.unsafe(nil), String)
+RuboCop::Cop::Rails::WhereNotWithMultipleConditions::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
+
module RuboCop::Cop::TargetRailsVersion
def minimum_target_rails_version(version); end
def support_target_rails_version?(version); end | true |
Other | Homebrew | brew | e77dafd413a09452588952ae5f0fa0756485d757.json | Update RBI files for rubocop-rails.
Autogenerated by the [vendor-gems](https://github.com/Homebrew/brew/blob/HEAD/.github/workflows/vendor-gemss.yml) workflow. | Library/Homebrew/sorbet/rbi/gems/zeitwerk@2.6.4.rbi | @@ -70,22 +70,28 @@ class Zeitwerk::Inflector
def overrides; end
end
+module Zeitwerk::Internal
+ def internal(method_name); end
+end
+
class Zeitwerk::Loader
include ::Zeitwerk::RealModName
include ::Zeitwerk::Loader::Callbacks
include ::Zeitwerk::Loader::Helpers
include ::Zeitwerk::Loader::Config
+ include ::Zeitwerk::Loader::EagerLoad
def initialize; end
def autoloaded_dirs; end
def autoloads; end
- def eager_load(force: T.unsafe(nil)); end
- def lazy_subdirs; end
def mutex; end
def mutex2; end
+ def namespace_dirs; end
def reload; end
def setup; end
+ def shadowed_file?(file); end
+ def shadowed_files; end
def to_unload; end
def unload; end
def unloadable_cpath?(cpath); end
@@ -111,6 +117,7 @@ class Zeitwerk::Loader
def default_logger; end
def default_logger=(_arg0); end
def eager_load_all; end
+ def eager_load_namespace(mod); end
def for_gem(warn_on_extra_files: T.unsafe(nil)); end
end
end
@@ -128,46 +135,62 @@ module Zeitwerk::Loader::Callbacks
end
module Zeitwerk::Loader::Config
+ extend ::Zeitwerk::Internal
+
def initialize; end
+ def __ignores?(abspath); end
+ def __roots; end
def collapse(*glob_patterns); end
- def collapse_dirs; end
- def collapse_glob_patterns; end
def dirs(namespaces: T.unsafe(nil)); end
def do_not_eager_load(*paths); end
- def eager_load_exclusions; end
def enable_reloading; end
def ignore(*glob_patterns); end
- def ignored_glob_patterns; end
- def ignored_paths; end
- def ignores?(abspath); end
def inflector; end
def inflector=(_arg0); end
def log!; end
def logger; end
def logger=(_arg0); end
def on_load(cpath = T.unsafe(nil), &block); end
- def on_load_callbacks; end
def on_setup(&block); end
- def on_setup_callbacks; end
def on_unload(cpath = T.unsafe(nil), &block); end
- def on_unload_callbacks; end
def push_dir(path, namespace: T.unsafe(nil)); end
def reloading_enabled?; end
- def root_dirs; end
def tag; end
def tag=(tag); end
private
- def actual_root_dirs; end
+ def actual_roots; end
def collapse?(dir); end
+ def collapse_dirs; end
+ def collapse_glob_patterns; end
+ def eager_load_exclusions; end
def excluded_from_eager_load?(abspath); end
def expand_glob_patterns(glob_patterns); end
def expand_paths(paths); end
+ def ignored_glob_patterns; end
+ def ignored_paths; end
+ def ignores?(abspath); end
+ def on_load_callbacks; end
+ def on_setup_callbacks; end
+ def on_unload_callbacks; end
def recompute_collapse_dirs; end
def recompute_ignored_paths; end
def root_dir?(dir); end
+ def roots; end
+end
+
+module Zeitwerk::Loader::EagerLoad
+ def eager_load(force: T.unsafe(nil)); end
+ def eager_load_dir(path); end
+ def eager_load_namespace(mod); end
+ def load_file(path); end
+
+ private
+
+ def actual_eager_load_dir(dir, namespace, force: T.unsafe(nil)); end
+ def eager_load_child_namespace(child, child_name, root_dir, root_namespace); end
end
module Zeitwerk::Loader::Helpers
@@ -183,6 +206,7 @@ module Zeitwerk::Loader::Helpers
def ls(dir); end
def ruby?(path); end
def strict_autoload_path(parent, cname); end
+ def walk_up(abspath); end
end
Zeitwerk::Loader::MUTEX = T.let(T.unsafe(nil), Thread::Mutex) | true |
Other | Homebrew | brew | a4c9dd11b2abaf3d2959ad893070ac78d57867e6.json | Update RBI files for rdiscount.
Autogenerated by the [vendor-gems](https://github.com/Homebrew/brew/blob/HEAD/.github/workflows/vendor-gemss.yml) workflow. | Library/Homebrew/sorbet/rbi/gems/rdiscount@2.2.7.rbi | @@ -11,6 +11,8 @@ class RDiscount
def autolink; end
def autolink=(_arg0); end
+ def explicitlist; end
+ def explicitlist=(_arg0); end
def filter_html; end
def filter_html=(_arg0); end
def filter_styles; end
@@ -21,6 +23,10 @@ class RDiscount
def footnotes=(_arg0); end
def generate_toc; end
def generate_toc=(_arg0); end
+ def latex; end
+ def latex=(_arg0); end
+ def md1compat; end
+ def md1compat=(_arg0); end
def no_image; end
def no_image=(_arg0); end
def no_links; end | false |
Other | Homebrew | brew | 70588be10611eac7021ce4c6ae84aac138a50179.json | Update RBI files for rubocop-rspec.
Autogenerated by the [vendor-gems](https://github.com/Homebrew/brew/blob/HEAD/.github/workflows/vendor-gemss.yml) workflow. | Library/Homebrew/sorbet/rbi/gems/rubocop-rspec@2.15.0.rbi | @@ -172,6 +172,47 @@ end
RuboCop::Cop::RSpec::Capybara::FeatureMethods::MAP = T.let(T.unsafe(nil), Hash)
RuboCop::Cop::RSpec::Capybara::FeatureMethods::MSG = T.let(T.unsafe(nil), String)
+class RuboCop::Cop::RSpec::Capybara::NegationMatcher < ::RuboCop::Cop::RSpec::Base
+ include ::RuboCop::Cop::ConfigurableEnforcedStyle
+ extend ::RuboCop::Cop::AutoCorrector
+
+ def have_no?(param0 = T.unsafe(nil)); end
+ def not_to?(param0 = T.unsafe(nil)); end
+ def on_send(node); end
+
+ private
+
+ def message(matcher); end
+ def offense?(node); end
+ def offense_range(node); end
+ def replaced_matcher(matcher); end
+ def replaced_runner; end
+end
+
+RuboCop::Cop::RSpec::Capybara::NegationMatcher::CAPYBARA_MATCHERS = T.let(T.unsafe(nil), Array)
+RuboCop::Cop::RSpec::Capybara::NegationMatcher::MSG = T.let(T.unsafe(nil), String)
+RuboCop::Cop::RSpec::Capybara::NegationMatcher::NEGATIVE_MATCHERS = T.let(T.unsafe(nil), Set)
+RuboCop::Cop::RSpec::Capybara::NegationMatcher::POSITIVE_MATCHERS = T.let(T.unsafe(nil), Set)
+RuboCop::Cop::RSpec::Capybara::NegationMatcher::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Set)
+
+class RuboCop::Cop::RSpec::Capybara::SpecificActions < ::RuboCop::Cop::RSpec::Base
+ def click_on_selector(param0 = T.unsafe(nil)); end
+ def on_send(node); end
+
+ private
+
+ def good_action(action); end
+ def last_selector(arg); end
+ def message(action, selector); end
+ def offense_range(node, receiver); end
+ def specific_action(selector); end
+ def supported_selector?(selector); end
+end
+
+RuboCop::Cop::RSpec::Capybara::SpecificActions::MSG = T.let(T.unsafe(nil), String)
+RuboCop::Cop::RSpec::Capybara::SpecificActions::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
+RuboCop::Cop::RSpec::Capybara::SpecificActions::SPECIFIC_ACTION = T.let(T.unsafe(nil), Hash)
+
class RuboCop::Cop::RSpec::Capybara::SpecificFinders < ::RuboCop::Cop::RSpec::Base
include ::RuboCop::Cop::RangeHelp
extend ::RuboCop::Cop::AutoCorrector
@@ -195,28 +236,21 @@ RuboCop::Cop::RSpec::Capybara::SpecificFinders::MSG = T.let(T.unsafe(nil), Strin
RuboCop::Cop::RSpec::Capybara::SpecificFinders::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
class RuboCop::Cop::RSpec::Capybara::SpecificMatcher < ::RuboCop::Cop::RSpec::Base
+ include ::RuboCop::Cop::RSpec::CapybaraHelp
+
def first_argument(param0 = T.unsafe(nil)); end
def on_send(node); end
- def option?(param0, param1); end
private
def good_matcher(node, matcher); end
def message(node, matcher); end
- def replaceable_matcher?(node, matcher, attrs); end
- def replaceable_pseudo_class?(pseudo_class, arg); end
- def replaceable_pseudo_class_not?(arg); end
- def replaceable_to_have_link?(node, attrs); end
def specific_matcher(arg); end
- def specific_matcher_option?(node, arg, matcher); end
- def specific_matcher_pseudo_classes?(arg); end
end
RuboCop::Cop::RSpec::Capybara::SpecificMatcher::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::RSpec::Capybara::SpecificMatcher::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
RuboCop::Cop::RSpec::Capybara::SpecificMatcher::SPECIFIC_MATCHER = T.let(T.unsafe(nil), Hash)
-RuboCop::Cop::RSpec::Capybara::SpecificMatcher::SPECIFIC_MATCHER_OPTIONS = T.let(T.unsafe(nil), Hash)
-RuboCop::Cop::RSpec::Capybara::SpecificMatcher::SPECIFIC_MATCHER_PSEUDO_CLASSES = T.let(T.unsafe(nil), Array)
class RuboCop::Cop::RSpec::Capybara::VisibilityMatcher < ::RuboCop::Cop::RSpec::Base
def on_send(node); end
@@ -233,6 +267,28 @@ RuboCop::Cop::RSpec::Capybara::VisibilityMatcher::MSG_FALSE = T.let(T.unsafe(nil
RuboCop::Cop::RSpec::Capybara::VisibilityMatcher::MSG_TRUE = T.let(T.unsafe(nil), String)
RuboCop::Cop::RSpec::Capybara::VisibilityMatcher::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
+module RuboCop::Cop::RSpec::CapybaraHelp
+ private
+
+ def include_option?(node, option); end
+ def replaceable_element?(node, element, attrs); end
+ def replaceable_pseudo_class?(pseudo_class, locator); end
+ def replaceable_pseudo_class_not?(locator); end
+ def replaceable_to_link?(node, attrs); end
+ def specific_option?(node, locator, element); end
+ def specific_pseudo_classes?(locator); end
+
+ class << self
+ def include_option?(node, option); end
+ def replaceable_element?(node, element, attrs); end
+ def replaceable_pseudo_class?(pseudo_class, locator); end
+ def replaceable_pseudo_class_not?(locator); end
+ def replaceable_to_link?(node, attrs); end
+ def specific_option?(node, locator, element); end
+ def specific_pseudo_classes?(locator); end
+ end
+end
+
class RuboCop::Cop::RSpec::ChangeByZero < ::RuboCop::Cop::RSpec::Base
extend ::RuboCop::Cop::AutoCorrector
@@ -328,6 +384,8 @@ module RuboCop::Cop::RSpec::CssSelector
def multiple_selectors?(selector); end
def normalize_value(value); end
def pseudo_classes(selector); end
+ def specific_options?(element, attribute); end
+ def specific_pesudo_classes?(pseudo_class); end
class << self
def attribute?(selector); end
@@ -337,10 +395,14 @@ module RuboCop::Cop::RSpec::CssSelector
def multiple_selectors?(selector); end
def normalize_value(value); end
def pseudo_classes(selector); end
+ def specific_options?(element, attribute); end
+ def specific_pesudo_classes?(pseudo_class); end
end
end
RuboCop::Cop::RSpec::CssSelector::COMMON_OPTIONS = T.let(T.unsafe(nil), Array)
+RuboCop::Cop::RSpec::CssSelector::SPECIFIC_OPTIONS = T.let(T.unsafe(nil), Hash)
+RuboCop::Cop::RSpec::CssSelector::SPECIFIC_PSEUDO_CLASSES = T.let(T.unsafe(nil), Array)
class RuboCop::Cop::RSpec::DescribeClass < ::RuboCop::Cop::RSpec::Base
include ::RuboCop::Cop::RSpec::TopLevelGroup
@@ -568,11 +630,15 @@ class RuboCop::Cop::RSpec::ExampleWording < ::RuboCop::Cop::RSpec::Base
def custom_transform; end
def docstring(node); end
def ignored_words; end
+ def insufficient_docstring?(description_node); end
+ def insufficient_examples; end
+ def preprocess(message); end
def replacement_text(node); end
def text(node); end
end
RuboCop::Cop::RSpec::ExampleWording::IT_PREFIX = T.let(T.unsafe(nil), Regexp)
+RuboCop::Cop::RSpec::ExampleWording::MSG_INSUFFICIENT_DESCRIPTION = T.let(T.unsafe(nil), String)
RuboCop::Cop::RSpec::ExampleWording::MSG_IT = T.let(T.unsafe(nil), String)
RuboCop::Cop::RSpec::ExampleWording::MSG_SHOULD = T.let(T.unsafe(nil), String)
RuboCop::Cop::RSpec::ExampleWording::SHOULD_PREFIX = T.let(T.unsafe(nil), Regexp)
@@ -696,6 +762,31 @@ end
RuboCop::Cop::RSpec::FactoryBot::AttributeDefinedStatically::MSG = T.let(T.unsafe(nil), String)
+class RuboCop::Cop::RSpec::FactoryBot::ConsistentParenthesesStyle < ::RuboCop::Cop::RSpec::Base
+ include ::RuboCop::Cop::ConfigurableEnforcedStyle
+ include ::RuboCop::RSpec::FactoryBot::Language
+ extend ::RuboCop::Cop::AutoCorrector
+
+ def ambiguous_without_parentheses?(node); end
+ def factory_call(param0 = T.unsafe(nil)); end
+ def on_send(node); end
+ def process_with_parentheses(node); end
+ def process_without_parentheses(node); end
+
+ private
+
+ def remove_parentheses(corrector, node); end
+
+ class << self
+ def autocorrect_incompatible_with; end
+ end
+end
+
+RuboCop::Cop::RSpec::FactoryBot::ConsistentParenthesesStyle::FACTORY_CALLS = T.let(T.unsafe(nil), Set)
+RuboCop::Cop::RSpec::FactoryBot::ConsistentParenthesesStyle::MSG_OMIT_PARENS = T.let(T.unsafe(nil), String)
+RuboCop::Cop::RSpec::FactoryBot::ConsistentParenthesesStyle::MSG_REQUIRE_PARENS = T.let(T.unsafe(nil), String)
+RuboCop::Cop::RSpec::FactoryBot::ConsistentParenthesesStyle::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Set)
+
class RuboCop::Cop::RSpec::FactoryBot::CreateList < ::RuboCop::Cop::RSpec::Base
include ::RuboCop::Cop::ConfigurableEnforcedStyle
include ::RuboCop::RSpec::FactoryBot::Language
@@ -803,14 +894,16 @@ class RuboCop::Cop::RSpec::FilePath < ::RuboCop::Cop::RSpec::Base
def camel_to_snake_case(string); end
def custom_transform; end
def ensure_correct_file_path(send_node, example_group, arguments); end
+ def expanded_file_path; end
def expected_path(constant); end
def filename_ends_with?(pattern); end
def ignore_methods?; end
def name_pattern(method_name); end
- def pattern_for(example_group, method_name); end
+ def pattern_for(example_group, arguments); end
def pattern_for_spec_suffix_only; end
def relevant_rubocop_rspec_file?(_file); end
def routing_spec?(args); end
+ def routing_spec_path?; end
def spec_suffix_only?; end
end
@@ -922,17 +1015,26 @@ class RuboCop::Cop::RSpec::ImplicitSubject < ::RuboCop::Cop::RSpec::Base
include ::RuboCop::Cop::ConfigurableEnforcedStyle
extend ::RuboCop::Cop::AutoCorrector
+ def explicit_unnamed_subject?(param0 = T.unsafe(nil)); end
def implicit_subject?(param0 = T.unsafe(nil)); end
def on_send(node); end
private
- def allowed_by_style?(example); end
def autocorrect(corrector, node); end
- def valid_usage?(node); end
+ def example_of(node); end
+ def implicit_subject_in_non_its?(node); end
+ def implicit_subject_in_non_its_and_non_single_line?(node); end
+ def implicit_subject_in_non_its_and_non_single_statement?(node); end
+ def invalid?(node); end
+ def its?(node); end
+ def message(_node); end
+ def single_line?(node); end
+ def single_statement?(node); end
end
-RuboCop::Cop::RSpec::ImplicitSubject::MSG = T.let(T.unsafe(nil), String)
+RuboCop::Cop::RSpec::ImplicitSubject::MSG_REQUIRE_EXPLICIT = T.let(T.unsafe(nil), String)
+RuboCop::Cop::RSpec::ImplicitSubject::MSG_REQUIRE_IMPLICIT = T.let(T.unsafe(nil), String)
RuboCop::Cop::RSpec::ImplicitSubject::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
module RuboCop::Cop::RSpec::InflectedHelper
@@ -1061,12 +1163,14 @@ class RuboCop::Cop::RSpec::LetBeforeExamples < ::RuboCop::Cop::RSpec::Base
extend ::RuboCop::Cop::AutoCorrector
def example_or_group?(param0 = T.unsafe(nil)); end
+ def include_examples?(param0 = T.unsafe(nil)); end
def on_block(node); end
private
def autocorrect(corrector, node, first_example); end
def check_let_declarations(node); end
+ def example_group_with_include_examples?(body); end
def find_first_example(node); end
def multiline_block?(block); end
end
@@ -1199,11 +1303,23 @@ end
RuboCop::Cop::RSpec::MultipleSubjects::MSG = T.let(T.unsafe(nil), String)
class RuboCop::Cop::RSpec::NamedSubject < ::RuboCop::Cop::RSpec::Base
+ include ::RuboCop::Cop::ConfigurableEnforcedStyle
+
def example_or_hook_block?(param0 = T.unsafe(nil)); end
- def ignored_shared_example?(node); end
def on_block(node); end
def shared_example?(param0 = T.unsafe(nil)); end
def subject_usage(param0); end
+
+ private
+
+ def allow_explicit_subject?(node); end
+ def always?; end
+ def check_explicit_subject(node); end
+ def find_subject(block_node); end
+ def ignored_shared_example?(node); end
+ def named_only?(node); end
+ def nearest_subject(node); end
+ def subject_definition_is_named?(node); end
end
RuboCop::Cop::RSpec::NamedSubject::MSG = T.let(T.unsafe(nil), String)
@@ -1235,8 +1351,11 @@ RuboCop::Cop::RSpec::NestedGroups::DEPRECATION_WARNING = T.let(T.unsafe(nil), St
RuboCop::Cop::RSpec::NestedGroups::MSG = T.let(T.unsafe(nil), String)
class RuboCop::Cop::RSpec::NoExpectationExample < ::RuboCop::Cop::RSpec::Base
- def including_any_expectation?(param0); end
- def including_any_skip_example?(param0); end
+ include ::RuboCop::Cop::AllowedPattern
+ include ::RuboCop::Cop::RSpec::SkipOrPending
+
+ def includes_expectation?(param0); end
+ def includes_skip_example?(param0); end
def on_block(node); end
def on_numblock(node); end
def regular_or_focused_example?(param0 = T.unsafe(nil)); end
@@ -1273,11 +1392,11 @@ end
RuboCop::Cop::RSpec::OverwritingSetup::MSG = T.let(T.unsafe(nil), String)
class RuboCop::Cop::RSpec::Pending < ::RuboCop::Cop::RSpec::Base
+ include ::RuboCop::Cop::RSpec::SkipOrPending
+
def on_send(node); end
def pending_block?(param0 = T.unsafe(nil)); end
- def skip_or_pending?(param0 = T.unsafe(nil)); end
def skippable?(param0 = T.unsafe(nil)); end
- def skipped_in_metadata?(param0 = T.unsafe(nil)); end
private
@@ -1369,6 +1488,26 @@ end
RuboCop::Cop::RSpec::Rails::HttpStatus::SymbolicStyleChecker::MSG = T.let(T.unsafe(nil), String)
+class RuboCop::Cop::RSpec::Rails::InferredSpecType < ::RuboCop::Cop::RSpec::Base
+ extend ::RuboCop::Cop::AutoCorrector
+
+ def describe_with_type(param0 = T.unsafe(nil)); end
+ def on_block(node); end
+ def on_numblock(node); end
+
+ private
+
+ def autocorrect(corrector, node); end
+ def detect_removable_node(node); end
+ def file_path; end
+ def inferences; end
+ def inferred_type?(node); end
+ def inferred_type_from_file_path; end
+ def remove_range(node); end
+end
+
+RuboCop::Cop::RSpec::Rails::InferredSpecType::MSG = T.let(T.unsafe(nil), String)
+
class RuboCop::Cop::RSpec::ReceiveCounts < ::RuboCop::Cop::RSpec::Base
extend ::RuboCop::Cop::AutoCorrector
@@ -1407,7 +1546,9 @@ class RuboCop::Cop::RSpec::RepeatedDescription < ::RuboCop::Cop::RSpec::Base
private
def example_signature(example); end
+ def its_signature(example); end
def repeated_descriptions(node); end
+ def repeated_its(node); end
end
RuboCop::Cop::RSpec::RepeatedDescription::MSG = T.let(T.unsafe(nil), String)
@@ -1606,6 +1747,35 @@ end
RuboCop::Cop::RSpec::SingleArgumentMessageChain::MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::RSpec::SingleArgumentMessageChain::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
+module RuboCop::Cop::RSpec::SkipOrPending
+ extend ::RuboCop::AST::NodePattern::Macros
+
+ def skip_or_pending?(param0 = T.unsafe(nil)); end
+ def skipped_in_metadata?(param0 = T.unsafe(nil)); end
+end
+
+class RuboCop::Cop::RSpec::SortMetadata < ::RuboCop::Cop::RSpec::Base
+ include ::RuboCop::Cop::RangeHelp
+ extend ::RuboCop::Cop::AutoCorrector
+
+ def metadata_in_block(param0, param1); end
+ def on_block(node); end
+ def on_numblock(node); end
+ def rspec_configure(param0 = T.unsafe(nil)); end
+ def rspec_metadata(param0 = T.unsafe(nil)); end
+
+ private
+
+ def crime_scene(symbols, pairs); end
+ def investigate(symbols, pairs); end
+ def replacement(symbols, pairs); end
+ def sort_pairs(pairs); end
+ def sort_symbols(symbols); end
+ def sorted?(symbols, pairs); end
+end
+
+RuboCop::Cop::RSpec::SortMetadata::MSG = T.let(T.unsafe(nil), String)
+
class RuboCop::Cop::RSpec::StubbedMock < ::RuboCop::Cop::RSpec::Base
def configured_response?(param0 = T.unsafe(nil)); end
def expectation(param0 = T.unsafe(nil)); end
@@ -1889,6 +2059,7 @@ module RuboCop::RSpec::FactoryBot::Language
def factory_bot?(param0 = T.unsafe(nil)); end
end
+RuboCop::RSpec::FactoryBot::Language::METHODS = T.let(T.unsafe(nil), Set)
RuboCop::RSpec::FactoryBot::RESERVED_METHODS = T.let(T.unsafe(nil), Array)
RuboCop::RSpec::FactoryBot::UNPROXIED_METHODS = T.let(T.unsafe(nil), Array)
@@ -1979,6 +2150,8 @@ module RuboCop::RSpec::Language::HookScopes
end
end
+RuboCop::RSpec::Language::HookScopes::ALL = T.let(T.unsafe(nil), Array)
+
module RuboCop::RSpec::Language::Hooks
class << self
def all(element); end
@@ -2005,6 +2178,8 @@ module RuboCop::RSpec::Language::Runners
end
end
+RuboCop::RSpec::Language::Runners::ALL = T.let(T.unsafe(nil), Array)
+
module RuboCop::RSpec::Language::SharedGroups
class << self
def all(element); end | false |
Other | Homebrew | brew | 6a428a8791e739aab31c64b65de8c54384b69e40.json | Update RBI files for rspec-github.
Autogenerated by the [vendor-gems](https://github.com/Homebrew/brew/blob/HEAD/.github/workflows/vendor-gemss.yml) workflow. | Library/Homebrew/sorbet/rbi/gems/rspec-github@2.4.0.rbi | @@ -39,6 +39,7 @@ module RSpec::Github; end
class RSpec::Github::Formatter < ::RSpec::Core::Formatters::BaseFormatter
def example_failed(failure); end
def example_pending(pending); end
+ def seed(notification); end
end
class RSpec::Github::NotificationDecorator | false |
Other | Homebrew | brew | ae93123fe495755819ba6cd159c34c34b64ee609.json | Update RBI files for rspec-mocks.
Autogenerated by the [vendor-gems](https://github.com/Homebrew/brew/blob/HEAD/.github/workflows/vendor-gemss.yml) workflow. | Library/Homebrew/sorbet/rbi/gems/rspec-mocks@3.11.2.rbi | @@ -431,6 +431,7 @@ class RSpec::Mocks::ClassNewMethodReference < ::RSpec::Mocks::ObjectMethodRefere
class << self
def applies_to?(method_name); end
+ def uses_class_new?(klass); end
end
end
| false |
Other | Homebrew | brew | c32a4312cf04204c97dce4f22eb02b00736e950b.json | Update RBI files for rubocop-ast.
Autogenerated by the [vendor-gems](https://github.com/Homebrew/brew/blob/HEAD/.github/workflows/vendor-gemss.yml) workflow. | Library/Homebrew/sorbet/rbi/gems/rubocop-ast@1.23.0.rbi | @@ -1442,6 +1442,7 @@ RuboCop::AST::NodePattern::Sets::SET_INSTANCE_EXEC_CLASS_EXEC_MODULE_EXEC = T.le
RuboCop::AST::NodePattern::Sets::SET_IO_FILE = T.let(T.unsafe(nil), Set)
RuboCop::AST::NodePattern::Sets::SET_IS_EXPECTED_SHOULD_SHOULD_NOT = T.let(T.unsafe(nil), Set)
RuboCop::AST::NodePattern::Sets::SET_KEYS_VALUES = T.let(T.unsafe(nil), Set)
+RuboCop::AST::NodePattern::Sets::SET_KEYS_VALUES_TO_H_TO_XML = T.let(T.unsafe(nil), Set)
RuboCop::AST::NodePattern::Sets::SET_KEY_HAS_KEY_FETCH_ETC = T.let(T.unsafe(nil), Set)
RuboCop::AST::NodePattern::Sets::SET_LAST_FIRST = T.let(T.unsafe(nil), Set)
RuboCop::AST::NodePattern::Sets::SET_LENGTH_SIZE = T.let(T.unsafe(nil), Set)
@@ -1456,6 +1457,7 @@ RuboCop::AST::NodePattern::Sets::SET_NEW_OPEN = T.let(T.unsafe(nil), Set)
RuboCop::AST::NodePattern::Sets::SET_NIL_ = T.let(T.unsafe(nil), Set)
RuboCop::AST::NodePattern::Sets::SET_NOTICE_ALERT = T.let(T.unsafe(nil), Set)
RuboCop::AST::NodePattern::Sets::SET_ONLY_EXCEPT = T.let(T.unsafe(nil), Set)
+RuboCop::AST::NodePattern::Sets::SET_PENDING_SKIP = T.let(T.unsafe(nil), Set)
RuboCop::AST::NodePattern::Sets::SET_PIPELINE_PIPELINE_R_PIPELINE_RW_ETC = T.let(T.unsafe(nil), Set)
RuboCop::AST::NodePattern::Sets::SET_PRIVATE_PROTECTED = T.let(T.unsafe(nil), Set)
RuboCop::AST::NodePattern::Sets::SET_PRIVATE_PROTECTED_PUBLIC = T.let(T.unsafe(nil), Set)
@@ -1483,7 +1485,6 @@ RuboCop::AST::NodePattern::Sets::SET_SELECT_SELECT = T.let(T.unsafe(nil), Set)
RuboCop::AST::NodePattern::Sets::SET_SEND_PUBLIC_SEND___SEND__ = T.let(T.unsafe(nil), Set)
RuboCop::AST::NodePattern::Sets::SET_SHOULD_SHOULD_NOT = T.let(T.unsafe(nil), Set)
RuboCop::AST::NodePattern::Sets::SET_SKIP_AFTER_ACTION_SKIP_AROUND_ACTION_SKIP_BEFORE_ACTION_SKIP_ACTION_CALLBACK = T.let(T.unsafe(nil), Set)
-RuboCop::AST::NodePattern::Sets::SET_SKIP_PENDING = T.let(T.unsafe(nil), Set)
RuboCop::AST::NodePattern::Sets::SET_SORT_BY_SORT = T.let(T.unsafe(nil), Set)
RuboCop::AST::NodePattern::Sets::SET_SORT_MIN_MAX = T.let(T.unsafe(nil), Set)
RuboCop::AST::NodePattern::Sets::SET_SPAWN_SYSTEM = T.let(T.unsafe(nil), Set)
@@ -1493,6 +1494,7 @@ RuboCop::AST::NodePattern::Sets::SET_START_WITH_STARTS_WITH_END_WITH_ENDS_WITH =
RuboCop::AST::NodePattern::Sets::SET_STRUCT_CLASS = T.let(T.unsafe(nil), Set)
RuboCop::AST::NodePattern::Sets::SET_SUCC_PRED_NEXT = T.let(T.unsafe(nil), Set)
RuboCop::AST::NodePattern::Sets::SET_TEMPFILE_STRINGIO = T.let(T.unsafe(nil), Set)
+RuboCop::AST::NodePattern::Sets::SET_TIME_DATETIME = T.let(T.unsafe(nil), Set)
RuboCop::AST::NodePattern::Sets::SET_TO_ENUM_ENUM_FOR = T.let(T.unsafe(nil), Set)
RuboCop::AST::NodePattern::Sets::SET_TO_H_TO_HASH = T.let(T.unsafe(nil), Set)
RuboCop::AST::NodePattern::Sets::SET_TO_I_TO_F_TO_C_TO_R = T.let(T.unsafe(nil), Set)
@@ -1749,6 +1751,7 @@ end
class RuboCop::AST::StrNode < ::RuboCop::AST::Node
include ::RuboCop::AST::BasicLiteralNode
+ def character_literal?; end
def heredoc?; end
end
@@ -1783,6 +1786,7 @@ class RuboCop::AST::Token
def left_parens?; end
def left_ref_bracket?; end
def line; end
+ def new_line?; end
def pos; end
def regexp_dots?; end
def rescue_modifier?; end | true |
Other | Homebrew | brew | c32a4312cf04204c97dce4f22eb02b00736e950b.json | Update RBI files for rubocop-ast.
Autogenerated by the [vendor-gems](https://github.com/Homebrew/brew/blob/HEAD/.github/workflows/vendor-gemss.yml) workflow. | Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi | @@ -6739,12 +6739,9 @@ module RuboCop::AST::NodePattern::Sets
SET_BUILD_RECOMMENDED_TEST_OPTIONAL = ::T.let(nil, ::T.untyped)
SET_DEPENDS_ON_USES_FROM_MACOS = ::T.let(nil, ::T.untyped)
SET_INCLUDE_WITH_WITHOUT = ::T.let(nil, ::T.untyped)
- SET_KEYS_VALUES_TO_H_TO_XML = ::T.let(nil, ::T.untyped)
SET_ON_INTEL_ON_ARM = ::T.let(nil, ::T.untyped)
SET_OR_NEWER_OR_OLDER = ::T.let(nil, ::T.untyped)
- SET_PENDING_SKIP = ::T.let(nil, ::T.untyped)
SET_SYSTEM_SHELL_OUTPUT_PIPE_OUTPUT = ::T.let(nil, ::T.untyped)
- SET_TIME_DATETIME = ::T.let(nil, ::T.untyped)
SET_WITH_WITHOUT = ::T.let(nil, ::T.untyped)
SET____ETC_4 = ::T.let(nil, ::T.untyped)
end | true |
Other | Homebrew | brew | 796bad98ff44634c4a462ac5ca5bd4d1f3f0ddd0.json | Allow gem installation on Rubies other than 2.6 | .gitignore | @@ -31,6 +31,7 @@
**/vendor/bundle/ruby/*/cache
**/vendor/bundle/ruby/*/extensions
**/vendor/bundle/ruby/*/gems/*/*
+**/vendor/bundle/ruby/*/plugins
**/vendor/bundle/ruby/*/specifications
# Ignore YARD files | true |
Other | Homebrew | brew | 796bad98ff44634c4a462ac5ca5bd4d1f3f0ddd0.json | Allow gem installation on Rubies other than 2.6 | Library/Homebrew/Gemfile | @@ -42,7 +42,6 @@ end
gem "activesupport"
gem "addressable"
gem "concurrent-ruby"
-gem "did_you_mean" # remove when HOMEBREW_REQUIRED_RUBY_VERSION >= 2.7
gem "mechanize"
gem "patchelf"
gem "plist"
@@ -52,3 +51,8 @@ gem "rubocop-rspec"
gem "rubocop-sorbet"
gem "ruby-macho"
gem "sorbet-runtime"
+
+# remove when HOMEBREW_REQUIRED_RUBY_VERSION >= 2.7
+install_if -> { RUBY_VERSION < "2.7" } do
+ gem "did_you_mean"
+end | true |
Other | Homebrew | brew | 796bad98ff44634c4a462ac5ca5bd4d1f3f0ddd0.json | Allow gem installation on Rubies other than 2.6 | Library/Homebrew/utils/gems.rb | @@ -64,7 +64,7 @@ def setup_gem_environment!(setup_path: true)
paths = ENV.fetch("PATH").split(":")
paths.unshift(ruby_bindir) unless paths.include?(ruby_bindir)
paths.unshift(Gem.bindir) unless paths.include?(Gem.bindir)
- paths.unshift(HOMEBREW_SHIMS_PATH/"ruby") unless paths.include?(HOMEBREW_SHIMS_PATH/"ruby")
+ paths.unshift(HOMEBREW_LIBRARY_PATH/"shims/ruby") unless paths.include?(HOMEBREW_LIBRARY_PATH/"shims/ruby")
ENV["PATH"] = paths.compact.join(":")
# Set envs so the above binaries can be invoked.
@@ -80,8 +80,9 @@ def install_gem!(name, version: nil, setup_gem_environment: true)
if specs.empty?
ohai_if_defined "Installing '#{name}' gem"
- # document: [] , is equivalent to --no-document
- specs = Gem.install name, version, document: []
+ # `document: []` is equivalent to --no-document
+ # `build_args: []` stops ARGV being used as a default
+ specs = Gem.install name, version, document: [], build_args: []
end
specs += specs.flat_map(&:runtime_dependencies)
@@ -115,10 +116,6 @@ def find_in_path(executable)
end
def install_bundler!
- if Gem.ruby_version >= Gem::Version.new("2.7")
- raise "Installing and using Bundler is currently only supported on Ruby 2.6."
- end
-
setup_gem_environment!
install_gem_setup_path!(
"bundler", | true |
Other | Homebrew | brew | 6ede5d2dd5cf378729669dc02e8b324b86986dde.json | rubocops: handle empty formula body in various cops | Library/Homebrew/rubocops/class.rb | @@ -75,9 +75,10 @@ module FormulaAuditStrict
#
# @api private
class TestPresent < FormulaCop
- def audit_formula(_node, _class_node, _parent_class_node, body_node)
+ def audit_formula(_node, class_node, _parent_class_node, body_node)
return if find_block(body_node, :test)
+ offending_node(class_node) if body_node.nil?
problem "A `test do` test block should be added"
end
end | true |
Other | Homebrew | brew | 6ede5d2dd5cf378729669dc02e8b324b86986dde.json | rubocops: handle empty formula body in various cops | Library/Homebrew/rubocops/components_order.rb | @@ -15,6 +15,8 @@ class ComponentsOrder < FormulaCop
extend AutoCorrector
def audit_formula(_node, _class_node, _parent_class_node, body_node)
+ return if body_node.nil?
+
@present_components, @offensive_nodes = check_order(FORMULA_COMPONENT_PRECEDENCE_LIST, body_node)
component_problem @offensive_nodes[0], @offensive_nodes[1] if @offensive_nodes | true |
Other | Homebrew | brew | 6ede5d2dd5cf378729669dc02e8b324b86986dde.json | rubocops: handle empty formula body in various cops | Library/Homebrew/rubocops/components_redundancy.rb | @@ -20,6 +20,8 @@ class ComponentsRedundancy < FormulaCop
STABLE_MSG = "`stable do` should not be present without a `head` spec"
def audit_formula(_node, _class_node, _parent_class_node, body_node)
+ return if body_node.nil?
+
urls = find_method_calls_by_name(body_node, :url)
urls.each do |url| | true |
Other | Homebrew | brew | 6ede5d2dd5cf378729669dc02e8b324b86986dde.json | rubocops: handle empty formula body in various cops | Library/Homebrew/rubocops/conflicts.rb | @@ -15,6 +15,8 @@ class Conflicts < FormulaCop
"Use `keg_only :versioned_formula` instead."
def audit_formula(_node, _class_node, _parent_class_node, body_node)
+ return if body_node.nil?
+
find_method_calls_by_name(body_node, :conflicts_with).each do |conflicts_with_call|
next unless parameters(conflicts_with_call).last.respond_to? :values
| true |
Other | Homebrew | brew | 6ede5d2dd5cf378729669dc02e8b324b86986dde.json | rubocops: handle empty formula body in various cops | Library/Homebrew/rubocops/extend/formula.rb | @@ -50,6 +50,8 @@ def audit_urls(urls, regex)
#
# @param dependency_name dependency's name
def depends_on?(dependency_name, *types)
+ return if @body.nil?
+
types = [:any] if types.empty?
dependency_nodes = find_every_method_call_by_name(@body, :depends_on)
idx = dependency_nodes.index do |n|
@@ -106,6 +108,8 @@ def depends_on_name_type?(node, name = nil, type = :required)
# Return all the caveats' string nodes in an array.
def caveats_strings
+ return [] if @body.nil?
+
find_strings(find_method_def(@body, :caveats))
end
| true |
Other | Homebrew | brew | 6ede5d2dd5cf378729669dc02e8b324b86986dde.json | rubocops: handle empty formula body in various cops | Library/Homebrew/rubocops/formula_desc.rb | @@ -14,9 +14,10 @@ class Desc < FormulaCop
include DescHelper
extend AutoCorrector
- def audit_formula(_node, _class_node, _parent_class_node, body_node)
+ def audit_formula(_node, class_node, _parent_class_node, body_node)
@name = @formula_name
desc_call = find_node_method_by_name(body_node, :desc)
+ offending_node(class_node) if body_node.nil?
audit_desc(:formula, @name, desc_call)
end
end | true |
Other | Homebrew | brew | 6ede5d2dd5cf378729669dc02e8b324b86986dde.json | rubocops: handle empty formula body in various cops | Library/Homebrew/rubocops/homepage.rb | @@ -10,10 +10,11 @@ module FormulaAudit
class Homepage < FormulaCop
extend AutoCorrector
- def audit_formula(_node, _class_node, _parent_class_node, body_node)
+ def audit_formula(_node, class_node, _parent_class_node, body_node)
homepage_node = find_node_method_by_name(body_node, :homepage)
if homepage_node.nil?
+ offending_node(class_node) if body_node.nil?
problem "Formula should have a homepage."
return
end | true |
Other | Homebrew | brew | 6ede5d2dd5cf378729669dc02e8b324b86986dde.json | rubocops: handle empty formula body in various cops | Library/Homebrew/rubocops/lines.rb | @@ -91,6 +91,8 @@ def audit_formula(_node, _class_node, _parent_class_node, _body_node)
# @api private
class AssertStatements < FormulaCop
def audit_formula(_node, _class_node, _parent_class_node, body_node)
+ return if body_node.nil?
+
find_every_method_call_by_name(body_node, :assert).each do |method|
if method_called_ever?(method, :include?) && !method_called_ever?(method, :!)
problem "Use `assert_match` instead of `assert ...include?`"
@@ -116,6 +118,8 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node)
# @api private
class OptionDeclarations < FormulaCop
def audit_formula(_node, _class_node, _parent_class_node, body_node)
+ return if body_node.nil?
+
problem "Use new-style option definitions" if find_method_def(body_node, :options)
if formula_tap == "homebrew-core"
@@ -201,6 +205,8 @@ class MpiCheck < FormulaCop
extend AutoCorrector
def audit_formula(_node, _class_node, _parent_class_node, body_node)
+ return if body_node.nil?
+
# Enforce use of OpenMPI for MPI dependency in core
return unless formula_tap == "homebrew-core"
@@ -219,6 +225,8 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node)
# @api private
class PyoxidizerCheck < FormulaCop
def audit_formula(_node, _class_node, _parent_class_node, body_node)
+ return if body_node.nil?
+
# Disallow use of PyOxidizer as a dependency in core
return unless formula_tap == "homebrew-core"
@@ -246,6 +254,8 @@ class SafePopenCommands < FormulaCop
extend AutoCorrector
def audit_formula(_node, _class_node, _parent_class_node, body_node)
+ return if body_node.nil?
+
test = find_block(body_node, :test)
[:popen_read, :popen_write].each do |unsafe_command|
@@ -275,6 +285,8 @@ class ShellVariables < FormulaCop
extend AutoCorrector
def audit_formula(_node, _class_node, _parent_class_node, body_node)
+ return if body_node.nil?
+
popen_commands = [
:popen,
:popen_read,
@@ -305,6 +317,8 @@ class LicenseArrays < FormulaCop
extend AutoCorrector
def audit_formula(_node, _class_node, _parent_class_node, body_node)
+ return if body_node.nil?
+
license_node = find_node_method_by_name(body_node, :license)
return unless license_node
@@ -322,6 +336,8 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node)
# @api private
class Licenses < FormulaCop
def audit_formula(_node, _class_node, _parent_class_node, body_node)
+ return if body_node.nil?
+
license_node = find_node_method_by_name(body_node, :license)
return unless license_node
return if license_node.source.include?("\n")
@@ -345,6 +361,8 @@ class PythonVersions < FormulaCop
extend AutoCorrector
def audit_formula(_node, _class_node, _parent_class_node, body_node)
+ return if body_node.nil?
+
python_formula_node = find_every_method_call_by_name(body_node, :depends_on).find do |dep|
string_content(parameters(dep).first).start_with? "python@"
end
@@ -565,6 +583,8 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node)
# @api private
class Miscellaneous < FormulaCop
def audit_formula(_node, _class_node, _parent_class_node, body_node)
+ return if body_node.nil?
+
# FileUtils is included in Formula
# encfs modifies a file with this name, so check for some leading characters
find_instance_method_call(body_node, "FileUtils", nil) do |method_node| | true |
Other | Homebrew | brew | 6ede5d2dd5cf378729669dc02e8b324b86986dde.json | rubocops: handle empty formula body in various cops | Library/Homebrew/rubocops/options.rb | @@ -15,6 +15,8 @@ class Options < FormulaCop
OPTION = "Formulae in homebrew/core should not use `option`."
def audit_formula(_node, _class_node, _parent_class_node, body_node)
+ return if body_node.nil?
+
option_call_nodes = find_every_method_call_by_name(body_node, :option)
option_call_nodes.each do |option_call|
option = parameters(option_call).first | true |
Other | Homebrew | brew | 6ede5d2dd5cf378729669dc02e8b324b86986dde.json | rubocops: handle empty formula body in various cops | Library/Homebrew/rubocops/patches.rb | @@ -16,6 +16,8 @@ class Patches < FormulaCop
def audit_formula(node, _class_node, _parent_class_node, body)
@full_source_content = source_buffer(node).source
+ return if body.nil?
+
external_patches = find_all_blocks(body, :patch)
external_patches.each do |patch_block|
url_node = find_every_method_call_by_name(patch_block, :url).first | true |
Other | Homebrew | brew | 6ede5d2dd5cf378729669dc02e8b324b86986dde.json | rubocops: handle empty formula body in various cops | Library/Homebrew/rubocops/text.rb | @@ -22,6 +22,8 @@ def audit_formula(node, _class_node, _parent_class_node, body_node)
end
end
+ return if body_node.nil?
+
if !find_node_method_by_name(body_node, :plist_options) &&
find_method_def(body_node, :plist)
problem "Please set plist_options when using a formula-defined plist."
@@ -106,6 +108,8 @@ module FormulaAuditStrict
# @api private
class Text < FormulaCop
def audit_formula(_node, _class_node, _parent_class_node, body_node)
+ return if body_node.nil?
+
find_method_with_args(body_node, :go_resource) do
problem "`go_resource`s are deprecated. Please ask upstream to implement Go vendoring"
end | true |
Other | Homebrew | brew | 6ede5d2dd5cf378729669dc02e8b324b86986dde.json | rubocops: handle empty formula body in various cops | Library/Homebrew/rubocops/urls.rb | @@ -11,6 +11,8 @@ module FormulaAudit
# @api private
class Urls < FormulaCop
def audit_formula(_node, _class_node, _parent_class_node, body_node)
+ return if body_node.nil?
+
urls = find_every_func_call_by_name(body_node, :url)
mirrors = find_every_func_call_by_name(body_node, :mirror)
@@ -262,6 +264,8 @@ class PyPiUrls < FormulaCop
extend T::Sig
def audit_formula(_node, _class_node, _parent_class_node, body_node)
+ return if body_node.nil?
+
urls = find_every_func_call_by_name(body_node, :url)
mirrors = find_every_func_call_by_name(body_node, :mirror)
urls += mirrors
@@ -292,6 +296,7 @@ def get_pypi_url(url)
# @api private
class GitUrls < FormulaCop
def audit_formula(_node, _class_node, _parent_class_node, body_node)
+ return if body_node.nil?
return unless formula_tap == "homebrew-core"
find_method_calls_by_name(body_node, :url).each do |url|
@@ -315,6 +320,7 @@ module FormulaAuditStrict
# @api private
class GitUrls < FormulaCop
def audit_formula(_node, _class_node, _parent_class_node, body_node)
+ return if body_node.nil?
return unless formula_tap == "homebrew-core"
find_method_calls_by_name(body_node, :url).each do |url| | true |
Other | Homebrew | brew | 6ede5d2dd5cf378729669dc02e8b324b86986dde.json | rubocops: handle empty formula body in various cops | Library/Homebrew/rubocops/uses_from_macos.rb | @@ -61,6 +61,8 @@ class ProvidedByMacos < FormulaCop
].freeze
def audit_formula(_node, _class_node, _parent_class_node, body_node)
+ return if body_node.nil?
+
find_method_with_args(body_node, :keg_only, :provided_by_macos) do
return if PROVIDED_BY_MACOS_FORMULAE.include? @formula_name
@@ -94,6 +96,8 @@ class UsesFromMacos < FormulaCop
].freeze
def audit_formula(_node, _class_node, _parent_class_node, body_node)
+ return if body_node.nil?
+
find_method_with_args(body_node, :uses_from_macos, /^"(.+)"/).each do |method|
dep = if parameters(method).first.instance_of?(RuboCop::AST::StrNode)
parameters(method).first | true |
Other | Homebrew | brew | 41c935bb761479a68387e5398731b4265e75df6d.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 | @@ -107,8 +107,20 @@ class BigDecimal
def to_digits(); end
end
+module BigDecimal::Deprecation
+ def new(*args, **kwargs); end
+end
+
+module BigDecimal::Deprecation
+end
+
class BigDecimal
- def self.new(*args, **kwargs); end
+ extend ::BigDecimal::Deprecation
+ def self.inherited(subclass); end
+
+ def self.interpret_loosely(arg); end
+
+ def self.new(*arg); end
end
class Binding
@@ -3295,6 +3307,7 @@ class Date
def plus_without_duration(arg); end
def to_default_s(); end
+ VERSION = ::T.let(nil, ::T.untyped)
end
class Date::Infinity | false |
Other | Homebrew | brew | 6f2f97b98f1069fa299386fca31502e1101dbf13.json | test/rubocops/formula_desc: Ensure autocorrect when `desc` ends in `.`
- This was another thing that I should have done in PR 3411 in 2017,
tested that the regex for autocorrecting `desc` stanzas ending in full
stops actually worked. At least I'm getting to it now. | Library/Homebrew/test/rubocops/formula_desc_spec.rb | @@ -118,12 +118,19 @@ class Foo < Formula
RUBY
end
- it "reports an offense when the description ends with a full stop" do
+ it "report and corrects an offense when the description ends with a full stop" do
expect_offense(<<~RUBY, "/homebrew-core/Formula/foo.rb")
class Foo < Formula
url 'https://brew.sh/foo-1.0.tgz'
desc 'Description with a full stop at the end.'
- ^ Description shouldn\'t end with a full stop.
+ ^ Description shouldn't end with a full stop.
+ end
+ RUBY
+
+ expect_correction(<<~RUBY)
+ class Foo < Formula
+ url 'https://brew.sh/foo-1.0.tgz'
+ desc 'Description with a full stop at the end'
end
RUBY
end | false |
Other | Homebrew | brew | 94c0d8917eb11f68313bb962b9a595c6bbbd4fd1.json | fix: allow sparkle without a macOS version | Library/Homebrew/cask/audit.rb | @@ -550,7 +550,7 @@ def check_livecheck_min_os
return unless cask.livecheckable?
return unless cask.livecheck.strategy == :sparkle
- out, _, status = curl_output(cask.livecheck.url)
+ out, _, status = curl_output("--fail", "--silent", "--location", cask.livecheck.url)
return unless status.success?
require "rexml/document"
@@ -563,14 +563,19 @@ def check_livecheck_min_os
return if xml.blank?
- item = xml.get_elements("//rss//channel//item").first
+ item = xml.elements["//rss//channel//item"]
return if item.blank?
- min_os = item.elements["sparkle:minimumSystemVersion"].text
+ min_os = item.elements["sparkle:minimumSystemVersion"]&.text
return if min_os.blank?
- min_os_string = OS::Mac::Version.new(min_os).strip_patch
- cask_min_os = cask.depends_on.macos.version
+ begin
+ min_os_string = OS::Mac::Version.new(min_os).strip_patch
+ rescue MacOSVersionError
+ return
+ end
+
+ cask_min_os = cask.depends_on.macos&.version
return if cask_min_os == min_os_string
| true |
Other | Homebrew | brew | 94c0d8917eb11f68313bb962b9a595c6bbbd4fd1.json | fix: allow sparkle without a macOS version | Library/Homebrew/cask/dsl/depends_on.rb | @@ -11,6 +11,7 @@ class DSL
#
# @api private
class DependsOn < SimpleDelegator
+ extend T::Sig
VALID_KEYS = Set.new([
:formula,
:cask,
@@ -49,6 +50,7 @@ def cask=(*args)
@cask.concat(args)
end
+ sig { params(args: String).returns(T.nilable(MacOSRequirement)) }
def macos=(*args)
raise "Only a single 'depends_on macos' is allowed." if defined?(@macos)
| true |
Other | Homebrew | brew | d8940d3caecb2c174542a74569360a0942f39f92.json | devcontainer/on-create-command: do more stuff.
- fix permissions
- install more gems/formulae
- remove system shellcheck that won't be used | .devcontainer/on-create-command.sh | @@ -1,10 +1,22 @@
#!/bin/bash
set -e
+# fix permissions so Homebrew and Bundler don't complain
+sudo chmod -R g-w,o-w /home/linuxbrew
+
+# install Homebrew's development gems
+brew install-bundler-gems
+
+# install Homebrew formulae we might need
+brew install shellcheck shfmt gh gnu-tar
+
+# cleanup any mess
+brew cleanup
+
+# install some useful development things
sudo apt-get update
sudo apt-get install -y \
-o Dpkg::Options::=--force-confdef \
-o Dpkg::Options::=--force-confnew \
zsh \
- shellcheck \
zsh-autosuggestions | false |
Other | Homebrew | brew | dd39b2be6449ecc83b92fbac9a8983afe330093b.json | Add VSCode devcontainers
Should be useful for getting a development environment setup quickly. | .devcontainer/devcontainer.json | @@ -0,0 +1,10 @@
+{
+ "name": "Homebrew/brew",
+ "image": "ghcr.io/homebrew/brew:latest",
+ "workspaceFolder": "/home/linuxbrew/.linuxbrew/Homebrew",
+ "workspaceMount": "source=${localWorkspaceFolder},target=/home/linuxbrew/.linuxbrew/Homebrew,type=bind,consistency=cached",
+ "onCreateCommand": ".devcontainer/on-create-command.sh",
+ "remoteEnv": {
+ "HOMEBREW_GITHUB_API_TOKEN": "${localEnv:GITHUB_TOKEN}"
+ }
+} | true |
Other | Homebrew | brew | dd39b2be6449ecc83b92fbac9a8983afe330093b.json | Add VSCode devcontainers
Should be useful for getting a development environment setup quickly. | .devcontainer/on-create-command.sh | @@ -0,0 +1,10 @@
+#!/bin/bash
+set -e
+
+sudo apt-get update
+sudo apt-get install -y \
+ -o Dpkg::Options::=--force-confdef \
+ -o Dpkg::Options::=--force-confnew \
+ zsh \
+ shellcheck \
+ zsh-autosuggestions | true |
Other | Homebrew | brew | dd39b2be6449ecc83b92fbac9a8983afe330093b.json | Add VSCode devcontainers
Should be useful for getting a development environment setup quickly. | .devcontainer/ubuntu18.04/devcontainer.json | @@ -0,0 +1,10 @@
+{
+ "name": "Homebrew/brew-ubuntu18.04",
+ "image": "ghcr.io/homebrew/ubuntu18.04:latest",
+ "workspaceFolder": "/home/linuxbrew/.linuxbrew/Homebrew",
+ "workspaceMount": "source=${localWorkspaceFolder},target=/home/linuxbrew/.linuxbrew/Homebrew,type=bind,consistency=cached",
+ "onCreateCommand": ".devcontainer/on-create-command.sh",
+ "remoteEnv": {
+ "HOMEBREW_GITHUB_API_TOKEN": "${localEnv:GITHUB_TOKEN}"
+ }
+} | true |
Other | Homebrew | brew | dd39b2be6449ecc83b92fbac9a8983afe330093b.json | Add VSCode devcontainers
Should be useful for getting a development environment setup quickly. | .gitignore | @@ -171,7 +171,8 @@
# Unignore our `brew` script.
!/bin/brew
-# Unignore our documentation/completions.
+# Unignore our configuration/completions/documentation.
+!/.devcontainer
!/.github
!/completions
!/docs | true |
Other | Homebrew | brew | 9256a01afeb94611f3fa7024f96f6558cd235f4f.json | Apply suggestions from code review
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com> | Library/Homebrew/cask/artifact/moved.rb | @@ -44,7 +44,7 @@ def move(adopt: false, force: false, verbose: false, command: nil, **options)
ohai "Adopting existing #{self.class.english_name} at '#{target}'"
same = command.run(
"/usr/bin/diff",
- args: ["-rq", source, target],
+ args: ["--recursive", "--brief", source, target],
verbose: verbose,
print_stdout: verbose,
).success?
@@ -55,7 +55,7 @@ def move(adopt: false, force: false, verbose: false, command: nil, **options)
"the one being installed."
end
- # Simulate moving the source to the target location
+ # Remove the source as we don't need to move it to the target location
source.rmtree
return post_move(command) | false |
Other | Homebrew | brew | 476b5e74246b72c50fc02d7c0b9b6b8ae1291e18.json | os/mac/diagnostic: allow Ruby 2.6.10 on < Ventura | Library/Homebrew/extend/os/mac/diagnostic.rb | @@ -205,19 +205,13 @@ def check_if_xcode_needs_clt_installed
end
def check_ruby_version
- # TODO: update portable-ruby to 2.6.10 when Ventura reaches RC
- required_version = if MacOS.version >= :ventura &&
- ENV["HOMEBREW_RUBY_PATH"].to_s.exclude?("/vendor/portable-ruby/")
- "2.6.10"
- else
- HOMEBREW_REQUIRED_RUBY_VERSION
- end
- return if RUBY_VERSION == required_version
+ return if RUBY_VERSION == HOMEBREW_REQUIRED_RUBY_VERSION
+ return if RUBY_VERSION == "2.6.10" # TODO: require 2.6.10
return if Homebrew::EnvConfig.developer? && OS::Mac.version.prerelease?
<<~EOS
Ruby version #{RUBY_VERSION} is unsupported on macOS #{MacOS.version}. Homebrew
- is developed and tested on Ruby #{required_version}, and may not work correctly
+ is developed and tested on Ruby #{HOMEBREW_REQUIRED_RUBY_VERSION}, and may not work correctly
on other Rubies. Patches are accepted as long as they don't cause breakage
on supported Rubies.
EOS | false |
Other | Homebrew | brew | 8cb056c657756abe6f225eeb85dd01e403004bbf.json | Remove sitedir from LOAD_PATH | Library/Homebrew/brew.sh | @@ -724,7 +724,7 @@ then
fi
# Disable Ruby options we don't need.
-RUBY_DISABLE_OPTIONS="--disable=rubyopt"
+RUBY_DISABLE_OPTIONS="--disable=gems,rubyopt"
if [[ -z "${HOMEBREW_RUBY_WARNINGS}" ]]
then | true |
Other | Homebrew | brew | 8cb056c657756abe6f225eeb85dd01e403004bbf.json | Remove sitedir from LOAD_PATH | Library/Homebrew/standalone/load_path.rb | @@ -1,8 +1,12 @@
# typed: true
# frozen_string_literal: true
-require "pathname"
+# We trust base Ruby to provide what we need.
+# Don't look into the user-installed sitedir, which may contain older versions of RubyGems.
+require "rbconfig"
+$LOAD_PATH.reject! { |path| path.start_with?(RbConfig::CONFIG["sitedir"]) }
+require "pathname"
HOMEBREW_LIBRARY_PATH = Pathname(__dir__).parent.realpath.freeze
require_relative "../utils/gems" | true |
Other | Homebrew | brew | 8cb056c657756abe6f225eeb85dd01e403004bbf.json | Remove sitedir from LOAD_PATH | Library/Homebrew/utils/gems.rb | @@ -44,6 +44,9 @@ def odie_if_defined(message)
end
def setup_gem_environment!(setup_path: true)
+ require "rubygems"
+ raise "RubyGems too old!" if Gem::Version.new(Gem::VERSION) < Gem::Version.new("2.2.0")
+
# Match where our bundler gems are.
gem_home = "#{HOMEBREW_LIBRARY_PATH}/vendor/bundle/ruby/#{RbConfig::CONFIG["ruby_version"]}"
Gem.paths = { | true |
Other | Homebrew | brew | cc358c2cadd16751f4df925b0a14a781de4a0160.json | Fix minor version typo | docs/Installation.md | @@ -86,7 +86,7 @@ Uninstallation is documented in the [FAQ](FAQ.md).
<a name="1"><sup>1</sup></a> For 32-bit or PPC support see [Tigerbrew](https://github.com/mistydemeo/tigerbrew).
-<a name="2"><sup>2</sup></a> macOS 11 (Ventura) or higher is best and supported, 10.11 (El Capitan) – 10.14 (Mojave) are unsupported but may work and 10.10 (Yosemite) and older will not run Homebrew at all. For 10.4 (Tiger) – 10.6 (Snow Leopard) see [Tigerbrew](https://github.com/mistydemeo/tigerbrew).
+<a name="2"><sup>2</sup></a> macOS 11 (Big Sur) or higher is best and supported, 10.11 (El Capitan) – 10.14 (Mojave) are unsupported but may work and 10.10 (Yosemite) and older will not run Homebrew at all. For 10.4 (Tiger) – 10.6 (Snow Leopard) see [Tigerbrew](https://github.com/mistydemeo/tigerbrew).
<a name="3"><sup>3</sup></a> You may need to install Xcode, the CLT, or both depending on the formula, to install a bottle (binary package) which is the only supported configuration. Downloading Xcode may require an Apple Developer account on older versions of Mac OS X. Sign up for free at [Apple's website](https://developer.apple.com/register/index.action).
| false |
Other | Homebrew | brew | 237a4181c08de37d87966a68f3f7aeaf9ce9c414.json | Add docs for casks that use git URLs | docs/Cask-Cookbook.md | @@ -1138,6 +1138,18 @@ In rare cases, a distribution may not be available over ordinary HTTP/S. Subvers
| `revision:` | a string identifying the subversion revision to download
| `trust_cert:` | set to `true` to automatically trust the certificate presented by the server (avoiding an interactive prompt)
+#### Git URLs
+
+Artifacts also may be distributed via git repositories. URLs that end in `.git` are automatically assumed to be git repositories, and the following key/value pairs may be appended to `url`:
+
+| key | value |
+| ------------------ | ----------- |
+| `using:` | the symbol `:git` is the only legal value
+| `tag:` | a string identifying the git tag to download
+| `revision:` | a string identifying the git revision to download
+| `branch:` | a string identifying the git branch to download
+| `only_path:` | a path within the repository to limit the checkout to. If only a single directory of a large repository is required, using this option can signficantly speed up downloads. If provided, artifact paths are relative to this path.
+
#### SourceForge/OSDN URLs
SourceForge and OSDN (formerly `SourceForge.JP`) projects are common ways to distribute binaries, but they provide many different styles of URLs to get to the goods. | false |
Other | Homebrew | brew | a715dec49d825da2c09da3e3fe83d7009a415cb8.json | Add `--adopt` switch
Allows `brew install` & co. to adopt existing cask artifacts that are
identical to those being installed.
Discussion: #14006 | Library/Homebrew/cask/artifact/moved.rb | @@ -34,8 +34,33 @@ def summarize_installed
private
- def move(force: false, command: nil, **options)
+ def move(adopt: false, force: false, verbose: false, command: nil, **options)
+ unless source.exist?
+ raise CaskError, "It seems the #{self.class.english_name} source '#{source}' is not there."
+ end
+
if Utils.path_occupied?(target)
+ if adopt
+ ohai "Adopting existing #{self.class.english_name} at '#{target}'"
+ same = command.run(
+ "/usr/bin/diff",
+ args: ["-rq", source, target],
+ verbose: verbose,
+ print_stdout: verbose,
+ ).success?
+
+ unless same
+ raise CaskError,
+ "It seems the existing #{self.class.english_name} is different from " \
+ "the one being installed."
+ end
+
+ # Simulate moving the source to the target location
+ source.rmtree
+
+ return post_move(command)
+ end
+
message = "It seems there is already #{self.class.english_article} " \
"#{self.class.english_name} at '#{target}'"
raise CaskError, "#{message}." unless force
@@ -44,10 +69,6 @@ def move(force: false, command: nil, **options)
delete(target, force: force, command: command, **options)
end
- unless source.exist?
- raise CaskError, "It seems the #{self.class.english_name} source '#{source}' is not there."
- end
-
ohai "Moving #{self.class.english_name} '#{source.basename}' to '#{target}'"
if target.dirname.ascend.find(&:directory?).writable?
target.dirname.mkpath
@@ -61,6 +82,11 @@ def move(force: false, command: nil, **options)
command.run!("/bin/mv", args: [source, target], sudo: true)
end
+ post_move(command)
+ end
+
+ # Performs any actions necessary after the source has been moved to the target location.
+ def post_move(command)
FileUtils.ln_sf target, source
add_altname_metadata(target, source.basename, command: command) | true |
Other | Homebrew | brew | a715dec49d825da2c09da3e3fe83d7009a415cb8.json | Add `--adopt` switch
Allows `brew install` & co. to adopt existing cask artifacts that are
identical to those being installed.
Discussion: #14006 | Library/Homebrew/cask/cmd/install.rb | @@ -10,6 +10,10 @@ class Install < AbstractCommand
extend T::Sig
OPTIONS = [
+ [:switch, "--adopt", {
+ description: "Adopt existing artifacts in the destination that are identical to those being installed. " \
+ "Cannot be combined with --force.",
+ }],
[:switch, "--skip-cask-deps", {
description: "Skip installing cask dependencies.",
}],
@@ -40,6 +44,7 @@ def run
binaries: args.binaries?,
verbose: args.verbose?,
force: args.force?,
+ adopt: args.adopt?,
skip_cask_deps: args.skip_cask_deps?,
require_sha: args.require_sha?,
quarantine: args.quarantine?,
@@ -52,6 +57,7 @@ def self.install_casks(
*casks,
verbose: nil,
force: nil,
+ adopt: nil,
binaries: nil,
skip_cask_deps: nil,
require_sha: nil,
@@ -65,6 +71,7 @@ def self.install_casks(
options = {
verbose: verbose,
force: force,
+ adopt: adopt,
binaries: binaries,
skip_cask_deps: skip_cask_deps,
require_sha: require_sha, | true |
Other | Homebrew | brew | a715dec49d825da2c09da3e3fe83d7009a415cb8.json | Add `--adopt` switch
Allows `brew install` & co. to adopt existing cask artifacts that are
identical to those being installed.
Discussion: #14006 | Library/Homebrew/cask/cmd/reinstall.rb | @@ -16,6 +16,7 @@ def run
binaries: args.binaries?,
verbose: args.verbose?,
force: args.force?,
+ adopt: args.adopt?,
skip_cask_deps: args.skip_cask_deps?,
require_sha: args.require_sha?,
quarantine: args.quarantine?,
@@ -27,6 +28,7 @@ def self.reinstall_casks(
*casks,
verbose: nil,
force: nil,
+ adopt: nil,
skip_cask_deps: nil,
binaries: nil,
require_sha: nil,
@@ -39,6 +41,7 @@ def self.reinstall_casks(
binaries: binaries,
verbose: verbose,
force: force,
+ adopt: adopt,
skip_cask_deps: skip_cask_deps,
require_sha: require_sha,
quarantine: quarantine, | true |
Other | Homebrew | brew | a715dec49d825da2c09da3e3fe83d7009a415cb8.json | Add `--adopt` switch
Allows `brew install` & co. to adopt existing cask artifacts that are
identical to those being installed.
Discussion: #14006 | Library/Homebrew/cask/cmd/upgrade.rb | @@ -13,6 +13,10 @@ class Upgrade < AbstractCommand
extend T::Sig
OPTIONS = [
+ [:switch, "--adopt", {
+ description: "Adopt existing artifacts in the destination that are identical to those being installed. " \
+ "Cannot be combined with --force.",
+ }],
[:switch, "--skip-cask-deps", {
description: "Skip installing cask dependencies.",
}],
@@ -66,6 +70,7 @@ def run
casks: Cask,
args: Homebrew::CLI::Args,
force: T.nilable(T::Boolean),
+ adopt: T.nilable(T::Boolean),
greedy: T.nilable(T::Boolean),
greedy_latest: T.nilable(T::Boolean),
greedy_auto_updates: T.nilable(T::Boolean),
@@ -81,6 +86,7 @@ def self.upgrade_casks(
*casks,
args:,
force: false,
+ adopt: false,
greedy: false,
greedy_latest: false,
greedy_auto_updates: false,
@@ -156,7 +162,7 @@ def self.upgrade_casks(
upgradable_casks.each do |(old_cask, new_cask)|
upgrade_cask(
old_cask, new_cask,
- binaries: binaries, force: force, skip_cask_deps: skip_cask_deps, verbose: verbose,
+ binaries: binaries, force: force, adopt: adopt, skip_cask_deps: skip_cask_deps, verbose: verbose,
quarantine: quarantine, require_sha: require_sha
)
rescue => e
@@ -171,7 +177,7 @@ def self.upgrade_casks(
def self.upgrade_cask(
old_cask, new_cask,
- binaries:, force:, quarantine:, require_sha:, skip_cask_deps:, verbose:
+ binaries:, force:, adopt:, quarantine:, require_sha:, skip_cask_deps:, verbose:
)
require "cask/installer"
@@ -195,6 +201,7 @@ def self.upgrade_cask(
binaries: binaries,
verbose: verbose,
force: force,
+ adopt: adopt,
skip_cask_deps: skip_cask_deps,
require_sha: require_sha,
upgrade: true, | true |
Other | Homebrew | brew | a715dec49d825da2c09da3e3fe83d7009a415cb8.json | Add `--adopt` switch
Allows `brew install` & co. to adopt existing cask artifacts that are
identical to those being installed.
Discussion: #14006 | Library/Homebrew/cask/installer.rb | @@ -20,14 +20,15 @@ class Installer
extend Predicable
- def initialize(cask, command: SystemCommand, force: false,
+ def initialize(cask, command: SystemCommand, force: false, adopt: false,
skip_cask_deps: false, binaries: true, verbose: false,
zap: false, require_sha: false, upgrade: false,
installed_as_dependency: false, quarantine: true,
verify_download_integrity: true, quiet: false)
@cask = cask
@command = command
@force = force
+ @adopt = adopt
@skip_cask_deps = skip_cask_deps
@binaries = binaries
@verbose = verbose
@@ -41,7 +42,7 @@ def initialize(cask, command: SystemCommand, force: false,
@quiet = quiet
end
- attr_predicate :binaries?, :force?, :skip_cask_deps?, :require_sha?,
+ attr_predicate :binaries?, :force?, :adopt?, :skip_cask_deps?, :require_sha?,
:reinstall?, :upgrade?, :verbose?, :zap?, :installed_as_dependency?,
:quarantine?, :quiet?
@@ -237,7 +238,7 @@ def install_artifacts
next if artifact.is_a?(Artifact::Binary) && !binaries?
- artifact.install_phase(command: @command, verbose: verbose?, force: force?)
+ artifact.install_phase(command: @command, verbose: verbose?, adopt: adopt?, force: force?)
already_installed_artifacts.unshift(artifact)
end
@@ -348,6 +349,7 @@ def cask_and_formula_dependencies
Installer.new(
cask_or_formula,
+ adopt: adopt?,
binaries: binaries?,
verbose: verbose?,
installed_as_dependency: true, | true |
Other | Homebrew | brew | a715dec49d825da2c09da3e3fe83d7009a415cb8.json | Add `--adopt` switch
Allows `brew install` & co. to adopt existing cask artifacts that are
identical to those being installed.
Discussion: #14006 | Library/Homebrew/cmd/install.rb | @@ -140,6 +140,7 @@ def install_args
conflicts "--ignore-dependencies", "--only-dependencies"
conflicts "--build-from-source", "--build-bottle", "--force-bottle"
+ conflicts "--adopt", "--force"
named_args [:formula, :cask], min: 1
end
@@ -193,6 +194,7 @@ def install
binaries: args.binaries?,
verbose: args.verbose?,
force: args.force?,
+ adopt: args.adopt?,
require_sha: args.require_sha?,
skip_cask_deps: args.skip_cask_deps?,
quarantine: args.quarantine?, | true |
Other | Homebrew | brew | a715dec49d825da2c09da3e3fe83d7009a415cb8.json | Add `--adopt` switch
Allows `brew install` & co. to adopt existing cask artifacts that are
identical to those being installed.
Discussion: #14006 | Library/Homebrew/cmd/reinstall.rb | @@ -152,6 +152,7 @@ def reinstall
binaries: args.binaries?,
verbose: args.verbose?,
force: args.force?,
+ adopt: args.adopt?,
require_sha: args.require_sha?,
skip_cask_deps: args.skip_cask_deps?,
quarantine: args.quarantine?, | true |
Other | Homebrew | brew | a715dec49d825da2c09da3e3fe83d7009a415cb8.json | Add `--adopt` switch
Allows `brew install` & co. to adopt existing cask artifacts that are
identical to those being installed.
Discussion: #14006 | Library/Homebrew/cmd/upgrade.rb | @@ -97,6 +97,7 @@ def upgrade_args
cask_options
conflicts "--build-from-source", "--force-bottle"
+ conflicts "--adopt", "--force"
named_args [:outdated_formula, :outdated_cask]
end
@@ -226,6 +227,7 @@ def upgrade_outdated_casks(casks, args:)
Cask::Cmd::Upgrade.upgrade_casks(
*casks,
force: args.force?,
+ adopt: args.adopt?,
greedy: args.greedy?,
greedy_latest: args.greedy_latest?,
greedy_auto_updates: args.greedy_auto_updates?, | true |
Other | Homebrew | brew | a715dec49d825da2c09da3e3fe83d7009a415cb8.json | Add `--adopt` switch
Allows `brew install` & co. to adopt existing cask artifacts that are
identical to those being installed.
Discussion: #14006 | Library/Homebrew/test/cask/artifact/app_spec.rb | @@ -4,13 +4,14 @@
describe Cask::Artifact::App, :cask do
let(:cask) { Cask::CaskLoader.load(cask_path("local-caffeine")) }
let(:command) { SystemCommand }
+ let(:adopt) { false }
let(:force) { false }
let(:app) { cask.artifacts.find { |a| a.is_a?(described_class) } }
let(:source_path) { cask.staged_path.join("Caffeine.app") }
let(:target_path) { cask.config.appdir.join("Caffeine.app") }
- let(:install_phase) { app.install_phase(command: command, force: force) }
+ let(:install_phase) { app.install_phase(command: command, adopt: adopt, force: force) }
let(:uninstall_phase) { app.uninstall_phase(command: command, force: force) }
before do
@@ -79,6 +80,57 @@
expect(contents_path).not_to exist
end
+ describe "given the adopt option" do
+ let(:adopt) { true }
+
+ describe "when the target compares different from the source" do
+ it "avoids clobbering the existing app" do
+ stdout = <<~EOS
+ ==> Adopting existing App at '#{target_path}'
+ EOS
+
+ expect { install_phase }
+ .to output(stdout).to_stdout
+ .and raise_error(
+ Cask::CaskError,
+ "It seems the existing App is different from the one being installed.",
+ )
+
+ expect(source_path).to be_a_directory
+ expect(target_path).to be_a_directory
+ expect(File.identical?(source_path, target_path)).to be false
+
+ contents_path = target_path.join("Contents/Info.plist")
+ expect(contents_path).not_to exist
+ end
+ end
+
+ describe "when the target compares the same as the source" do
+ before do
+ target_path.delete
+ FileUtils.cp_r source_path, target_path
+ end
+
+ it "adopts the existing app" do
+ stdout = <<~EOS
+ ==> Adopting existing App at '#{target_path}'
+ EOS
+
+ stderr = ""
+
+ expect { install_phase }
+ .to output(stdout).to_stdout
+ .and output(stderr).to_stderr
+
+ expect(source_path).to be_a_symlink
+ expect(target_path).to be_a_directory
+
+ contents_path = target_path.join("Contents/Info.plist")
+ expect(contents_path).to exist
+ end
+ end
+ end
+
describe "given the force option" do
let(:force) { true }
| true |
Other | Homebrew | brew | cc78b155c6f1ced33b864f21613f29b235ca1c7a.json | Add stable checksum to the JSON API | Library/Homebrew/formula.rb | @@ -2107,6 +2107,7 @@ def to_hash
"url" => stable.url,
"tag" => stable.specs[:tag],
"revision" => stable.specs[:revision],
+ "checksum" => stable.checksum&.to_s,
}
hsh["bottle"]["stable"] = bottle_hash if bottle_defined? | true |
Other | Homebrew | brew | cc78b155c6f1ced33b864f21613f29b235ca1c7a.json | Add stable checksum to the JSON API | Library/Homebrew/formulary.rb | @@ -159,6 +159,7 @@ def self.load_formula_from_api(name, flags:)
stable do
url urls_stable["url"]
version json_formula["versions"]["stable"]
+ sha256 urls_stable["checksum"] if urls_stable["checksum"].present?
end
end
| true |
Other | Homebrew | brew | 6219cd0a9279989caf56eb1f6c530c69ae5dd713.json | Use different cache tag for sparse checkouts | Library/Homebrew/download_strategy.rb | @@ -811,10 +811,13 @@ def clone_repo(timeout: nil)
# @api public
class GitDownloadStrategy < VCSDownloadStrategy
def initialize(url, name, version, **meta)
+ # Needs to be before the call to `super`, as the VCSDownloadStrategy's
+ # constructor calls `cache_tag` and sets the cache path.
+ @only_paths = meta[:only_paths]
+
super
@ref_type ||= :branch
@ref ||= "master"
- @only_paths = meta[:only_paths]
end
# @see AbstractDownloadStrategy#source_modified_time
@@ -837,7 +840,11 @@ def last_commit
sig { returns(String) }
def cache_tag
- "git"
+ if partial_clone_sparse_checkout?
+ "git-sparse"
+ else
+ "git"
+ end
end
sig { returns(Integer) } | false |
Other | Homebrew | brew | bfd22634252577fc851c6a925bf796dd1cd3c0a1.json | integration_test: fix Bundler deprecation.
Otherwise in some configurations some tests will fail. | Library/Homebrew/test/support/helper/spec/shared_context/integration_test.rb | @@ -116,7 +116,7 @@ def brew(*args)
ruby_args << (HOMEBREW_LIBRARY_PATH/"brew.rb").resolved_path.to_s
end
- Bundler.with_clean_env do
+ Bundler.with_unbundled_env do
stdout, stderr, status = Open3.capture3(env, *@ruby_args, *args)
$stdout.print stdout
$stderr.print stderr
@@ -125,7 +125,7 @@ def brew(*args)
end
def brew_sh(*args)
- Bundler.with_clean_env do
+ Bundler.with_unbundled_env do
stdout, stderr, status = Open3.capture3("#{ENV.fetch("HOMEBREW_PREFIX")}/bin/brew", *args)
$stdout.print stdout
$stderr.print stderr | false |
Other | Homebrew | brew | 40199404cfe26492bc24577d73b893871644c8b2.json | Allow livecheck method in on_system blocks
It's sometimes necessary to have a `livecheck` block in an `on_macos`
or `on_linux` block. For example, a formula may be disabled on macOS
but not on Linux. In that scenario, we only want a `livecheck` block
to apply to Linux, so livecheck will automatically skip the formula
as disabled on macOS.
While this setup works on a technical level, `brew style` will give
an `on_linux cannot include livecheck` offense. This commit addresses
the issue by adding `livecheck` to `on_system_allowed_methods` in the
`ComponentsOrder` Rubocop.
This also updates `on_system_allowed_methods` to use the order in
`FORMULA_COMPONENT_PRECEDENCE_LIST`, which may make it a bit easier
for formula maintainers to read at a glance. | Library/Homebrew/rubocops/components_order.rb | @@ -120,14 +120,15 @@ def check_on_system_block_content(component_precedence_list, on_system_block)
end
end
on_system_allowed_methods = %w[
- depends_on
- patch
- resource
- deprecate!
+ livecheck
+ keg_only
disable!
+ deprecate!
+ depends_on
conflicts_with
fails_with
- keg_only
+ resource
+ patch
ignore_missing_libraries
]
on_system_allowed_methods += on_system_methods.map(&:to_s) | false |
Other | Homebrew | brew | 1db08dc8b643982070b3c0e9d3f975f1332fe3af.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 | @@ -267,14 +267,6 @@ class Bundler::Definition
def self.no_lock=(no_lock); end
end
-class Bundler::DepProxy
- def clone(); end
-end
-
-class Bundler::DepProxy
- def self.get_proxy(dep, platform); end
-end
-
class Bundler::Dependency
def branch(); end
@@ -318,6 +310,7 @@ end
class Bundler::EndpointSpecification
include ::Bundler::MatchRemoteMetadata
include ::Bundler::FetchMetadata
+ def identifier(); end
end
class Bundler::Env
@@ -700,8 +693,6 @@ class Bundler::LazySpecification
def force_ruby_platform=(force_ruby_platform); end
def materialize_for_installation(); end
-
- def platform_string(); end
end
class Bundler::LockfileParser
@@ -896,6 +887,7 @@ class Bundler::RemoteSpecification
include ::Bundler::MatchRemoteMetadata
include ::Bundler::MatchMetadata
include ::Bundler::FetchMetadata
+ def identifier(); end
end
class Bundler::Resolver
@@ -932,10 +924,6 @@ class Bundler::Resolver::SpecGroup
def sorted_activated_platforms(); end
end
-class Bundler::Resolver::SpecGroup
- def self.create_for(specs, all_platforms, specific_platform); end
-end
-
class Bundler::Retry
def attempt(&block); end
@@ -5430,10 +5418,6 @@ class Object
include ::Minitest::Expectations
include ::Utils::Curl
include ::SystemCommand::Mixin
- def __send(*arg); end
-
- def __send!(*arg); end
-
def deep_dup(); end
def duplicable?(); end
@@ -5511,8 +5495,6 @@ class Object
PATCH_B_SHA256 = ::T.let(nil, ::T.untyped)
PATCH_URL_A = ::T.let(nil, ::T.untyped)
PATCH_URL_B = ::T.let(nil, ::T.untyped)
- RUBY18 = ::T.let(nil, ::T.untyped)
- RUBY19 = ::T.let(nil, ::T.untyped)
RUBY_BIN = ::T.let(nil, ::T.untyped)
RUBY_COPYRIGHT = ::T.let(nil, ::T.untyped)
RUBY_DESCRIPTION = ::T.let(nil, ::T.untyped)
@@ -5648,10 +5630,6 @@ class PATH
extend ::T::Private::Methods::SingletonMethodHooks
end
-module ParallelTests
- WINDOWS = ::T.let(nil, ::T.untyped)
-end
-
class Parlour::ConflictResolver
extend ::T::Sig
end
@@ -5806,11 +5784,6 @@ module Process
def self.fork(); end
end
-class Pry::BasicObject
- include ::ActiveSupport::ForkTracker::CoreExtPrivate
- include ::ActiveSupport::ForkTracker::CoreExt
-end
-
module Psych
VERSION = ::T.let(nil, ::T.untyped)
end
@@ -5839,74 +5812,6 @@ module Psych
def self.remove_type(type_tag); end
end
-class RBI::ASTVisitor
- extend ::T::Helpers
- extend ::T::Sig
- extend ::T::Private::Abstract::Hooks
- extend ::T::InterfaceWrapper::Helpers
-end
-
-class RBI::File
- extend ::T::Sig
-end
-
-class RBI::Formatter
- extend ::T::Sig
-end
-
-class RBI::Index
- include ::T::Enumerable
-end
-
-module RBI::Indexable
- extend ::T::Sig
- extend ::T::Helpers
- extend ::T::Private::Abstract::Hooks
- extend ::T::InterfaceWrapper::Helpers
-end
-
-class RBI::Loc
- extend ::T::Sig
-end
-
-class RBI::Node
- extend ::T::Sig
- extend ::T::Helpers
- extend ::T::Private::Abstract::Hooks
- extend ::T::InterfaceWrapper::Helpers
-end
-
-class RBI::ParseError
- extend ::T::Sig
-end
-
-class RBI::Parser
- extend ::T::Sig
-end
-
-class RBI::Rewriters::Merge::Conflict
- extend ::T::Sig
-end
-
-class RBI::Rewriters::Merge
- extend ::T::Sig
-end
-
-class RBI::Rewriters::RemoveKnownDefinitions::Operation
- extend ::T::Sig
-end
-
-class RBI::UnexpectedParserError
- extend ::T::Sig
-end
-
-class RBI::Visitor
- extend ::T::Helpers
- extend ::T::Sig
- extend ::T::Private::Abstract::Hooks
- extend ::T::InterfaceWrapper::Helpers
-end
-
class REXML::XPathParser
DEBUG = ::T.let(nil, ::T.untyped)
end
@@ -6148,536 +6053,6 @@ class Resource::Partial
def self.members(); end
end
-class Ripper
- def column(); end
-
- def encoding(); end
-
- def end_seen?(); end
-
- def error?(); end
-
- def filename(); end
-
- def initialize(*arg); end
-
- def lineno(); end
-
- def parse(); end
-
- def state(); end
-
- def yydebug(); end
-
- def yydebug=(yydebug); end
- EXPR_ARG = ::T.let(nil, ::T.untyped)
- EXPR_ARG_ANY = ::T.let(nil, ::T.untyped)
- EXPR_BEG = ::T.let(nil, ::T.untyped)
- EXPR_BEG_ANY = ::T.let(nil, ::T.untyped)
- EXPR_CLASS = ::T.let(nil, ::T.untyped)
- EXPR_CMDARG = ::T.let(nil, ::T.untyped)
- EXPR_DOT = ::T.let(nil, ::T.untyped)
- EXPR_END = ::T.let(nil, ::T.untyped)
- EXPR_ENDARG = ::T.let(nil, ::T.untyped)
- EXPR_ENDFN = ::T.let(nil, ::T.untyped)
- EXPR_END_ANY = ::T.let(nil, ::T.untyped)
- EXPR_FITEM = ::T.let(nil, ::T.untyped)
- EXPR_FNAME = ::T.let(nil, ::T.untyped)
- EXPR_LABEL = ::T.let(nil, ::T.untyped)
- EXPR_LABELED = ::T.let(nil, ::T.untyped)
- EXPR_MID = ::T.let(nil, ::T.untyped)
- EXPR_NONE = ::T.let(nil, ::T.untyped)
- EXPR_VALUE = ::T.let(nil, ::T.untyped)
- PARSER_EVENT_TABLE = ::T.let(nil, ::T.untyped)
- SCANNER_EVENT_TABLE = ::T.let(nil, ::T.untyped)
- Version = ::T.let(nil, ::T.untyped)
-end
-
-class Ripper::Filter
- def initialize(src, filename=T.unsafe(nil), lineno=T.unsafe(nil)); end
-end
-
-class Ripper::Lexer
- def lex(); end
-
- def tokenize(); end
-end
-
-class Ripper::Lexer::Elem
- def event(); end
-
- def event=(_); end
-
- def initialize(pos, event, tok, state); end
-
- def pos(); end
-
- def pos=(_); end
-
- def state(); end
-
- def state=(_); end
-
- def tok(); end
-
- def tok=(_); end
-end
-
-class Ripper::Lexer::Elem
- def self.[](*arg); end
-
- def self.members(); end
-end
-
-class Ripper::Lexer::State
- def &(i); end
-
- def ==(i); end
-
- def allbits?(i); end
-
- def anybits?(i); end
-
- def initialize(i); end
-
- def nobits?(i); end
-
- def to_i(); end
-
- def to_int(); end
-
- def to_int=(_); end
-
- def to_s=(_); end
-
- def |(i); end
-end
-
-class Ripper::Lexer::State
- def self.[](*arg); end
-
- def self.members(); end
-end
-
-class Ripper::Lexer
-end
-
-class Ripper::SexpBuilder
- def on_BEGIN(*args); end
-
- def on_CHAR(tok); end
-
- def on_END(*args); end
-
- def on___end__(tok); end
-
- def on_alias(*args); end
-
- def on_alias_error(*args); end
-
- def on_aref(*args); end
-
- def on_aref_field(*args); end
-
- def on_arg_ambiguous(*args); end
-
- def on_arg_paren(*args); end
-
- def on_args_add(*args); end
-
- def on_args_add_block(*args); end
-
- def on_args_add_star(*args); end
-
- def on_args_new(*args); end
-
- def on_array(*args); end
-
- def on_assign(*args); end
-
- def on_assign_error(*args); end
-
- def on_assoc_new(*args); end
-
- def on_assoc_splat(*args); end
-
- def on_assoclist_from_args(*args); end
-
- def on_backref(tok); end
-
- def on_backtick(tok); end
-
- def on_bare_assoc_hash(*args); end
-
- def on_begin(*args); end
-
- def on_binary(*args); end
-
- def on_block_var(*args); end
-
- def on_blockarg(*args); end
-
- def on_bodystmt(*args); end
-
- def on_brace_block(*args); end
-
- def on_break(*args); end
-
- def on_call(*args); end
-
- def on_case(*args); end
-
- def on_class(*args); end
-
- def on_class_name_error(*args); end
-
- def on_comma(tok); end
-
- def on_command(*args); end
-
- def on_command_call(*args); end
-
- def on_comment(tok); end
-
- def on_const(tok); end
-
- def on_const_path_field(*args); end
-
- def on_const_path_ref(*args); end
-
- def on_const_ref(*args); end
-
- def on_cvar(tok); end
-
- def on_def(*args); end
-
- def on_defined(*args); end
-
- def on_defs(*args); end
-
- def on_do_block(*args); end
-
- def on_dot2(*args); end
-
- def on_dot3(*args); end
-
- def on_dyna_symbol(*args); end
-
- def on_else(*args); end
-
- def on_elsif(*args); end
-
- def on_embdoc(tok); end
-
- def on_embdoc_beg(tok); end
-
- def on_embdoc_end(tok); end
-
- def on_embexpr_beg(tok); end
-
- def on_embexpr_end(tok); end
-
- def on_embvar(tok); end
-
- def on_ensure(*args); end
-
- def on_excessed_comma(*args); end
-
- def on_fcall(*args); end
-
- def on_field(*args); end
-
- def on_float(tok); end
-
- def on_for(*args); end
-
- def on_gvar(tok); end
-
- def on_hash(*args); end
-
- def on_heredoc_beg(tok); end
-
- def on_heredoc_end(tok); end
-
- def on_ident(tok); end
-
- def on_if(*args); end
-
- def on_if_mod(*args); end
-
- def on_ifop(*args); end
-
- def on_ignored_nl(tok); end
-
- def on_ignored_sp(tok); end
-
- def on_imaginary(tok); end
-
- def on_int(tok); end
-
- def on_ivar(tok); end
-
- def on_kw(tok); end
-
- def on_kwrest_param(*args); end
-
- def on_label(tok); end
-
- def on_label_end(tok); end
-
- def on_lambda(*args); end
-
- def on_lbrace(tok); end
-
- def on_lbracket(tok); end
-
- def on_lparen(tok); end
-
- def on_magic_comment(*args); end
-
- def on_massign(*args); end
-
- def on_method_add_arg(*args); end
-
- def on_method_add_block(*args); end
-
- def on_mlhs_add(*args); end
-
- def on_mlhs_add_post(*args); end
-
- def on_mlhs_add_star(*args); end
-
- def on_mlhs_new(*args); end
-
- def on_mlhs_paren(*args); end
-
- def on_module(*args); end
-
- def on_mrhs_add(*args); end
-
- def on_mrhs_add_star(*args); end
-
- def on_mrhs_new(*args); end
-
- def on_mrhs_new_from_args(*args); end
-
- def on_next(*args); end
-
- def on_nl(tok); end
-
- def on_op(tok); end
-
- def on_opassign(*args); end
-
- def on_operator_ambiguous(*args); end
-
- def on_param_error(*args); end
-
- def on_params(*args); end
-
- def on_paren(*args); end
-
- def on_parse_error(*args); end
-
- def on_period(tok); end
-
- def on_program(*args); end
-
- def on_qsymbols_add(*args); end
-
- def on_qsymbols_beg(tok); end
-
- def on_qsymbols_new(*args); end
-
- def on_qwords_add(*args); end
-
- def on_qwords_beg(tok); end
-
- def on_qwords_new(*args); end
-
- def on_rational(tok); end
-
- def on_rbrace(tok); end
-
- def on_rbracket(tok); end
-
- def on_redo(*args); end
-
- def on_regexp_add(*args); end
-
- def on_regexp_beg(tok); end
-
- def on_regexp_end(tok); end
-
- def on_regexp_literal(*args); end
-
- def on_regexp_new(*args); end
-
- def on_rescue(*args); end
-
- def on_rescue_mod(*args); end
-
- def on_rest_param(*args); end
-
- def on_retry(*args); end
-
- def on_return(*args); end
-
- def on_return0(*args); end
-
- def on_rparen(tok); end
-
- def on_sclass(*args); end
-
- def on_semicolon(tok); end
-
- def on_sp(tok); end
-
- def on_stmts_add(*args); end
-
- def on_stmts_new(*args); end
-
- def on_string_add(*args); end
-
- def on_string_concat(*args); end
-
- def on_string_content(*args); end
-
- def on_string_dvar(*args); end
-
- def on_string_embexpr(*args); end
-
- def on_string_literal(*args); end
-
- def on_super(*args); end
-
- def on_symbeg(tok); end
-
- def on_symbol(*args); end
-
- def on_symbol_literal(*args); end
-
- def on_symbols_add(*args); end
-
- def on_symbols_beg(tok); end
-
- def on_symbols_new(*args); end
-
- def on_tlambda(tok); end
-
- def on_tlambeg(tok); end
-
- def on_top_const_field(*args); end
-
- def on_top_const_ref(*args); end
-
- def on_tstring_beg(tok); end
-
- def on_tstring_content(tok); end
-
- def on_tstring_end(tok); end
-
- def on_unary(*args); end
-
- def on_undef(*args); end
-
- def on_unless(*args); end
-
- def on_unless_mod(*args); end
-
- def on_until(*args); end
-
- def on_until_mod(*args); end
-
- def on_var_alias(*args); end
-
- def on_var_field(*args); end
-
- def on_var_ref(*args); end
-
- def on_vcall(*args); end
-
- def on_void_stmt(*args); end
-
- def on_when(*args); end
-
- def on_while(*args); end
-
- def on_while_mod(*args); end
-
- def on_word_add(*args); end
-
- def on_word_new(*args); end
-
- def on_words_add(*args); end
-
- def on_words_beg(tok); end
-
- def on_words_new(*args); end
-
- def on_words_sep(tok); end
-
- def on_xstring_add(*args); end
-
- def on_xstring_literal(*args); end
-
- def on_xstring_new(*args); end
-
- def on_yield(*args); end
-
- def on_yield0(*args); end
-
- def on_zsuper(*args); end
-end
-
-class Ripper::TokenPattern
- def initialize(pattern); end
-
- def match(str); end
-
- def match_list(tokens); end
- MAP = ::T.let(nil, ::T.untyped)
-end
-
-class Ripper::TokenPattern::CompileError
-end
-
-class Ripper::TokenPattern::CompileError
-end
-
-class Ripper::TokenPattern::Error
-end
-
-class Ripper::TokenPattern::Error
-end
-
-class Ripper::TokenPattern::MatchData
- def initialize(tokens, match); end
-
- def string(n=T.unsafe(nil)); end
-end
-
-class Ripper::TokenPattern::MatchData
-end
-
-class Ripper::TokenPattern::MatchError
-end
-
-class Ripper::TokenPattern::MatchError
-end
-
-class Ripper::TokenPattern
- def self.compile(*arg); end
-end
-
-class Ripper
- def self.dedent_string(arg, arg1); end
-
- def self.lex_state_name(arg); end
-
- def self.token_match(src, pattern); end
-end
-
module RuboCop::AST::CollectionNode
def compact_blank(*args, &block); end
@@ -8010,10 +7385,6 @@ module SharedEnvExtension
extend ::T::Private::Methods::SingletonMethodHooks
end
-class SimpleCov::LinesClassifier
- NOT_RELEVANT = ::T.let(nil, ::T.untyped)
-end
-
module Singleton
def _dump(depth=T.unsafe(nil)); end
@@ -8246,155 +7617,6 @@ class SoftwareSpec
def on_ventura(or_condition=T.unsafe(nil), &block); end
end
-class Spoom::Cli::Bump
- extend ::T::Sig
-end
-
-module Spoom::Cli::Helper
- HIGHLIGHT_COLOR = ::T.let(nil, ::T.untyped)
-end
-
-module Spoom::Cli::Helper
- extend ::T::Sig
- extend ::T::Helpers
-end
-
-class Spoom::Cli::Main
- extend ::T::Sig
-end
-
-module Spoom::Colorize
- extend ::T::Sig
-end
-
-class Spoom::Coverage::D3::Base
- extend ::T::Sig
- extend ::T::Helpers
- extend ::T::Private::Abstract::Hooks
- extend ::T::InterfaceWrapper::Helpers
-end
-
-module Spoom::Coverage::D3
- extend ::T::Sig
-end
-
-class Spoom::Coverage::Snapshot
- extend ::T::Sig
-end
-
-class Spoom::Coverage::Template
- extend ::T::Sig
- extend ::T::Helpers
- extend ::T::Private::Abstract::Hooks
- extend ::T::InterfaceWrapper::Helpers
-end
-
-module Spoom::Coverage
- extend ::T::Sig
-end
-
-class Spoom::FileTree::Node
- extend ::T::Sig
-end
-
-class Spoom::FileTree
- extend ::T::Sig
-end
-
-module Spoom::Git
- extend ::T::Sig
-end
-
-class Spoom::LSP::Client
- extend ::T::Sig
-end
-
-class Spoom::LSP::Diagnostic
- extend ::T::Sig
-end
-
-class Spoom::LSP::DocumentSymbol
- extend ::T::Sig
-end
-
-class Spoom::LSP::Error::Diagnostics
- extend ::T::Sig
-end
-
-class Spoom::LSP::Hover
- extend ::T::Sig
-end
-
-class Spoom::LSP::Location
- extend ::T::Sig
-end
-
-class Spoom::LSP::Message
- extend ::T::Sig
-end
-
-class Spoom::LSP::Position
- extend ::T::Sig
-end
-
-module Spoom::LSP::PrintableSymbol
- extend ::T::Sig
- extend ::T::Helpers
- extend ::T::Private::Abstract::Hooks
- extend ::T::InterfaceWrapper::Helpers
-end
-
-class Spoom::LSP::Range
- extend ::T::Sig
-end
-
-class Spoom::LSP::ResponseError
- extend ::T::Sig
-end
-
-class Spoom::LSP::SignatureHelp
- extend ::T::Sig
-end
-
-class Spoom::Printer
- extend ::T::Sig
- extend ::T::Helpers
- extend ::T::Private::Abstract::Hooks
- extend ::T::InterfaceWrapper::Helpers
-end
-
-class Spoom::Sorbet::Config
- extend ::T::Sig
-end
-
-class Spoom::Sorbet::Errors::Error
- extend ::T::Sig
-end
-
-class Spoom::Sorbet::Errors::Parser
- extend ::T::Sig
-end
-
-module Spoom::Sorbet::Errors
- extend ::T::Sig
-end
-
-module Spoom::Sorbet::MetricsParser
- extend ::T::Sig
-end
-
-module Spoom::Sorbet::Sigils
- extend ::T::Sig
-end
-
-class Spoom::Timeline
- extend ::T::Sig
-end
-
-module Spoom
- extend ::T::Sig
-end
-
module Stdenv
def O0(); end
@@ -8444,10 +7666,6 @@ class Symbol
def to_msgpack_ext(); end
end
-module Tapioca
- extend ::T::Sig
-end
-
class Tempfile
def _close(); end
end
@@ -8533,10 +7751,6 @@ module URI
include ::URI::RFC2396_REGEXP
end
-class URI::FTP
- def buffer_open(buf, proxy, options); end
-end
-
class URI::FTP
def self.new2(user, password, host, port, path, typecode=T.unsafe(nil), arg_check=T.unsafe(nil)); end
end
@@ -8553,10 +7767,6 @@ class URI::File
DEFAULT_PORT = ::T.let(nil, ::T.untyped)
end
-class URI::HTTP
- def buffer_open(buf, proxy, options); end
-end
-
class URI::LDAP
def attributes(); end
@@ -8896,50 +8106,6 @@ end
module Webrobots
end
-module YARDSorbet::Directives
- extend ::T::Sig
-end
-
-class YARDSorbet::Handlers::AbstractDSLHandler
- extend ::T::Sig
-end
-
-class YARDSorbet::Handlers::EnumsHandler
- extend ::T::Sig
-end
-
-class YARDSorbet::Handlers::IncludeHandler
- extend ::T::Sig
-end
-
-class YARDSorbet::Handlers::MixesInClassMethodsHandler
- extend ::T::Sig
-end
-
-class YARDSorbet::Handlers::SigHandler
- extend ::T::Sig
-end
-
-module YARDSorbet::Handlers::StructClassHandler
- extend ::T::Sig
-end
-
-class YARDSorbet::Handlers::StructPropHandler
- extend ::T::Sig
-end
-
-module YARDSorbet::NodeUtils
- extend ::T::Sig
-end
-
-module YARDSorbet::SigToYARD
- extend ::T::Sig
-end
-
-module YARDSorbet::TagUtils
- extend ::T::Sig
-end
-
class Zlib::Deflate
def initialize(*arg); end
end | false |
Other | Homebrew | brew | 942f419a48426d14a1b49d35f343cbe00a583e71.json | ResourceAuditor: Fix #audit_head_branch error
The existing logic in `#audit_head_branch` for identifying the `HEAD`
branch in a Git repository will give an ```undefined method `[]' for
nil:NilClass``` error when a repository doesn't provide this
reference. Expected output is as follows:
```
ref: refs/heads/master HEAD
1a8f9ac700873d1a08de31a17a2fd654245d5085 HEAD
```
However, I encountered this error for a repository with the following
output (i.e., where no symref is provided for HEAD):
```
f86be659718c0cd0a67f88b42f07044c23d0d028 HEAD
```
This commit resolves the error by modifying the related logic to
account for a `nil` value. | Library/Homebrew/resource_auditor.rb | @@ -146,9 +146,8 @@ def audit_head_branch
return if specs[:tag].present?
branch = Utils.popen_read("git", "ls-remote", "--symref", url, "HEAD")
- .match(%r{ref: refs/heads/(.*?)\s+HEAD})[1]
-
- return if branch == specs[:branch]
+ .match(%r{ref: refs/heads/(.*?)\s+HEAD})&.to_a&.second
+ return if branch.blank? || branch == specs[:branch]
problem "Use `branch: \"#{branch}\"` to specify the default branch"
end | false |
Other | Homebrew | brew | f54de5a8481bc9dc4ab2880a69c98efc6f4a9552.json | Fix curl_output for curl download strategy | Library/Homebrew/download_strategy.rb | @@ -580,6 +580,13 @@ def _curl_download(resolved_url, to, timeout)
curl_download resolved_url, to: to, try_partial: @try_partial, timeout: timeout, use_homebrew_curl: true
end
+
+ def curl_output(*args, **options)
+ raise HomebrewCurlDownloadStrategyError, url unless Formula["curl"].any_version_installed?
+
+ options[:use_homebrew_curl] = true
+ super(*args, **options)
+ end
end
# Strategy for downloading a file from an GitHub Packages URL. | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.