dev-cmd/typecheck: Support typechecking in taps
```shell $ brew typecheck homebrew/bundle No sorbet/ directory found. Maybe you want to run 'srb init'? A type checker for Ruby Usage: srb Same as "srb t" srb (init | initialize) Initializes the `sorbet` directory srb rbi [options] Manage the `sorbet` directory srb (t | tc | typecheck) [options] Typechecks the code Options: -h, --help View help for this subcommand. --version Show version. For full help: https://sorbet.org Check https://docs.brew.sh/Typechecking for more information on how to resolve these errors. ```
This commit is contained in:
parent
eaf0551252
commit
807093f276
@ -39,19 +39,20 @@ module Homebrew
|
|||||||
conflicts "--lsp", "--update-all"
|
conflicts "--lsp", "--update-all"
|
||||||
conflicts "--lsp", "--fix"
|
conflicts "--lsp", "--fix"
|
||||||
|
|
||||||
named_args :none
|
named_args :tap
|
||||||
end
|
end
|
||||||
|
|
||||||
sig { override.void }
|
sig { override.void }
|
||||||
def run
|
def run
|
||||||
update = args.update? || args.update_all?
|
update = args.update? || args.update_all?
|
||||||
|
directory = args.no_named? ? HOMEBREW_LIBRARY_PATH : args.named.to_paths(only: :tap).first
|
||||||
groups = update ? Homebrew.valid_gem_groups : ["typecheck"]
|
groups = update ? Homebrew.valid_gem_groups : ["typecheck"]
|
||||||
Homebrew.install_bundler_gems!(groups:)
|
Homebrew.install_bundler_gems!(groups:)
|
||||||
|
|
||||||
# Sorbet doesn't use bash privileged mode so we align EUID and UID here.
|
# Sorbet doesn't use bash privileged mode so we align EUID and UID here.
|
||||||
Process::UID.change_privilege(Process.euid) if Process.euid != Process.uid
|
Process::UID.change_privilege(Process.euid) if Process.euid != Process.uid
|
||||||
|
|
||||||
HOMEBREW_LIBRARY_PATH.cd do
|
directory.cd do
|
||||||
if update
|
if update
|
||||||
workers = args.debug? ? ["--workers=1"] : []
|
workers = args.debug? ? ["--workers=1"] : []
|
||||||
safe_system "bundle", "exec", "tapioca", "dsl", *workers
|
safe_system "bundle", "exec", "tapioca", "dsl", *workers
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user