Merge pull request #15705 from Homebrew/revert-15385-revert-sorbet-again

Enable HOMEBREW_SORBET_RUNTIME (sometimes)
This commit is contained in:
Mike McQuaid 2023-07-21 13:24:14 +01:00 committed by GitHub
commit 3a290b21b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 32 additions and 3 deletions

View File

@ -919,6 +919,34 @@ then
export HOMEBREW_DEVELOPER_COMMAND="1"
fi
if [[ -n "${HOMEBREW_DEVELOPER}" || -n "${HOMEBREW_DEVELOPER_COMMAND}" ]]
then
# Always run with Sorbet for Homebrew developers or Homebrew developer commands.
export HOMEBREW_SORBET_RUNTIME="1"
fi
# NO_SORBET_RUNTIME_COMMANDS are currently failing with Sorbet for homebrew/core.
# TODO: fix this and remove this if block.
if [[ -n "${HOMEBREW_SORBET_RUNTIME}" ]]
then
NO_SORBET_RUNTIME_COMMANDS=(
)
if check-array-membership "${HOMEBREW_COMMAND}" "${NO_SORBET_RUNTIME_COMMANDS[@]}"
then
unset HOMEBREW_SORBET_RUNTIME
fi
unset NO_SORBET_RUNTIME_COMMANDS
fi
# Provide a (temporary, undocumented) way to disable Sorbet globally if needed
# to avoid reverting the above.
if [[ -n "${HOMEBREW_NO_SORBET_RUNTIME}" ]]
then
unset HOMEBREW_SORBET_RUNTIME
fi
if [[ -n "${HOMEBREW_DEVELOPER_COMMAND}" && -z "${HOMEBREW_DEVELOPER}" ]]
then
if [[ -z "${HOMEBREW_DEV_CMD_RUN}" ]]

View File

@ -349,7 +349,8 @@ module Homebrew
boolean: true,
},
HOMEBREW_SORBET_RUNTIME: {
description: "If set, enable runtime typechecking using Sorbet.",
description: "If set, enable runtime typechecking using Sorbet. " \
"Set by default for HOMEBREW_DEVELOPER or when running some developer commands.",
boolean: true,
},
HOMEBREW_SSH_CONFIG_PATH: {

View File

@ -2312,7 +2312,7 @@ example, run `export HOMEBREW_NO_INSECURE_REDIRECT=1` rather than just
<br>If set along with `HOMEBREW_DEVELOPER`, do not use bottles from older versions of macOS. This is useful in development on new macOS versions.
- `HOMEBREW_SORBET_RUNTIME`
<br>If set, enable runtime typechecking using Sorbet.
<br>If set, enable runtime typechecking using Sorbet. Set by default for HOMEBREW_DEVELOPER or when running some developer commands.
- `HOMEBREW_SSH_CONFIG_PATH`
<br>If set, Homebrew will use the given config file instead of `~/.ssh/config` when fetching `git` repos over `ssh`.

View File

@ -3414,7 +3414,7 @@ If set along with \fBHOMEBREW_DEVELOPER\fR, do not use bottles from older versio
\fBHOMEBREW_SORBET_RUNTIME\fR
.
.br
If set, enable runtime typechecking using Sorbet\.
If set, enable runtime typechecking using Sorbet\. Set by default for HOMEBREW_DEVELOPER or when running some developer commands\.
.
.TP
\fBHOMEBREW_SSH_CONFIG_PATH\fR