dev-cmd/typecheck: add --all switch

This commit is contained in:
Bo Anderson 2022-05-02 20:59:43 +01:00
parent 48bf0cc7ad
commit 2ca517c79a
No known key found for this signature in database
GPG Key ID: 3DB94E204E137D65
6 changed files with 19 additions and 2 deletions

View File

@ -20,6 +20,9 @@ module Homebrew
description: "Silence all non-critical errors." description: "Silence all non-critical errors."
switch "--update", switch "--update",
description: "Update RBI files." description: "Update RBI files."
switch "--all",
depends_on: "--update",
description: "Regenerate all RBI files rather than just updated gems."
switch "--suggest-typed", switch "--suggest-typed",
depends_on: "--update", depends_on: "--update",
description: "Try upgrading `typed` sigils." description: "Try upgrading `typed` sigils."
@ -52,9 +55,11 @@ module Homebrew
"did_you_mean", # RBI file is already provided by Sorbet "did_you_mean", # RBI file is already provided by Sorbet
"webrobots", # RBI file is bugged "webrobots", # RBI file is bugged
] ]
tapioca_args = ["--exclude", *excluded_gems]
tapioca_args << "--all" if args.all?
ohai "Updating Tapioca RBI files..." ohai "Updating Tapioca RBI files..."
system "bundle", "exec", "tapioca", "gem", "--exclude", *excluded_gems system "bundle", "exec", "tapioca", "gem", *tapioca_args
system "bundle", "exec", "parlour" system "bundle", "exec", "parlour"
system "bundle", "exec", "srb", "rbi", "hidden-definitions" system "bundle", "exec", "srb", "rbi", "hidden-definitions"
system "bundle", "exec", "srb", "rbi", "todo" system "bundle", "exec", "srb", "rbi", "todo"

View File

@ -1965,6 +1965,7 @@ _brew_tc() {
case "${cur}" in case "${cur}" in
-*) -*)
__brewcomp " __brewcomp "
--all
--debug --debug
--dir --dir
--fail-if-not-changed --fail-if-not-changed
@ -2033,6 +2034,7 @@ _brew_typecheck() {
case "${cur}" in case "${cur}" in
-*) -*)
__brewcomp " __brewcomp "
--all
--debug --debug
--dir --dir
--fail-if-not-changed --fail-if-not-changed

View File

@ -1333,6 +1333,7 @@ __fish_brew_complete_arg 'tap-new' -a '(__fish_brew_suggest_taps_installed)'
__fish_brew_complete_cmd 'tc' 'Check for typechecking errors using Sorbet' __fish_brew_complete_cmd 'tc' 'Check for typechecking errors using Sorbet'
__fish_brew_complete_arg 'tc' -l all -d 'Regenerate all RBI files rather than just updated gems'
__fish_brew_complete_arg 'tc' -l debug -d 'Display any debugging information' __fish_brew_complete_arg 'tc' -l debug -d 'Display any debugging information'
__fish_brew_complete_arg 'tc' -l dir -d 'Typecheck all files in a specific directory' __fish_brew_complete_arg 'tc' -l dir -d 'Typecheck all files in a specific directory'
__fish_brew_complete_arg 'tc' -l fail-if-not-changed -d 'Return a failing status code if all gems are up to date and gem definitions do not need a tapioca update' __fish_brew_complete_arg 'tc' -l fail-if-not-changed -d 'Return a failing status code if all gems are up to date and gem definitions do not need a tapioca update'
@ -1374,6 +1375,7 @@ __fish_brew_complete_arg 'tests' -l verbose -d 'Make some output more verbose'
__fish_brew_complete_cmd 'typecheck' 'Check for typechecking errors using Sorbet' __fish_brew_complete_cmd 'typecheck' 'Check for typechecking errors using Sorbet'
__fish_brew_complete_arg 'typecheck' -l all -d 'Regenerate all RBI files rather than just updated gems'
__fish_brew_complete_arg 'typecheck' -l debug -d 'Display any debugging information' __fish_brew_complete_arg 'typecheck' -l debug -d 'Display any debugging information'
__fish_brew_complete_arg 'typecheck' -l dir -d 'Typecheck all files in a specific directory' __fish_brew_complete_arg 'typecheck' -l dir -d 'Typecheck all files in a specific directory'
__fish_brew_complete_arg 'typecheck' -l fail-if-not-changed -d 'Return a failing status code if all gems are up to date and gem definitions do not need a tapioca update' __fish_brew_complete_arg 'typecheck' -l fail-if-not-changed -d 'Return a failing status code if all gems are up to date and gem definitions do not need a tapioca update'

View File

@ -1631,6 +1631,7 @@ _brew_tap_new() {
# brew tc # brew tc
_brew_tc() { _brew_tc() {
_arguments \ _arguments \
'--all[Regenerate all RBI files rather than just updated gems]' \
'--debug[Display any debugging information]' \ '--debug[Display any debugging information]' \
'(--file)--dir[Typecheck all files in a specific directory]' \ '(--file)--dir[Typecheck all files in a specific directory]' \
'--fail-if-not-changed[Return a failing status code if all gems are up to date and gem definitions do not need a tapioca update]' \ '--fail-if-not-changed[Return a failing status code if all gems are up to date and gem definitions do not need a tapioca update]' \
@ -1679,6 +1680,7 @@ _brew_tests() {
# brew typecheck # brew typecheck
_brew_typecheck() { _brew_typecheck() {
_arguments \ _arguments \
'--all[Regenerate all RBI files rather than just updated gems]' \
'--debug[Display any debugging information]' \ '--debug[Display any debugging information]' \
'(--file)--dir[Typecheck all files in a specific directory]' \ '(--file)--dir[Typecheck all files in a specific directory]' \
'--fail-if-not-changed[Return a failing status code if all gems are up to date and gem definitions do not need a tapioca update]' \ '--fail-if-not-changed[Return a failing status code if all gems are up to date and gem definitions do not need a tapioca update]' \

View File

@ -1478,6 +1478,8 @@ Check for typechecking errors using Sorbet.
Silence all non-critical errors. Silence all non-critical errors.
* `--update`: * `--update`:
Update RBI files. Update RBI files.
* `--all`:
Regenerate all RBI files rather than just updated gems.
* `--suggest-typed`: * `--suggest-typed`:
Try upgrading `typed` sigils. Try upgrading `typed` sigils.
* `--fail-if-not-changed`: * `--fail-if-not-changed`:

View File

@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3 .\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3
. .
.TH "BREW" "1" "March 2022" "Homebrew" "brew" .TH "BREW" "1" "May 2022" "Homebrew" "brew"
. .
.SH "NAME" .SH "NAME"
\fBbrew\fR \- The Missing Package Manager for macOS (or Linux) \fBbrew\fR \- The Missing Package Manager for macOS (or Linux)
@ -2106,6 +2106,10 @@ Silence all non\-critical errors\.
Update RBI files\. Update RBI files\.
. .
.TP .TP
\fB\-\-all\fR
Regenerate all RBI files rather than just updated gems\.
.
.TP
\fB\-\-suggest\-typed\fR \fB\-\-suggest\-typed\fR
Try upgrading \fBtyped\fR sigils\. Try upgrading \fBtyped\fR sigils\.
. .