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 all 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
11 changes: 9 additions & 2 deletions Library/Homebrew/dev-cmd/typecheck.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,17 @@
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?

Check warning on line 47 in Library/Homebrew/dev-cmd/typecheck.rb

View check run for this annotation

Codecov / codecov/patch

Library/Homebrew/dev-cmd/typecheck.rb#L47

Added line #L47 was not covered by tests
raise UsageError, "Cannot use `--dir` or `--file` when specifying a tap."
issyl0 marked this conversation as resolved.
Show resolved Hide resolved
elsif args.fix? && args.named.present?
raise UsageError, "Cannot use `--fix` when specifying a tap."
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 +101,11 @@
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