Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev-cmd/typecheck: Support typechecking in taps #18027

Merged
merged 3 commits into from
Aug 19, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions Library/Homebrew/dev-cmd/typecheck.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,15 @@ class Typecheck < AbstractCommand
conflicts "--lsp", "--update-all"
conflicts "--lsp", "--fix"

named_args :none
named_args :tap
end

sig { override.void }
def run
if (args.dir.present? || args.file.present?) && args.named.present?
raise UsageError, "Cannot use `--dir` or `--file` when specifying a tap."
issyl0 marked this conversation as resolved.
Show resolved Hide resolved
end

update = args.update? || args.update_all?
groups = update ? Homebrew.valid_gem_groups : ["typecheck"]
Homebrew.install_bundler_gems!(groups:)
Expand Down Expand Up @@ -95,10 +99,11 @@ def run
end

srb_exec += ["--ignore", args.ignore] if args.ignore.present?
if args.file.present? || args.dir.present?
if args.file.present? || args.dir.present? || (tap_dir = args.named.to_paths(only: :tap).first).present?
cd("sorbet") do
srb_exec += ["--file", "../#{args.file}"] if args.file
srb_exec += ["--dir", "../#{args.dir}"] if args.dir
srb_exec += ["--dir", tap_dir.to_s] if tap_dir
end
end
success = system(*srb_exec)
Expand Down