Merge remote-tracking branch 'origin/master' into cask-move-contents

This commit is contained in:
JBYoshi 2023-04-25 15:44:29 -05:00
commit a1571702d3
No known key found for this signature in database
GPG Key ID: AE4430116622D05D
1192 changed files with 1790 additions and 17607 deletions

View File

@ -2,6 +2,9 @@ self-hosted-runner:
# Labels of self-hosted runner in array of strings. # Labels of self-hosted runner in array of strings.
labels: labels:
- 11-arm64 - 11-arm64
# FIXME: Remove `macos-13` when resolved:
# https://github.com/rhysd/actionlint/issues/296
- macos-13
# Configuration variables in array of strings defined in your repository or # Configuration variables in array of strings defined in your repository or
# organization. `null` means disabling configuration variables check. # organization. `null` means disabling configuration variables check.
# Empty array means no configuration variable is allowed. # Empty array means no configuration variable is allowed.

View File

@ -26,7 +26,7 @@ jobs:
uses: Homebrew/actions/setup-homebrew@master uses: Homebrew/actions/setup-homebrew@master
- name: Cache Bundler RubyGems - name: Cache Bundler RubyGems
uses: actions/cache@v1 uses: actions/cache@v3
with: with:
path: ${{ steps.set-up-homebrew.outputs.gems-path }} path: ${{ steps.set-up-homebrew.outputs.gems-path }}
key: ${{ runner.os }}-rubygems-${{ steps.set-up-homebrew.outputs.gems-hash }} key: ${{ runner.os }}-rubygems-${{ steps.set-up-homebrew.outputs.gems-hash }}

View File

@ -10,7 +10,7 @@ on:
jobs: jobs:
build: build:
runs-on: macos-12 runs-on: macos-13
env: env:
IDENTIFIER: sh.brew.Homebrew IDENTIFIER: sh.brew.Homebrew
TMP_PATH: /tmp/brew TMP_PATH: /tmp/brew

View File

@ -21,7 +21,7 @@ permissions:
jobs: jobs:
tapioca: tapioca:
if: github.repository == 'Homebrew/brew' if: github.repository == 'Homebrew/brew'
runs-on: macos-12 runs-on: macos-13
steps: steps:
- name: Set up Homebrew - name: Set up Homebrew
id: set-up-homebrew id: set-up-homebrew

View File

@ -2,6 +2,8 @@ name: Update sponsors, maintainers, manpage and completions
on: on:
push: push:
branches:
- "**"
paths: paths:
- .github/workflows/sponsors-maintainers-man-completions.yml - .github/workflows/sponsors-maintainers-man-completions.yml
- README.md - README.md
@ -39,7 +41,7 @@ jobs:
signing_key: ${{ secrets.BREWTESTBOT_GPG_SIGNING_SUBKEY }} signing_key: ${{ secrets.BREWTESTBOT_GPG_SIGNING_SUBKEY }}
- name: Cache Bundler RubyGems - name: Cache Bundler RubyGems
uses: actions/cache@v1 uses: actions/cache@v3
with: with:
path: ${{ steps.set-up-homebrew.outputs.gems-path }} path: ${{ steps.set-up-homebrew.outputs.gems-path }}
key: ${{ runner.os }}-rubygems-${{ steps.set-up-homebrew.outputs.gems-hash }} key: ${{ runner.os }}-rubygems-${{ steps.set-up-homebrew.outputs.gems-hash }}

View File

@ -135,7 +135,7 @@ jobs:
uses: Homebrew/actions/setup-homebrew@master uses: Homebrew/actions/setup-homebrew@master
- name: Cache Bundler RubyGems - name: Cache Bundler RubyGems
uses: actions/cache@v1 uses: actions/cache@v3
with: with:
path: ${{ steps.set-up-homebrew.outputs.gems-path }} path: ${{ steps.set-up-homebrew.outputs.gems-path }}
key: ${{ runner.os }}-rubygems-${{ steps.set-up-homebrew.outputs.gems-hash }} key: ${{ runner.os }}-rubygems-${{ steps.set-up-homebrew.outputs.gems-hash }}
@ -157,7 +157,7 @@ jobs:
name: cask audit name: cask audit
needs: syntax needs: syntax
if: startsWith(github.repository, 'Homebrew/') if: startsWith(github.repository, 'Homebrew/')
runs-on: macos-12 runs-on: macos-13
env: env:
HOMEBREW_NO_INSTALL_FROM_API: 1 HOMEBREW_NO_INSTALL_FROM_API: 1
steps: steps:
@ -166,7 +166,7 @@ jobs:
uses: Homebrew/actions/setup-homebrew@master uses: Homebrew/actions/setup-homebrew@master
- name: Cache Bundler RubyGems - name: Cache Bundler RubyGems
uses: actions/cache@v1 uses: actions/cache@v3
with: with:
path: ${{ steps.set-up-homebrew.outputs.gems-path }} path: ${{ steps.set-up-homebrew.outputs.gems-path }}
key: ${{ runner.os }}-rubygems-${{ steps.set-up-homebrew.outputs.gems-hash }} key: ${{ runner.os }}-rubygems-${{ steps.set-up-homebrew.outputs.gems-hash }}
@ -258,8 +258,8 @@ jobs:
include: include:
- name: update-test (Ubuntu 22.04) - name: update-test (Ubuntu 22.04)
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
- name: update-test (macOS 12) - name: update-test (macOS 13)
runs-on: macos-12 runs-on: macos-13
steps: steps:
- name: Set up Homebrew - name: Set up Homebrew
id: set-up-homebrew id: set-up-homebrew
@ -300,9 +300,9 @@ jobs:
- name: tests (Ubuntu 20.04) - name: tests (Ubuntu 20.04)
test-flags: --coverage test-flags: --coverage
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
- name: tests (macOS 12) - name: tests (macOS 13)
test-flags: --coverage test-flags: --coverage
runs-on: macos-12 runs-on: macos-13
steps: steps:
- name: Set up Homebrew - name: Set up Homebrew
id: set-up-homebrew id: set-up-homebrew
@ -373,7 +373,7 @@ jobs:
HOMEBREW_BUILDPULSE_ACCOUNT_ID: 1503512 HOMEBREW_BUILDPULSE_ACCOUNT_ID: 1503512
HOMEBREW_BUILDPULSE_REPOSITORY_ID: 53238813 HOMEBREW_BUILDPULSE_REPOSITORY_ID: 53238813
- uses: codecov/codecov-action@40a12dcee2df644d47232dde008099a3e9e4f865 - uses: codecov/codecov-action@894ff025c7b54547a9a2a1e9f228beae737ad3c2
with: with:
directory: ${{ steps.set-up-homebrew.outputs.repository-path }} directory: ${{ steps.set-up-homebrew.outputs.repository-path }}
files: Library/Homebrew/test/coverage/coverage.xml files: Library/Homebrew/test/coverage/coverage.xml
@ -390,8 +390,8 @@ jobs:
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
- name: test default formula (Ubuntu 20.04) - name: test default formula (Ubuntu 20.04)
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
- name: test default formula (macOS 12) - name: test default formula (macOS 13)
runs-on: macos-12 runs-on: macos-13
steps: steps:
- name: Set up Homebrew - name: Set up Homebrew
id: set-up-homebrew id: set-up-homebrew

View File

@ -32,7 +32,7 @@ jobs:
contains(github.event.pull_request.title, '/Library/Homebrew') contains(github.event.pull_request.title, '/Library/Homebrew')
) )
) )
runs-on: macos-12 runs-on: macos-13
steps: steps:
- name: Set up Homebrew - name: Set up Homebrew
id: set-up-homebrew id: set-up-homebrew
@ -71,9 +71,9 @@ jobs:
run: | run: |
if [[ "${GITHUB_EVENT_NAME}" == "pull_request_target" || "${GITHUB_EVENT_NAME}" == "workflow_dispatch" ]] if [[ "${GITHUB_EVENT_NAME}" == "pull_request_target" || "${GITHUB_EVENT_NAME}" == "workflow_dispatch" ]]
then then
brew vendor-gems brew vendor-gems --non-bundler-gems
else else
brew vendor-gems --no-commit brew vendor-gems --non-bundler-gems --no-commit
fi fi
- name: Update RBI files - name: Update RBI files

50
.gitignore vendored
View File

@ -75,21 +75,30 @@
**/vendor/bundle/ruby/*/gems/concurrent-ruby-*/lib/utility/ **/vendor/bundle/ruby/*/gems/concurrent-ruby-*/lib/utility/
**/vendor/bundle/ruby/*/gems/concurrent-ruby-*/lib/*/*.jar **/vendor/bundle/ruby/*/gems/concurrent-ruby-*/lib/*/*.jar
**/vendor/bundle/ruby/*/gems/i18n-*/lib/i18n/tests* **/vendor/bundle/ruby/*/gems/i18n-*/lib/i18n/tests*
**/vendor/bundle/ruby/*/gems/mechanize-*/lib/*.rb
**/vendor/bundle/ruby/*/gems/mechanize-*/lib/mechanize/http/agent.rb
**/vendor/bundle/ruby/*/gems/mechanize-*/lib/mechanize/http/*auth*.rb
**/vendor/bundle/ruby/*/gems/mechanize-*/lib/mechanize/c*
**/vendor/bundle/ruby/*/gems/mechanize-*/lib/mechanize/d*
**/vendor/bundle/ruby/*/gems/mechanize-*/lib/mechanize/e*
**/vendor/bundle/ruby/*/gems/mechanize-*/lib/mechanize/f*
**/vendor/bundle/ruby/*/gems/mechanize-*/lib/mechanize/h*.rb
**/vendor/bundle/ruby/*/gems/mechanize-*/lib/mechanize/i*
**/vendor/bundle/ruby/*/gems/mechanize-*/lib/mechanize/p*
**/vendor/bundle/ruby/*/gems/mechanize-*/lib/mechanize/r*
**/vendor/bundle/ruby/*/gems/mechanize-*/lib/mechanize/t*
**/vendor/bundle/ruby/*/gems/mechanize-*/lib/mechanize/u*
**/vendor/bundle/ruby/*/gems/mechanize-*/lib/mechanize/x*
**/vendor/bundle/ruby/*/gems/thread_safe-*/lib/thread_safe/util **/vendor/bundle/ruby/*/gems/thread_safe-*/lib/thread_safe/util
**/vendor/gems/mechanize-*/.*
**/vendor/gems/mechanize-*/*.md
**/vendor/gems/mechanize-*/*.rdoc
**/vendor/gems/mechanize-*/*.gemspec
**/vendor/gems/mechanize-*/Gemfile
**/vendor/gems/mechanize-*/Rakefile
**/vendor/gems/mechanize-*/examples/
**/vendor/gems/mechanize-*/lib/*.rb
**/vendor/gems/mechanize-*/lib/*.rb
**/vendor/gems/mechanize-*/lib/mechanize/http/agent.rb
**/vendor/gems/mechanize-*/lib/mechanize/http/*auth*.rb
**/vendor/gems/mechanize-*/lib/mechanize/c*
**/vendor/gems/mechanize-*/lib/mechanize/d*
**/vendor/gems/mechanize-*/lib/mechanize/e*
**/vendor/gems/mechanize-*/lib/mechanize/f*
**/vendor/gems/mechanize-*/lib/mechanize/h*.rb
**/vendor/gems/mechanize-*/lib/mechanize/i*
**/vendor/gems/mechanize-*/lib/mechanize/p*
**/vendor/gems/mechanize-*/lib/mechanize/r*
**/vendor/gems/mechanize-*/lib/mechanize/t*
**/vendor/gems/mechanize-*/lib/mechanize/u*
**/vendor/gems/mechanize-*/lib/mechanize/x*
**/vendor/gems/mechanize-*/test/
# Ignore dependencies we don't wish to vendor # Ignore dependencies we don't wish to vendor
**/vendor/bundle/ruby/*/gems/ast-*/ **/vendor/bundle/ruby/*/gems/ast-*/
@ -99,28 +108,20 @@
**/vendor/bundle/ruby/*/gems/coderay-*/ **/vendor/bundle/ruby/*/gems/coderay-*/
**/vendor/bundle/ruby/*/gems/colorize-*/ **/vendor/bundle/ruby/*/gems/colorize-*/
**/vendor/bundle/ruby/*/gems/commander-*/ **/vendor/bundle/ruby/*/gems/commander-*/
**/vendor/bundle/ruby/*/gems/connection_pool-*/
**/vendor/bundle/ruby/*/gems/diff-lcs-*/ **/vendor/bundle/ruby/*/gems/diff-lcs-*/
**/vendor/bundle/ruby/*/gems/docile-*/ **/vendor/bundle/ruby/*/gems/docile-*/
**/vendor/bundle/ruby/*/gems/domain_name-*/
**/vendor/bundle/ruby/*/gems/ecma-re-validator-*/ **/vendor/bundle/ruby/*/gems/ecma-re-validator-*/
**/vendor/bundle/ruby/*/gems/hana-*/ **/vendor/bundle/ruby/*/gems/hana-*/
**/vendor/bundle/ruby/*/gems/highline-*/ **/vendor/bundle/ruby/*/gems/highline-*/
**/vendor/bundle/ruby/*/gems/http-cookie-*/
**/vendor/bundle/ruby/*/gems/hpricot-*/ **/vendor/bundle/ruby/*/gems/hpricot-*/
**/vendor/bundle/ruby/*/gems/jaro_winkler-*/ **/vendor/bundle/ruby/*/gems/jaro_winkler-*/
**/vendor/bundle/ruby/*/gems/json-*/ **/vendor/bundle/ruby/*/gems/json-*/
**/vendor/bundle/ruby/*/gems/json_schemer-*/ **/vendor/bundle/ruby/*/gems/json_schemer-*/
**/vendor/bundle/ruby/*/gems/method_source-*/ **/vendor/bundle/ruby/*/gems/method_source-*/
**/vendor/bundle/ruby/*/gems/mime-types-data-*/
**/vendor/bundle/ruby/*/gems/mime-types-*/
**/vendor/bundle/ruby/*/gems/mini_portile2-*/ **/vendor/bundle/ruby/*/gems/mini_portile2-*/
**/vendor/bundle/ruby/*/gems/minitest-*/ **/vendor/bundle/ruby/*/gems/minitest-*/
**/vendor/bundle/ruby/*/gems/msgpack-*/ **/vendor/bundle/ruby/*/gems/msgpack-*/
**/vendor/bundle/ruby/*/gems/mustache-*/ **/vendor/bundle/ruby/*/gems/mustache-*/
**/vendor/bundle/ruby/*/gems/net-http-digest_auth-*/
**/vendor/bundle/ruby/*/gems/net-http-persistent-*/
**/vendor/bundle/ruby/*/gems/nokogiri-*/
**/vendor/bundle/ruby/*/gems/ntlm-http-*/ **/vendor/bundle/ruby/*/gems/ntlm-http-*/
**/vendor/bundle/ruby/*/gems/parallel-*/ **/vendor/bundle/ruby/*/gems/parallel-*/
**/vendor/bundle/ruby/*/gems/parallel_tests-*/ **/vendor/bundle/ruby/*/gems/parallel_tests-*/
@ -129,7 +130,6 @@
**/vendor/bundle/ruby/*/gems/powerpack-*/ **/vendor/bundle/ruby/*/gems/powerpack-*/
**/vendor/bundle/ruby/*/gems/psych-*/ **/vendor/bundle/ruby/*/gems/psych-*/
**/vendor/bundle/ruby/*/gems/pry-*/ **/vendor/bundle/ruby/*/gems/pry-*/
**/vendor/bundle/ruby/*/gems/racc-*/
**/vendor/bundle/ruby/*/gems/rainbow-*/ **/vendor/bundle/ruby/*/gems/rainbow-*/
**/vendor/bundle/ruby/*/gems/rbi-*/ **/vendor/bundle/ruby/*/gems/rbi-*/
**/vendor/bundle/ruby/*/gems/rdiscount-*/ **/vendor/bundle/ruby/*/gems/rdiscount-*/
@ -158,14 +158,14 @@
**/vendor/bundle/ruby/*/gems/strscan-*/ **/vendor/bundle/ruby/*/gems/strscan-*/
**/vendor/bundle/ruby/*/gems/tapioca-*/ **/vendor/bundle/ruby/*/gems/tapioca-*/
**/vendor/bundle/ruby/*/gems/thor-*/ **/vendor/bundle/ruby/*/gems/thor-*/
**/vendor/bundle/ruby/*/gems/unf_ext-*/
**/vendor/bundle/ruby/*/gems/unf-*/
**/vendor/bundle/ruby/*/gems/unicode-display_width-*/ **/vendor/bundle/ruby/*/gems/unicode-display_width-*/
**/vendor/bundle/ruby/*/gems/unparser-*/ **/vendor/bundle/ruby/*/gems/unparser-*/
**/vendor/bundle/ruby/*/gems/uri_template-*/ **/vendor/bundle/ruby/*/gems/uri_template-*/
**/vendor/bundle/ruby/*/gems/webrobots-*/ **/vendor/bundle/ruby/*/gems/webrobots-*/
**/vendor/bundle/ruby/*/gems/yard-*/ **/vendor/bundle/ruby/*/gems/yard-*/
**/vendor/bundle/ruby/*/gems/yard-sorbet-*/ **/vendor/bundle/ruby/*/gems/yard-sorbet-*/
**/vendor/cache/
**/vendor/specifications/
# Ignore `bin` contents (again). # Ignore `bin` contents (again).
/bin /bin

View File

@ -38,7 +38,12 @@ RUN apt-get update \
uuid-runtime \ uuid-runtime \
tzdata \ tzdata \
jq \ jq \
&& if [ "$(. /etc/lsb-release; echo "${DISTRIB_RELEASE}" | cut -d. -f1)" -ge 22 ]; then apt-get install -y --no-install-recommends gh skopeo; fi \ && if [ "$(. /etc/lsb-release; echo "${DISTRIB_RELEASE}" | cut -d. -f1)" -ge 22 ]; then apt-get install -y --no-install-recommends skopeo; fi \
&& curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \
&& chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
&& apt-get update \
&& apt-get install -y --no-install-recommends gh \
&& apt-get remove --purge -y software-properties-common \ && apt-get remove --purge -y software-properties-common \
&& apt-get autoremove --purge -y \ && apt-get autoremove --purge -y \
&& rm -rf /var/lib/apt/lists/* \ && rm -rf /var/lib/apt/lists/* \

View File

@ -280,12 +280,13 @@ RSpec/Focus:
Sorbet/ConstantsFromStrings: Sorbet/ConstantsFromStrings:
Enabled: false Enabled: false
# This is already the default
Sorbet/FalseSigil: Sorbet/FalseSigil:
Exclude: Enabled: false
- "Taps/**/*"
- "/**/{Formula,Casks}/**/*.rb" # T::Sig is monkey-patched into Module
- "**/{Formula,Casks}/**/*.rb" Sorbet/RedundantExtendTSig:
- "Homebrew/test/**/Casks/**/*.rb" Enabled: true
Sorbet/StrictSigil: Sorbet/StrictSigil:
inherit_mode: inherit_mode:
@ -295,6 +296,14 @@ Sorbet/StrictSigil:
Include: Include:
- "**/*.rbi" - "**/*.rbi"
Sorbet/TrueSigil:
Enabled: true
Exclude:
- "Taps/**/*"
- "/**/{Formula,Casks}/**/*.rb"
- "**/{Formula,Casks}/**/*.rb"
- "Homebrew/test/**/*.rb"
# Require &&/|| instead of and/or # Require &&/|| instead of and/or
Style/AndOr: Style/AndOr:
EnforcedStyle: always EnforcedStyle: always

View File

@ -49,7 +49,6 @@ end
gem "activesupport" gem "activesupport"
gem "addressable" gem "addressable"
gem "concurrent-ruby" gem "concurrent-ruby"
gem "mechanize"
gem "patchelf" gem "patchelf"
gem "plist" gem "plist"
gem "rubocop-performance" gem "rubocop-performance"

View File

@ -18,12 +18,9 @@ GEM
commander (4.6.0) commander (4.6.0)
highline (~> 2.0.0) highline (~> 2.0.0)
concurrent-ruby (1.2.2) concurrent-ruby (1.2.2)
connection_pool (2.4.0)
did_you_mean (1.6.3) did_you_mean (1.6.3)
diff-lcs (1.5.0) diff-lcs (1.5.0)
docile (1.4.0) docile (1.4.0)
domain_name (0.5.20190701)
unf (>= 0.0.5, < 1.0.0)
ecma-re-validator (0.4.0) ecma-re-validator (0.4.0)
regexp_parser (~> 2.2) regexp_parser (~> 2.2)
elftools (1.2.0) elftools (1.2.0)
@ -31,8 +28,6 @@ GEM
hana (1.3.7) hana (1.3.7)
highline (2.0.3) highline (2.0.3)
hpricot (0.8.6) hpricot (0.8.6)
http-cookie (1.0.5)
domain_name (~> 0.5)
i18n (1.12.0) i18n (1.12.0)
concurrent-ruby (~> 1.0) concurrent-ruby (~> 1.0)
json (2.6.3) json (2.6.3)
@ -41,40 +36,11 @@ GEM
hana (~> 1.3) hana (~> 1.3)
regexp_parser (~> 2.0) regexp_parser (~> 2.0)
uri_template (~> 0.7) uri_template (~> 0.7)
mechanize (2.9.0)
addressable (~> 2.8)
domain_name (~> 0.5, >= 0.5.20190701)
http-cookie (~> 1.0, >= 1.0.3)
mime-types (~> 3.0)
net-http-digest_auth (~> 1.4, >= 1.4.1)
net-http-persistent (>= 2.5.2, < 5.0.dev)
nokogiri (~> 1.11, >= 1.11.2)
rubyntlm (~> 0.6, >= 0.6.3)
webrick (~> 1.7)
webrobots (~> 0.1.2)
method_source (1.0.0) method_source (1.0.0)
mime-types (3.4.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2023.0218.1)
mini_portile2 (2.8.1)
minitest (5.18.0) minitest (5.18.0)
msgpack (1.7.0) msgpack (1.7.0)
mustache (1.1.1) mustache (1.1.1)
net-http-digest_auth (1.4.1) parallel (1.23.0)
net-http-persistent (4.0.2)
connection_pool (~> 2.2)
nokogiri (1.13.10)
mini_portile2 (~> 2.8.0)
racc (~> 1.4)
nokogiri (1.13.10-aarch64-linux)
racc (~> 1.4)
nokogiri (1.13.10-arm64-darwin)
racc (~> 1.4)
nokogiri (1.13.10-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.13.10-x86_64-linux)
racc (~> 1.4)
parallel (1.22.1)
parallel_tests (3.13.0) parallel_tests (3.13.0)
parallel parallel
parlour (8.1.0) parlour (8.1.0)
@ -82,7 +48,7 @@ GEM
parser parser
rainbow (~> 3.0) rainbow (~> 3.0)
sorbet-runtime (>= 0.5) sorbet-runtime (>= 0.5)
parser (3.2.2.0) parser (3.2.2.1)
ast (~> 2.4.1) ast (~> 2.4.1)
patchelf (1.4.0) patchelf (1.4.0)
elftools (>= 1.2) elftools (>= 1.2)
@ -91,7 +57,6 @@ GEM
coderay (~> 1.1) coderay (~> 1.1)
method_source (~> 1.0) method_source (~> 1.0)
public_suffix (5.0.1) public_suffix (5.0.1)
racc (1.6.2)
rack (3.0.7) rack (3.0.7)
rainbow (3.1.1) rainbow (3.1.1)
rbi (0.0.14) rbi (0.0.14)
@ -100,7 +65,7 @@ GEM
sorbet-runtime (>= 0.5.9204) sorbet-runtime (>= 0.5.9204)
unparser unparser
rdiscount (2.2.7) rdiscount (2.2.7)
regexp_parser (2.7.0) regexp_parser (2.8.0)
rexml (3.2.5) rexml (3.2.5)
ronn (0.7.3) ronn (0.7.3)
hpricot (>= 0.8.2) hpricot (>= 0.8.2)
@ -110,9 +75,9 @@ GEM
rspec-core (~> 3.12.0) rspec-core (~> 3.12.0)
rspec-expectations (~> 3.12.0) rspec-expectations (~> 3.12.0)
rspec-mocks (~> 3.12.0) rspec-mocks (~> 3.12.0)
rspec-core (3.12.1) rspec-core (3.12.2)
rspec-support (~> 3.12.0) rspec-support (~> 3.12.0)
rspec-expectations (3.12.2) rspec-expectations (3.12.3)
diff-lcs (>= 1.2.0, < 2.0) diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.12.0) rspec-support (~> 3.12.0)
rspec-github (2.4.0) rspec-github (2.4.0)
@ -130,7 +95,7 @@ GEM
rspec-support (3.12.0) rspec-support (3.12.0)
rspec_junit_formatter (0.6.0) rspec_junit_formatter (0.6.0)
rspec-core (>= 2, < 4, != 2.12.0) rspec-core (>= 2, < 4, != 2.12.0)
rubocop (1.50.1) rubocop (1.50.2)
json (~> 2.3) json (~> 2.3)
parallel (~> 1.10) parallel (~> 1.10)
parser (>= 3.2.0.0) parser (>= 3.2.0.0)
@ -142,16 +107,16 @@ GEM
unicode-display_width (>= 2.4.0, < 3.0) unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.28.0) rubocop-ast (1.28.0)
parser (>= 3.2.1.0) parser (>= 3.2.1.0)
rubocop-capybara (2.17.1) rubocop-capybara (2.18.0)
rubocop (~> 1.41) rubocop (~> 1.41)
rubocop-performance (1.17.1) rubocop-performance (1.17.1)
rubocop (>= 1.7.0, < 2.0) rubocop (>= 1.7.0, < 2.0)
rubocop-ast (>= 0.4.0) rubocop-ast (>= 0.4.0)
rubocop-rails (2.19.0) rubocop-rails (2.19.1)
activesupport (>= 4.2.0) activesupport (>= 4.2.0)
rack (>= 1.1) rack (>= 1.1)
rubocop (>= 1.33.0, < 2.0) rubocop (>= 1.33.0, < 2.0)
rubocop-rspec (2.19.0) rubocop-rspec (2.20.0)
rubocop (~> 1.33) rubocop (~> 1.33)
rubocop-capybara (~> 2.17) rubocop-capybara (~> 2.17)
rubocop-sorbet (0.7.0) rubocop-sorbet (0.7.0)
@ -159,7 +124,6 @@ GEM
ruby-macho (3.0.0) ruby-macho (3.0.0)
ruby-prof (1.4.3) ruby-prof (1.4.3)
ruby-progressbar (1.13.0) ruby-progressbar (1.13.0)
rubyntlm (0.6.3)
simplecov (0.22.0) simplecov (0.22.0)
docile (~> 1.1) docile (~> 1.1)
simplecov-html (~> 0.11) simplecov-html (~> 0.11)
@ -202,17 +166,12 @@ GEM
thor (1.2.1) thor (1.2.1)
tzinfo (2.0.6) tzinfo (2.0.6)
concurrent-ruby (~> 1.0) concurrent-ruby (~> 1.0)
unf (0.1.4)
unf_ext
unf_ext (0.0.8.2)
unicode-display_width (2.4.2) unicode-display_width (2.4.2)
unparser (0.6.4) unparser (0.6.4)
diff-lcs (~> 1.3) diff-lcs (~> 1.3)
parser (>= 3.1.0) parser (>= 3.1.0)
uri_template (0.7.0) uri_template (0.7.0)
warning (1.3.0) warning (1.3.0)
webrick (1.8.1)
webrobots (0.1.2)
yard (0.9.34) yard (0.9.34)
yard-sorbet (0.6.1) yard-sorbet (0.6.1)
sorbet-runtime (>= 0.5) sorbet-runtime (>= 0.5)
@ -234,7 +193,6 @@ DEPENDENCIES
concurrent-ruby concurrent-ruby
did_you_mean did_you_mean
json_schemer json_schemer
mechanize
minitest minitest
parallel_tests parallel_tests
parlour parlour

View File

@ -5,8 +5,6 @@
# #
# @api private # @api private
class PATH class PATH
extend T::Sig
include Enumerable include Enumerable
extend Forwardable extend Forwardable

View File

@ -11,8 +11,6 @@ module Homebrew
# #
# @api private # @api private
module API module API
extend T::Sig
extend Cachable extend Cachable
HOMEBREW_CACHE_API = (HOMEBREW_CACHE/"api").freeze HOMEBREW_CACHE_API = (HOMEBREW_CACHE/"api").freeze

View File

@ -8,8 +8,6 @@ module Homebrew
# @api private # @api private
module Analytics module Analytics
class << self class << self
extend T::Sig
sig { returns(String) } sig { returns(String) }
def analytics_api_path def analytics_api_path
"analytics" "analytics"

View File

@ -11,7 +11,6 @@ module Homebrew
module Cask module Cask
class << self class << self
include Cachable include Cachable
extend T::Sig
private :cache private :cache

View File

@ -11,7 +11,6 @@ module Homebrew
module Formula module Formula
class << self class << self
include Cachable include Cachable
extend T::Sig
private :cache private :cache

View File

@ -5,8 +5,6 @@
# #
# @api private # @api private
class BuildEnvironment class BuildEnvironment
extend T::Sig
sig { params(settings: Symbol).void } sig { params(settings: Symbol).void }
def initialize(*settings) def initialize(*settings)
@settings = Set.new(settings) @settings = Set.new(settings)
@ -31,8 +29,6 @@ class BuildEnvironment
# DSL for specifying build environment settings. # DSL for specifying build environment settings.
module DSL module DSL
extend T::Sig
# Initialise @env for each class which may use this DSL (e.g. each formula subclass). # Initialise @env for each class which may use this DSL (e.g. each formula subclass).
# `env` may never be called, and it needs to be initialised before the class is frozen. # `env` may never be called, and it needs to be initialised before the class is frozen.
def inherited(child) def inherited(child)

View File

@ -8,8 +8,6 @@ module Homebrew
# #
# @api private # @api private
class BundleVersion class BundleVersion
extend T::Sig
include Comparable include Comparable
extend SystemCommand::Mixin extend SystemCommand::Mixin

View File

@ -8,7 +8,6 @@ require "cask/cache"
require "cask/cask_loader" require "cask/cask_loader"
require "cask/cask" require "cask/cask"
require "cask/caskroom" require "cask/caskroom"
require "cask/cmd"
require "cask/config" require "cask/config"
require "cask/exceptions" require "cask/exceptions"
require "cask/denylist" require "cask/denylist"

View File

@ -9,7 +9,6 @@ module Cask
# #
# @api private # @api private
class AbstractArtifact class AbstractArtifact
extend T::Sig
extend T::Helpers extend T::Helpers
abstract! abstract!

View File

@ -13,8 +13,6 @@ module Cask
# #
# @api private # @api private
class AbstractUninstall < AbstractArtifact class AbstractUninstall < AbstractArtifact
extend T::Sig
ORDERED_DIRECTIVES = [ ORDERED_DIRECTIVES = [
:early_script, :early_script,
:launchctl, :launchctl,

View File

@ -9,8 +9,6 @@ module Cask
# #
# @api private # @api private
class Artifact < Moved class Artifact < Moved
extend T::Sig
sig { returns(String) } sig { returns(String) }
def self.english_name def self.english_name
"Generic Artifact" "Generic Artifact"

View File

@ -9,8 +9,6 @@ module Cask
# #
# @api private # @api private
class KeyboardLayout < Moved class KeyboardLayout < Moved
extend T::Sig
def install_phase(**options) def install_phase(**options)
super(**options) super(**options)
delete_keyboard_layout_cache(**options) delete_keyboard_layout_cache(**options)

View File

@ -9,8 +9,6 @@ module Cask
# #
# @api private # @api private
class Mdimporter < Moved class Mdimporter < Moved
extend T::Sig
sig { returns(String) } sig { returns(String) }
def self.english_name def self.english_name
"Spotlight metadata importer" "Spotlight metadata importer"

View File

@ -10,8 +10,6 @@ module Cask
# #
# @api private # @api private
class Moved < Relocated class Moved < Relocated
extend T::Sig
sig { returns(String) } sig { returns(String) }
def self.english_description def self.english_description
"#{english_name}s" "#{english_name}s"

View File

@ -9,8 +9,6 @@ module Cask
# #
# @api private # @api private
class Prefpane < Moved class Prefpane < Moved
extend T::Sig
sig { returns(String) } sig { returns(String) }
def self.english_name def self.english_name
"Preference Pane" "Preference Pane"

View File

@ -9,8 +9,6 @@ module Cask
# #
# @api private # @api private
class Qlplugin < Moved class Qlplugin < Moved
extend T::Sig
sig { returns(String) } sig { returns(String) }
def self.english_name def self.english_name
"QuickLook Plugin" "QuickLook Plugin"

View File

@ -9,8 +9,6 @@ module Cask
# #
# @api private # @api private
class Relocated < AbstractArtifact class Relocated < AbstractArtifact
extend T::Sig
def self.from_args(cask, *args) def self.from_args(cask, *args)
source_string, target_hash = args source_string, target_hash = args

View File

@ -9,8 +9,6 @@ module Cask
# #
# @api private # @api private
class StageOnly < AbstractArtifact class StageOnly < AbstractArtifact
extend T::Sig
def self.from_args(cask, *args, **kwargs) def self.from_args(cask, *args, **kwargs)
if (args != [true] && args != ["true"]) || kwargs.present? if (args != [true] && args != ["true"]) || kwargs.present?
raise CaskInvalidError.new(cask.token, "'stage_only' takes only a single argument: true") raise CaskInvalidError.new(cask.token, "'stage_only' takes only a single argument: true")

View File

@ -9,8 +9,6 @@ module Cask
# #
# @api private # @api private
class Suite < Moved class Suite < Moved
extend T::Sig
sig { returns(String) } sig { returns(String) }
def self.english_name def self.english_name
"App Suite" "App Suite"

View File

@ -9,8 +9,6 @@ module Cask
# #
# @api private # @api private
class Symlinked < Relocated class Symlinked < Relocated
extend T::Sig
sig { returns(String) } sig { returns(String) }
def self.link_type_english_name def self.link_type_english_name
"Symlink" "Symlink"

View File

@ -9,8 +9,6 @@ module Cask
# #
# @api private # @api private
class Vst3Plugin < Moved class Vst3Plugin < Moved
extend T::Sig
sig { returns(String) } sig { returns(String) }
def self.english_name def self.english_name
"VST3 Plugin" "VST3 Plugin"

View File

@ -9,8 +9,6 @@ module Cask
# #
# @api private # @api private
class VstPlugin < Moved class VstPlugin < Moved
extend T::Sig
sig { returns(String) } sig { returns(String) }
def self.english_name def self.english_name
"VST Plugin" "VST Plugin"

View File

@ -14,8 +14,6 @@ module Cask
# #
# @api private # @api private
class Audit class Audit
extend T::Sig
extend Predicable extend Predicable
attr_reader :cask, :download attr_reader :cask, :download
@ -460,7 +458,9 @@ module Cask
return if !signing? || download.blank? || cask.url.blank? return if !signing? || download.blank? || cask.url.blank?
odebug "Auditing signing" odebug "Auditing signing"
artifacts = cask.artifacts.select { |k| k.is_a?(Artifact::Pkg) || k.is_a?(Artifact::App) } artifacts = cask.artifacts.select do |k|
k.is_a?(Artifact::Pkg) || k.is_a?(Artifact::App) || k.is_a?(Artifact::Binary)
end
return if artifacts.empty? return if artifacts.empty?

View File

@ -6,8 +6,6 @@ module Cask
# #
# @api private # @api private
module Cache module Cache
extend T::Sig
sig { returns(Pathname) } sig { returns(Pathname) }
def self.path def self.path
@path ||= HOMEBREW_CACHE/"Cask" @path ||= HOMEBREW_CACHE/"Cask"

View File

@ -13,8 +13,6 @@ module Cask
# #
# @api private # @api private
class Cask class Cask
extend T::Sig
extend Forwardable extend Forwardable
extend Predicable extend Predicable
extend APIHashable extend APIHashable
@ -114,24 +112,6 @@ module Cask
.reverse .reverse
end end
def os_versions
# TODO: use #to_hash_with_variations instead once all casks use on_system blocks
@os_versions ||= begin
version_os_hash = {}
actual_version = MacOS.full_version.to_s
MacOSVersions::SYMBOLS.each do |os_name, os_version|
MacOS.full_version = os_version
cask = CaskLoader.load(full_name)
version_os_hash[os_name] = cask.version if cask.version != version
end
version_os_hash
ensure
MacOS.full_version = actual_version if actual_version
end
end
def full_name def full_name
return token if tap.nil? return token if tap.nil?
return token if tap.user == "Homebrew" return token if tap.user == "Homebrew"
@ -307,7 +287,6 @@ module Cask
"url_specs" => url_specs, "url_specs" => url_specs,
"appcast" => appcast, "appcast" => appcast,
"version" => version, "version" => version,
"versions" => os_versions,
"installed" => versions.last, "installed" => versions.last,
"outdated" => outdated?, "outdated" => outdated?,
"sha256" => sha256, "sha256" => sha256,

View File

@ -13,7 +13,6 @@ module Cask
extend Context extend Context
module ILoader module ILoader
extend T::Sig
extend T::Helpers extend T::Helpers
interface! interface!
@ -110,8 +109,6 @@ module Cask
# Loads a cask from a URI. # Loads a cask from a URI.
class FromURILoader < FromPathLoader class FromURILoader < FromPathLoader
extend T::Sig
def self.can_load?(ref) def self.can_load?(ref)
# Cache compiled regex # Cache compiled regex
@uri_regex ||= begin @uri_regex ||= begin
@ -362,8 +359,6 @@ module Cask
# Pseudo-loader which raises an error when trying to load the corresponding cask. # Pseudo-loader which raises an error when trying to load the corresponding cask.
class NullLoader < FromPathLoader class NullLoader < FromPathLoader
extend T::Sig
def self.can_load?(*) def self.can_load?(*)
true true
end end

View File

@ -8,8 +8,6 @@ module Cask
# #
# @api private # @api private
module Caskroom module Caskroom
extend T::Sig
sig { returns(Pathname) } sig { returns(Pathname) }
def self.path def self.path
@path ||= HOMEBREW_PREFIX/"Caskroom" @path ||= HOMEBREW_PREFIX/"Caskroom"

View File

@ -1,33 +0,0 @@
# typed: true
# frozen_string_literal: true
require "optparse"
require "shellwords"
require "cli/parser"
require "extend/optparse"
require "cask/config"
require "cask/cmd/abstract_command"
require "cask/cmd/audit"
require "cask/cmd/install"
module Cask
# Implementation of the `brew cask` command-line interface.
#
# @api private
class Cmd
extend T::Sig
include Context
def self.parser(&block)
Homebrew::CLI::Parser.new do
instance_eval(&block) if block
cask_options
end
end
end
end

View File

@ -1,98 +0,0 @@
# typed: false
# frozen_string_literal: true
require "search"
module Cask
class Cmd
# Abstract superclass for all Cask implementations of commands.
#
# @api private
class AbstractCommand
extend T::Sig
extend T::Helpers
OPTIONS = [
[:switch, "--[no-]binaries", {
description: "Disable/enable linking of helper executables (default: enabled).",
env: :cask_opts_binaries,
}],
[:switch, "--require-sha", {
description: "Require all casks to have a checksum.",
env: :cask_opts_require_sha,
}],
[:switch, "--[no-]quarantine", {
description: "Disable/enable quarantining of downloads (default: enabled).",
env: :cask_opts_quarantine,
}],
].freeze
def self.parser(&block)
Cmd.parser do
instance_eval(&block) if block
OPTIONS.map(&:dup).each do |option|
kwargs = option.pop
send(*option, **kwargs)
end
end
end
sig { returns(String) }
def self.command_name
@command_name ||= name.sub(/^.*:/, "").gsub(/(.)([A-Z])/, '\1_\2').downcase
end
sig { returns(T::Boolean) }
def self.abstract?
name.split("::").last.match?(/^Abstract[^a-z]/)
end
sig { returns(T::Boolean) }
def self.visible?
true
end
sig { returns(String) }
def self.help
parser.generate_help_text
end
sig { returns(String) }
def self.short_description
description[/\A[^.]*\./]
end
def self.run(*args)
new(*args).run
end
attr_reader :args
def initialize(*args)
@args = self.class.parser.parse(args)
end
private
def casks(alternative: -> { [] })
return @casks if defined?(@casks)
@casks = args.named.empty? ? alternative.call : args.named.to_casks
rescue CaskUnavailableError => e
reason = [e.reason, *suggestion_message(e.token)].join(" ")
raise e.class.new(e.token, reason)
end
def suggestion_message(cask_token)
matches = Homebrew::Search.search_casks(cask_token)
if matches.one?
"Did you mean '#{matches.first}'?"
elsif !matches.empty?
"Did you mean one of these?\n#{Formatter.columns(matches.take(20))}"
end
end
end
end
end

View File

@ -1,110 +0,0 @@
# typed: false
# frozen_string_literal: true
require "utils/github/actions"
module Cask
class Cmd
# Cask implementation of the `brew audit` command.
#
# @api private
class Audit < AbstractCommand
extend T::Sig
def self.parser
super do
switch "--[no-]download",
description: "Audit the downloaded file"
switch "--[no-]appcast",
description: "Audit the appcast",
replacement: false
switch "--[no-]token-conflicts",
description: "Audit for token conflicts"
switch "--[no-]signing",
description: "Audit for signed apps, which is required on ARM"
switch "--[no-]strict",
description: "Run additional, stricter style checks"
switch "--[no-]online",
description: "Run additional, slower style checks that require a network connection"
switch "--new-cask",
description: "Run various additional style checks to determine if a new cask is eligible " \
"for Homebrew. This should be used when creating new casks and implies " \
"`--strict` and `--online`"
end
end
sig { void }
def run
casks = args.named.flat_map do |name|
next name if File.exist?(name)
next Tap.fetch(name).cask_files if name.count("/") == 1
name
end
casks = casks.map { |c| CaskLoader.load(c, config: Config.from_args(args)) }
any_named_args = casks.any?
casks = Cask.to_a if casks.empty?
results = self.class.audit_casks(
*casks,
download: args.download?,
online: args.online?,
strict: args.strict?,
signing: args.signing?,
new_cask: args.new_cask?,
token_conflicts: args.token_conflicts?,
quarantine: args.quarantine?,
any_named_args: any_named_args,
language: args.language,
only: [],
except: [],
)
failed_casks = results.reject { |_, result| result[:errors].empty? }.map(&:first)
return if failed_casks.empty?
raise CaskError, "audit failed for casks: #{failed_casks.join(" ")}"
end
def self.audit_casks(
*casks,
download:,
online:,
strict:,
signing:,
new_cask:,
token_conflicts:,
quarantine:,
any_named_args:,
language:,
only:,
except:
)
options = {
audit_download: download,
audit_online: online,
audit_strict: strict,
audit_signing: signing,
audit_new_cask: new_cask,
audit_token_conflicts: token_conflicts,
quarantine: quarantine,
language: language,
any_named_args: any_named_args,
only: only,
except: except,
}.compact
options[:quarantine] = true if options[:quarantine].nil?
Homebrew.auditing = true
require "cask/auditor"
casks.to_h do |cask|
odebug "Auditing Cask #{cask}"
[cask.sourcefile_path, { errors: Auditor.audit(cask, **options), warnings: [] }]
end
end
end
end
end

View File

@ -1,116 +0,0 @@
# typed: false
# frozen_string_literal: true
require "cask_dependent"
module Cask
class Cmd
# Cask implementation of the `brew install` command.
#
# @api private
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.",
}],
[:switch, "--zap", {
description: "For use with `brew reinstall --cask`. Remove all files associated with a cask. " \
"*May remove files which are shared between applications.*",
}],
].freeze
def self.parser(&block)
super do
switch "--force",
description: "Force overwriting existing files."
OPTIONS.map(&:dup).each do |option|
kwargs = option.pop
send(*option, **kwargs)
end
instance_eval(&block) if block
end
end
sig { void }
def run
self.class.install_casks(
*casks,
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?,
quiet: args.quiet?,
zap: args.zap?,
)
end
def self.install_casks(
*casks,
verbose: nil,
force: nil,
adopt: nil,
binaries: nil,
skip_cask_deps: nil,
require_sha: nil,
quarantine: nil,
quiet: nil,
zap: nil,
dry_run: nil
)
options = {
verbose: verbose,
force: force,
adopt: adopt,
binaries: binaries,
skip_cask_deps: skip_cask_deps,
require_sha: require_sha,
quarantine: quarantine,
quiet: quiet,
zap: zap,
}.compact
options[:quarantine] = true if options[:quarantine].nil?
if dry_run
if (casks_to_install = casks.reject(&:installed?).presence)
ohai "Would install #{::Utils.pluralize("cask", casks_to_install.count, include_count: true)}:"
puts casks_to_install.map(&:full_name).join(" ")
end
casks.each do |cask|
dep_names = CaskDependent.new(cask)
.runtime_dependencies
.reject(&:installed?)
.map(&:to_formula)
.map(&:name)
next if dep_names.blank?
ohai "Would install #{::Utils.pluralize("dependenc", dep_names.count, plural: "ies", singular: "y",
include_count: true)} for #{cask.full_name}:"
puts dep_names.join(" ")
end
return
end
require "cask/installer"
casks.each do |cask|
Installer.new(cask, **options).install
rescue CaskAlreadyInstalledError => e
opoo e.message
end
end
end
end
end

View File

@ -11,8 +11,6 @@ module Cask
# #
# @api private # @api private
class Config class Config
extend T::Sig
DEFAULT_DIRS = { DEFAULT_DIRS = {
appdir: "/Applications", appdir: "/Applications",
keyboard_layoutdir: "/Library/Keyboard Layouts", keyboard_layoutdir: "/Library/Keyboard Layouts",

View File

@ -6,8 +6,6 @@ module Cask
# #
# @api private # @api private
module Denylist module Denylist
extend T::Sig
sig { params(name: String).returns(T.nilable(String)) } sig { params(name: String).returns(T.nilable(String)) }
def self.reason(name) def self.reason(name)
case name case name

View File

@ -11,7 +11,6 @@ module Cask
# #
# @api private # @api private
class DependsOn < SimpleDelegator class DependsOn < SimpleDelegator
extend T::Sig
VALID_KEYS = Set.new([ VALID_KEYS = Set.new([
:formula, :formula,
:cask, :cask,

View File

@ -7,8 +7,6 @@ module Cask
# #
# @api private # @api private
class Version < ::String class Version < ::String
extend T::Sig
DIVIDERS = { DIVIDERS = {
"." => :dots, "." => :dots,
"-" => :hyphens, "-" => :hyphens,

View File

@ -11,8 +11,6 @@ module Cask
# #
# @api private # @api private
class MultipleCaskErrors < CaskError class MultipleCaskErrors < CaskError
extend T::Sig
def initialize(errors) def initialize(errors)
super() super()
@ -32,8 +30,6 @@ module Cask
# #
# @api private # @api private
class AbstractCaskErrorWithToken < CaskError class AbstractCaskErrorWithToken < CaskError
extend T::Sig
sig { returns(String) } sig { returns(String) }
attr_reader :token attr_reader :token
@ -52,8 +48,6 @@ module Cask
# #
# @api private # @api private
class CaskNotInstalledError < AbstractCaskErrorWithToken class CaskNotInstalledError < AbstractCaskErrorWithToken
extend T::Sig
sig { returns(String) } sig { returns(String) }
def to_s def to_s
"Cask '#{token}' is not installed." "Cask '#{token}' is not installed."
@ -64,8 +58,6 @@ module Cask
# #
# @api private # @api private
class CaskConflictError < AbstractCaskErrorWithToken class CaskConflictError < AbstractCaskErrorWithToken
extend T::Sig
attr_reader :conflicting_cask attr_reader :conflicting_cask
def initialize(token, conflicting_cask) def initialize(token, conflicting_cask)
@ -83,8 +75,6 @@ module Cask
# #
# @api private # @api private
class CaskUnavailableError < AbstractCaskErrorWithToken class CaskUnavailableError < AbstractCaskErrorWithToken
extend T::Sig
sig { returns(String) } sig { returns(String) }
def to_s def to_s
"Cask '#{token}' is unavailable#{reason.empty? ? "." : ": #{reason}"}" "Cask '#{token}' is unavailable#{reason.empty? ? "." : ": #{reason}"}"
@ -95,8 +85,6 @@ module Cask
# #
# @api private # @api private
class CaskUnreadableError < CaskUnavailableError class CaskUnreadableError < CaskUnavailableError
extend T::Sig
sig { returns(String) } sig { returns(String) }
def to_s def to_s
"Cask '#{token}' is unreadable#{reason.empty? ? "." : ": #{reason}"}" "Cask '#{token}' is unreadable#{reason.empty? ? "." : ": #{reason}"}"
@ -107,8 +95,6 @@ module Cask
# #
# @api private # @api private
class TapCaskUnavailableError < CaskUnavailableError class TapCaskUnavailableError < CaskUnavailableError
extend T::Sig
attr_reader :tap attr_reader :tap
def initialize(tap, token) def initialize(tap, token)
@ -128,8 +114,6 @@ module Cask
# #
# @api private # @api private
class TapCaskAmbiguityError < CaskError class TapCaskAmbiguityError < CaskError
extend T::Sig
def initialize(ref, loaders) def initialize(ref, loaders)
super <<~EOS super <<~EOS
Cask #{ref} exists in multiple taps: Cask #{ref} exists in multiple taps:
@ -142,8 +126,6 @@ module Cask
# #
# @api private # @api private
class CaskAlreadyCreatedError < AbstractCaskErrorWithToken class CaskAlreadyCreatedError < AbstractCaskErrorWithToken
extend T::Sig
sig { returns(String) } sig { returns(String) }
def to_s def to_s
%Q(Cask '#{token}' already exists. Run #{Formatter.identifier("brew edit --cask #{token}")} to edit it.) %Q(Cask '#{token}' already exists. Run #{Formatter.identifier("brew edit --cask #{token}")} to edit it.)
@ -154,8 +136,6 @@ module Cask
# #
# @api private # @api private
class CaskAlreadyInstalledError < AbstractCaskErrorWithToken class CaskAlreadyInstalledError < AbstractCaskErrorWithToken
extend T::Sig
sig { returns(String) } sig { returns(String) }
def to_s def to_s
<<~EOS <<~EOS
@ -171,8 +151,6 @@ module Cask
# #
# @api private # @api private
class CaskCyclicDependencyError < AbstractCaskErrorWithToken class CaskCyclicDependencyError < AbstractCaskErrorWithToken
extend T::Sig
sig { returns(String) } sig { returns(String) }
def to_s def to_s
"Cask '#{token}' includes cyclic dependencies on other Casks#{reason.empty? ? "." : ": #{reason}"}" "Cask '#{token}' includes cyclic dependencies on other Casks#{reason.empty? ? "." : ": #{reason}"}"
@ -183,8 +161,6 @@ module Cask
# #
# @api private # @api private
class CaskSelfReferencingDependencyError < CaskCyclicDependencyError class CaskSelfReferencingDependencyError < CaskCyclicDependencyError
extend T::Sig
sig { returns(String) } sig { returns(String) }
def to_s def to_s
"Cask '#{token}' depends on itself." "Cask '#{token}' depends on itself."
@ -195,8 +171,6 @@ module Cask
# #
# @api private # @api private
class CaskUnspecifiedError < CaskError class CaskUnspecifiedError < CaskError
extend T::Sig
sig { returns(String) } sig { returns(String) }
def to_s def to_s
"This command requires a Cask token." "This command requires a Cask token."
@ -207,8 +181,6 @@ module Cask
# #
# @api private # @api private
class CaskInvalidError < AbstractCaskErrorWithToken class CaskInvalidError < AbstractCaskErrorWithToken
extend T::Sig
sig { returns(String) } sig { returns(String) }
def to_s def to_s
"Cask '#{token}' definition is invalid#{reason.empty? ? "." : ": #{reason}"}" "Cask '#{token}' definition is invalid#{reason.empty? ? "." : ": #{reason}"}"
@ -228,8 +200,6 @@ module Cask
# #
# @api private # @api private
class CaskQuarantineError < CaskError class CaskQuarantineError < CaskError
extend T::Sig
attr_reader :path, :reason attr_reader :path, :reason
def initialize(path, reason) def initialize(path, reason)
@ -257,8 +227,6 @@ module Cask
# #
# @api private # @api private
class CaskQuarantinePropagationError < CaskQuarantineError class CaskQuarantinePropagationError < CaskQuarantineError
extend T::Sig
sig { returns(String) } sig { returns(String) }
def to_s def to_s
s = +"Failed to quarantine one or more files within #{path}." s = +"Failed to quarantine one or more files within #{path}."
@ -277,8 +245,6 @@ module Cask
# #
# @api private # @api private
class CaskQuarantineReleaseError < CaskQuarantineError class CaskQuarantineReleaseError < CaskQuarantineError
extend T::Sig
sig { returns(String) } sig { returns(String) }
def to_s def to_s
s = +"Failed to release #{path} from quarantine." s = +"Failed to release #{path} from quarantine."

View File

@ -16,8 +16,6 @@ module Cask
# #
# @api private # @api private
class Installer class Installer
extend T::Sig
extend Predicable extend Predicable
def initialize(cask, command: SystemCommand, force: false, adopt: false, def initialize(cask, command: SystemCommand, force: false, adopt: false,

View File

@ -8,8 +8,6 @@ module Cask
# #
# @api private # @api private
class Pkg class Pkg
extend T::Sig
sig { params(regexp: String, command: T.class_of(SystemCommand)).returns(T::Array[Pkg]) } sig { params(regexp: String, command: T.class_of(SystemCommand)).returns(T::Array[Pkg]) }
def self.all_matching(regexp, command) def self.all_matching(regexp, command)
command.run("/usr/sbin/pkgutil", args: ["--pkgs=#{regexp}"]).stdout.split("\n").map do |package_id| command.run("/usr/sbin/pkgutil", args: ["--pkgs=#{regexp}"]).stdout.split("\n").map do |package_id|

View File

@ -9,8 +9,6 @@ module Cask
# #
# @api private # @api private
module Quarantine module Quarantine
extend T::Sig
QUARANTINE_ATTRIBUTE = "com.apple.quarantine" QUARANTINE_ATTRIBUTE = "com.apple.quarantine"
QUARANTINE_SCRIPT = (HOMEBREW_LIBRARY_PATH/"cask/utils/quarantine.swift").freeze QUARANTINE_SCRIPT = (HOMEBREW_LIBRARY_PATH/"cask/utils/quarantine.swift").freeze

View File

@ -8,8 +8,6 @@ module Cask
# #
# @api private # @api private
module Staged module Staged
extend T::Sig
# FIXME: Enable cop again when https://github.com/sorbet/sorbet/issues/3532 is fixed. # FIXME: Enable cop again when https://github.com/sorbet/sorbet/issues/3532 is fixed.
# rubocop:disable Style/MutableConstant # rubocop:disable Style/MutableConstant
Paths = T.type_alias { T.any(String, Pathname, T::Array[T.any(String, Pathname)]) } Paths = T.type_alias { T.any(String, Pathname, T::Array[T.any(String, Pathname)]) }

View File

@ -7,8 +7,6 @@ require "cask/config"
module Cask module Cask
# @api private # @api private
class Upgrade class Upgrade
extend T::Sig
sig { sig {
params( params(
casks: Cask, casks: Cask,

View File

@ -5,12 +5,8 @@
# #
# @api private # @api private
class URL < Delegator class URL < Delegator
extend T::Sig
# @api private # @api private
class DSL class DSL
extend T::Sig
attr_reader :uri, :specs, attr_reader :uri, :specs,
:verified, :using, :verified, :using,
:tag, :branch, :revisions, :revision, :tag, :branch, :revisions, :revision,
@ -79,12 +75,8 @@ class URL < Delegator
# @api private # @api private
class BlockDSL class BlockDSL
extend T::Sig
# To access URL associated with page contents. # To access URL associated with page contents.
module PageWithURL module PageWithURL
extend T::Sig
# @api public # @api public
sig { returns(URI::Generic) } sig { returns(URI::Generic) }
attr_accessor :url attr_accessor :url

View File

@ -2,9 +2,7 @@
# frozen_string_literal: true # frozen_string_literal: true
require "utils/user" require "utils/user"
require "yaml"
require "open3" require "open3"
require "stringio"
BUG_REPORTS_URL = "https://github.com/Homebrew/homebrew-cask#reporting-bugs" BUG_REPORTS_URL = "https://github.com/Homebrew/homebrew-cask#reporting-bugs"
@ -13,8 +11,6 @@ module Cask
# #
# @api private # @api private
module Utils module Utils
extend T::Sig
def self.gain_permissions_remove(path, command: SystemCommand) def self.gain_permissions_remove(path, command: SystemCommand)
if path.respond_to?(:rmtree) && path.exist? if path.respond_to?(:rmtree) && path.exist?
gain_permissions(path, ["-R"], command) do |p| gain_permissions(path, ["-R"], command) do |p|

View File

@ -16,8 +16,6 @@ module Homebrew
private_constant :CLEANUP_DEFAULT_DAYS private_constant :CLEANUP_DEFAULT_DAYS
class << self class << self
extend T::Sig
sig { params(pathname: Pathname).returns(T::Boolean) } sig { params(pathname: Pathname).returns(T::Boolean) }
def incomplete?(pathname) def incomplete?(pathname)
pathname.extname.end_with?(".incomplete") pathname.extname.end_with?(".incomplete")

View File

@ -6,8 +6,6 @@ require "ostruct"
module Homebrew module Homebrew
module CLI module CLI
class Args < OpenStruct class Args < OpenStruct
extend T::Sig
attr_reader :options_only, :flags_only attr_reader :options_only, :flags_only
# undefine tap to allow --tap argument # undefine tap to allow --tap argument

View File

@ -11,8 +11,6 @@ module Homebrew
# #
# @api private # @api private
class NamedArgs < Array class NamedArgs < Array
extend T::Sig
def initialize(*args, parent: Args.new, override_spec: nil, force_bottle: false, flags: [], cask_options: false) def initialize(*args, parent: Args.new, override_spec: nil, force_bottle: false, flags: [], cask_options: false)
require "cask/cask" require "cask/cask"
require "cask/cask_loader" require "cask/cask_loader"

View File

@ -15,8 +15,6 @@ HIDDEN_DESC_PLACEHOLDER = "@@HIDDEN@@"
module Homebrew module Homebrew
module CLI module CLI
class Parser class Parser
extend T::Sig
attr_reader :processed_options, :hide_from_man_page, :named_args_type attr_reader :processed_options, :hide_from_man_page, :named_args_type
def self.from_cmd_path(cmd_path) def self.from_cmd_path(cmd_path)
@ -680,8 +678,6 @@ module Homebrew
end end
class MaxNamedArgumentsError < UsageError class MaxNamedArgumentsError < UsageError
extend T::Sig
sig { params(maximum: Integer, types: T::Array[Symbol]).void } sig { params(maximum: Integer, types: T::Array[Symbol]).void }
def initialize(maximum, types: []) def initialize(maximum, types: [])
super case maximum super case maximum
@ -698,8 +694,6 @@ module Homebrew
end end
class MinNamedArgumentsError < UsageError class MinNamedArgumentsError < UsageError
extend T::Sig
sig { params(minimum: Integer, types: T::Array[Symbol]).void } sig { params(minimum: Integer, types: T::Array[Symbol]).void }
def initialize(minimum, types: []) def initialize(minimum, types: [])
types << :named if types.empty? types << :named if types.empty?
@ -711,8 +705,6 @@ module Homebrew
end end
class NumberOfNamedArgumentsError < UsageError class NumberOfNamedArgumentsError < UsageError
extend T::Sig
sig { params(minimum: Integer, types: T::Array[Symbol]).void } sig { params(minimum: Integer, types: T::Array[Symbol]).void }
def initialize(minimum, types: []) def initialize(minimum, types: [])
types << :named if types.empty? types << :named if types.empty?

View File

@ -6,8 +6,6 @@ require "cli/parser"
require "cask/download" require "cask/download"
module Homebrew module Homebrew
extend T::Sig
extend Fetch extend Fetch
sig { returns(CLI::Parser) } sig { returns(CLI::Parser) }

View File

@ -2,8 +2,6 @@
# frozen_string_literal: true # frozen_string_literal: true
module Homebrew module Homebrew
extend T::Sig
module_function module_function
sig { returns(CLI::Parser) } sig { returns(CLI::Parser) }

View File

@ -7,8 +7,6 @@ require "utils/shell"
require "cli/parser" require "cli/parser"
module Homebrew module Homebrew
extend T::Sig
module_function module_function
sig { returns(CLI::Parser) } sig { returns(CLI::Parser) }

View File

@ -4,8 +4,6 @@
require "cli/parser" require "cli/parser"
module Homebrew module Homebrew
extend T::Sig
sig { returns(CLI::Parser) } sig { returns(CLI::Parser) }
def self.__prefix_args def self.__prefix_args
Homebrew::CLI::Parser.new do Homebrew::CLI::Parser.new do

View File

@ -4,8 +4,6 @@
require "cli/parser" require "cli/parser"
module Homebrew module Homebrew
extend T::Sig
module_function module_function
sig { returns(CLI::Parser) } sig { returns(CLI::Parser) }

View File

@ -4,8 +4,6 @@
require "cli/parser" require "cli/parser"
module Homebrew module Homebrew
extend T::Sig
module_function module_function
sig { returns(CLI::Parser) } sig { returns(CLI::Parser) }

View File

@ -5,8 +5,6 @@ require "cleanup"
require "cli/parser" require "cli/parser"
module Homebrew module Homebrew
extend T::Sig
module_function module_function
sig { returns(CLI::Parser) } sig { returns(CLI::Parser) }

View File

@ -4,8 +4,6 @@
require "cli/parser" require "cli/parser"
module Homebrew module Homebrew
extend T::Sig
module_function module_function
sig { returns(CLI::Parser) } sig { returns(CLI::Parser) }

View File

@ -5,8 +5,6 @@ require "cli/parser"
require "completions" require "completions"
module Homebrew module Homebrew
extend T::Sig
module_function module_function
sig { returns(CLI::Parser) } sig { returns(CLI::Parser) }

View File

@ -5,8 +5,6 @@ require "system_config"
require "cli/parser" require "cli/parser"
module Homebrew module Homebrew
extend T::Sig
module_function module_function
sig { returns(CLI::Parser) } sig { returns(CLI::Parser) }

View File

@ -7,8 +7,6 @@ require "cask/caskroom"
require "dependencies_helpers" require "dependencies_helpers"
module Homebrew module Homebrew
extend T::Sig
extend DependenciesHelpers extend DependenciesHelpers
sig { returns(CLI::Parser) } sig { returns(CLI::Parser) }

View File

@ -7,8 +7,6 @@ require "description_cache_store"
require "cli/parser" require "cli/parser"
module Homebrew module Homebrew
extend T::Sig
module_function module_function
sig { returns(CLI::Parser) } sig { returns(CLI::Parser) }

View File

@ -4,8 +4,6 @@
require "cli/parser" require "cli/parser"
module Homebrew module Homebrew
extend T::Sig
module_function module_function
sig { returns(CLI::Parser) } sig { returns(CLI::Parser) }

View File

@ -4,8 +4,6 @@
require "cli/parser" require "cli/parser"
module Homebrew module Homebrew
extend T::Sig
module_function module_function
sig { returns(CLI::Parser) } sig { returns(CLI::Parser) }

View File

@ -6,8 +6,6 @@ require "cli/parser"
require "cask/caskroom" require "cask/caskroom"
module Homebrew module Homebrew
extend T::Sig
sig { returns(CLI::Parser) } sig { returns(CLI::Parser) }
def self.doctor_args def self.doctor_args
Homebrew::CLI::Parser.new do Homebrew::CLI::Parser.new do

View File

@ -7,8 +7,6 @@ require "cli/parser"
require "cask/download" require "cask/download"
module Homebrew module Homebrew
extend T::Sig
extend Fetch extend Fetch
FETCH_MAX_TRIES = 5 FETCH_MAX_TRIES = 5

View File

@ -9,8 +9,6 @@ require "socket"
require "cli/parser" require "cli/parser"
module Homebrew module Homebrew
extend T::Sig
extend Install extend Install
module_function module_function

View File

@ -5,8 +5,6 @@ require "cli/parser"
require "formula" require "formula"
module Homebrew module Homebrew
extend T::Sig
module_function module_function
sig { returns(CLI::Parser) } sig { returns(CLI::Parser) }

View File

@ -14,8 +14,6 @@ require "deprecate_disable"
require "api" require "api"
module Homebrew module Homebrew
extend T::Sig
module_function module_function
VALID_DAYS = %w[30 90 365].freeze VALID_DAYS = %w[30 90 365].freeze

View File

@ -2,8 +2,8 @@
# frozen_string_literal: true # frozen_string_literal: true
require "cask/config" require "cask/config"
require "cask/cmd" require "cask/installer"
require "cask/cmd/install" require "cask_dependent"
require "missing_formula" require "missing_formula"
require "formula_installer" require "formula_installer"
require "development_tools" require "development_tools"
@ -13,12 +13,8 @@ require "cli/parser"
require "upgrade" require "upgrade"
module Homebrew module Homebrew
extend T::Sig
module_function
sig { returns(CLI::Parser) } sig { returns(CLI::Parser) }
def install_args def self.install_args
Homebrew::CLI::Parser.new do Homebrew::CLI::Parser.new do
description <<~EOS description <<~EOS
Install a <formula> or <cask>. Additional options specific to a <formula> may be Install a <formula> or <cask>. Additional options specific to a <formula> may be
@ -129,8 +125,29 @@ module Homebrew
formula_options formula_options
[ [
[:switch, "--cask", "--casks", { description: "Treat all named arguments as casks." }], [:switch, "--cask", "--casks", { description: "Treat all named arguments as casks." }],
*Cask::Cmd::AbstractCommand::OPTIONS.map(&:dup), [:switch, "--[no-]binaries", {
*Cask::Cmd::Install::OPTIONS.map(&:dup), description: "Disable/enable linking of helper executables (default: enabled).",
env: :cask_opts_binaries,
}],
[:switch, "--require-sha", {
description: "Require all casks to have a checksum.",
env: :cask_opts_require_sha,
}],
[:switch, "--[no-]quarantine", {
description: "Disable/enable quarantining of downloads (default: enabled).",
env: :cask_opts_quarantine,
}],
[: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.",
}],
[:switch, "--zap", {
description: "For use with `brew reinstall --cask`. Remove all files associated with a cask. " \
"*May remove files which are shared between applications.*",
}],
].each do |args| ].each do |args|
options = args.pop options = args.pop
send(*args, **options) send(*args, **options)
@ -146,7 +163,7 @@ module Homebrew
end end
end end
def install def self.install
args = install_args.parse args = install_args.parse
if args.env.present? if args.env.present?
@ -178,25 +195,49 @@ module Homebrew
begin begin
formulae, casks = args.named.to_formulae_and_casks formulae, casks = args.named.to_formulae_and_casks
.partition { |formula_or_cask| formula_or_cask.is_a?(Formula) } .partition { |formula_or_cask| formula_or_cask.is_a?(Formula) }
rescue FormulaOrCaskUnavailableError, Cask::CaskUnavailableError => e rescue FormulaOrCaskUnavailableError, Cask::CaskUnavailableError
retry if Tap.install_default_cask_tap_if_necessary(force: args.cask?) retry if Tap.install_default_cask_tap_if_necessary(force: args.cask?)
raise e raise
end end
if casks.any? if casks.any?
Cask::Cmd::Install.install_casks(
*casks, if args.dry_run?
binaries: args.binaries?, if (casks_to_install = casks.reject(&:installed?).presence)
verbose: args.verbose?, ohai "Would install #{::Utils.pluralize("cask", casks_to_install.count, include_count: true)}:"
force: args.force?, puts casks_to_install.map(&:full_name).join(" ")
adopt: args.adopt?, end
require_sha: args.require_sha?, casks.each do |cask|
skip_cask_deps: args.skip_cask_deps?, dep_names = CaskDependent.new(cask)
quarantine: args.quarantine?, .runtime_dependencies
quiet: args.quiet?, .reject(&:installed?)
dry_run: args.dry_run?, .map(&:to_formula)
) .map(&:name)
next if dep_names.blank?
ohai "Would install #{::Utils.pluralize("dependenc", dep_names.count, plural: "ies", singular: "y",
include_count: true)} for #{cask.full_name}:"
puts dep_names.join(" ")
end
return
end
require "cask/installer"
casks.each do |cask|
Cask::Installer.new(cask,
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?,
quiet: args.quiet?).install
rescue Cask::CaskAlreadyInstalledError => e
opoo e.message
end
end end
# if the user's flags will prevent bottle only-installations when no # if the user's flags will prevent bottle only-installations when no

View File

@ -5,8 +5,6 @@ require "formula"
require "cli/parser" require "cli/parser"
module Homebrew module Homebrew
extend T::Sig
module_function module_function
sig { returns(CLI::Parser) } sig { returns(CLI::Parser) }

View File

@ -6,8 +6,6 @@ require "cli/parser"
require "unlink" require "unlink"
module Homebrew module Homebrew
extend T::Sig
module_function module_function
sig { returns(CLI::Parser) } sig { returns(CLI::Parser) }

View File

@ -7,8 +7,6 @@ require "cli/parser"
require "cask/list" require "cask/list"
module Homebrew module Homebrew
extend T::Sig
module_function module_function
sig { returns(CLI::Parser) } sig { returns(CLI::Parser) }

View File

@ -4,8 +4,6 @@
require "cli/parser" require "cli/parser"
module Homebrew module Homebrew
extend T::Sig
sig { returns(CLI::Parser) } sig { returns(CLI::Parser) }
def self.log_args def self.log_args
Homebrew::CLI::Parser.new do Homebrew::CLI::Parser.new do

View File

@ -5,8 +5,6 @@ require "migrator"
require "cli/parser" require "cli/parser"
module Homebrew module Homebrew
extend T::Sig
module_function module_function
sig { returns(CLI::Parser) } sig { returns(CLI::Parser) }

View File

@ -7,8 +7,6 @@ require "diagnostic"
require "cli/parser" require "cli/parser"
module Homebrew module Homebrew
extend T::Sig
module_function module_function
sig { returns(CLI::Parser) } sig { returns(CLI::Parser) }

View File

@ -5,8 +5,6 @@ require "formula"
require "options" require "options"
module Homebrew module Homebrew
extend T::Sig
module_function module_function
sig { returns(CLI::Parser) } sig { returns(CLI::Parser) }

View File

@ -4,13 +4,10 @@
require "formula" require "formula"
require "keg" require "keg"
require "cli/parser" require "cli/parser"
require "cask/cmd"
require "cask/caskroom" require "cask/caskroom"
require "api" require "api"
module Homebrew module Homebrew
extend T::Sig
sig { returns(CLI::Parser) } sig { returns(CLI::Parser) }
def self.outdated_args def self.outdated_args
Homebrew::CLI::Parser.new do Homebrew::CLI::Parser.new do

View File

@ -5,8 +5,6 @@ require "formula"
require "cli/parser" require "cli/parser"
module Homebrew module Homebrew
extend T::Sig
module_function module_function
sig { returns(CLI::Parser) } sig { returns(CLI::Parser) }

View File

@ -6,8 +6,6 @@ require "formula_installer"
require "cli/parser" require "cli/parser"
module Homebrew module Homebrew
extend T::Sig
module_function module_function
sig { returns(CLI::Parser) } sig { returns(CLI::Parser) }

View File

@ -6,8 +6,6 @@ require "cli/parser"
require "env_config" require "env_config"
module Homebrew module Homebrew
extend T::Sig
module_function module_function
sig { returns(CLI::Parser) } sig { returns(CLI::Parser) }

View File

@ -8,7 +8,6 @@ require "install"
require "reinstall" require "reinstall"
require "cli/parser" require "cli/parser"
require "cleanup" require "cleanup"
require "cask/cmd"
require "cask/utils" require "cask/utils"
require "cask/macos" require "cask/macos"
require "cask/reinstall" require "cask/reinstall"
@ -16,12 +15,8 @@ require "upgrade"
require "api" require "api"
module Homebrew module Homebrew
extend T::Sig
module_function
sig { returns(CLI::Parser) } sig { returns(CLI::Parser) }
def reinstall_args def self.reinstall_args
Homebrew::CLI::Parser.new do Homebrew::CLI::Parser.new do
description <<~EOS description <<~EOS
Uninstall and then reinstall a <formula> or <cask> using the same options it was Uninstall and then reinstall a <formula> or <cask> using the same options it was
@ -77,8 +72,29 @@ module Homebrew
formula_options formula_options
[ [
[:switch, "--cask", "--casks", { description: "Treat all named arguments as casks." }], [:switch, "--cask", "--casks", { description: "Treat all named arguments as casks." }],
*Cask::Cmd::AbstractCommand::OPTIONS.map(&:dup), [:switch, "--[no-]binaries", {
*Cask::Cmd::Install::OPTIONS.map(&:dup), description: "Disable/enable linking of helper executables (default: enabled).",
env: :cask_opts_binaries,
}],
[:switch, "--require-sha", {
description: "Require all casks to have a checksum.",
env: :cask_opts_require_sha,
}],
[:switch, "--[no-]quarantine", {
description: "Disable/enable quarantining of downloads (default: enabled).",
env: :cask_opts_quarantine,
}],
[: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.",
}],
[:switch, "--zap", {
description: "For use with `brew reinstall --cask`. Remove all files associated with a cask. " \
"*May remove files which are shared between applications.*",
}],
].each do |args| ].each do |args|
options = args.pop options = args.pop
send(*args, **options) send(*args, **options)
@ -92,7 +108,7 @@ module Homebrew
end end
end end
def reinstall def self.reinstall
args = reinstall_args.parse args = reinstall_args.parse
formulae, casks = args.named.to_formulae_and_casks(method: :resolve) formulae, casks = args.named.to_formulae_and_casks(method: :resolve)

View File

@ -8,8 +8,6 @@ require "cli/parser"
require "search" require "search"
module Homebrew module Homebrew
extend T::Sig
module_function module_function
PACKAGE_MANAGERS = { PACKAGE_MANAGERS = {

View File

@ -4,8 +4,6 @@
require "cli/parser" require "cli/parser"
module Homebrew module Homebrew
extend T::Sig
module_function module_function
sig { returns(CLI::Parser) } sig { returns(CLI::Parser) }

View File

@ -4,8 +4,6 @@
require "cli/parser" require "cli/parser"
module Homebrew module Homebrew
extend T::Sig
module_function module_function
sig { returns(CLI::Parser) } sig { returns(CLI::Parser) }

View File

@ -13,8 +13,6 @@ require "cask/uninstall"
require "uninstall" require "uninstall"
module Homebrew module Homebrew
extend T::Sig
module_function module_function
sig { returns(CLI::Parser) } sig { returns(CLI::Parser) }

View File

@ -5,8 +5,6 @@ require "cli/parser"
require "unlink" require "unlink"
module Homebrew module Homebrew
extend T::Sig
module_function module_function
sig { returns(CLI::Parser) } sig { returns(CLI::Parser) }

View File

@ -5,8 +5,6 @@ require "formula"
require "cli/parser" require "cli/parser"
module Homebrew module Homebrew
extend T::Sig
module_function module_function
sig { returns(CLI::Parser) } sig { returns(CLI::Parser) }

View File

@ -4,8 +4,6 @@
require "cli/parser" require "cli/parser"
module Homebrew module Homebrew
extend T::Sig
module_function module_function
sig { returns(CLI::Parser) } sig { returns(CLI::Parser) }

View File

@ -11,8 +11,6 @@ require "settings"
require "linuxbrew-core-migration" require "linuxbrew-core-migration"
module Homebrew module Homebrew
extend T::Sig
module_function module_function
def auto_update_header(args:) def auto_update_header(args:)
@ -607,8 +605,6 @@ class Reporter
end end
class ReporterHub class ReporterHub
extend T::Sig
extend Forwardable extend Forwardable
attr_reader :reporters attr_reader :reporters

View File

@ -5,15 +5,12 @@ require "cli/parser"
require "formula_installer" require "formula_installer"
require "install" require "install"
require "upgrade" require "upgrade"
require "cask/cmd"
require "cask/utils" require "cask/utils"
require "cask/upgrade" require "cask/upgrade"
require "cask/macos" require "cask/macos"
require "api" require "api"
module Homebrew module Homebrew
extend T::Sig
module_function module_function
sig { returns(CLI::Parser) } sig { returns(CLI::Parser) }
@ -100,7 +97,18 @@ module Homebrew
[:switch, "--greedy-auto-updates", { [:switch, "--greedy-auto-updates", {
description: "Also include casks with `auto_updates true`.", description: "Also include casks with `auto_updates true`.",
}], }],
*Cask::Cmd::AbstractCommand::OPTIONS.map(&:dup), [:switch, "--[no-]binaries", {
description: "Disable/enable linking of helper executables (default: enabled).",
env: :cask_opts_binaries,
}],
[:switch, "--require-sha", {
description: "Require all casks to have a checksum.",
env: :cask_opts_require_sha,
}],
[:switch, "--[no-]quarantine", {
description: "Disable/enable quarantining of downloads (default: enabled).",
env: :cask_opts_quarantine,
}],
].each do |args| ].each do |args|
options = args.pop options = args.pop
send(*args, **options) send(*args, **options)

Some files were not shown because too many files have changed in this diff Show More