From 48802daf013369435f46972154d0046395eae52c Mon Sep 17 00:00:00 2001 From: Issy Long Date: Mon, 6 Mar 2023 20:53:21 +0000 Subject: [PATCH] sorbet: Regenerate homegrown RBI files with `brew typecheck --update` - I needed to add some more `require`s to the `tty.rb` generator script since it failed to recognise `env_config` and Sorbet's `T` setup if I ran it not via `brew ruby`, and I couldn't get `brew ruby` to work within `safe_system` in the `typecheck` dev-cmd. --- Library/Homebrew/dev-cmd/typecheck.rb | 3 +++ Library/Homebrew/sorbet/custom_generators/tty.rb | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/dev-cmd/typecheck.rb b/Library/Homebrew/dev-cmd/typecheck.rb index 05aa183035..1bd80123a9 100644 --- a/Library/Homebrew/dev-cmd/typecheck.rb +++ b/Library/Homebrew/dev-cmd/typecheck.rb @@ -64,6 +64,9 @@ module Homebrew tapioca_args = ["--exclude", *excluded_gems, "--typed-overrides", *typed_overrides] tapioca_args << "--all" if args.update_all? + ohai "Updating homegrown RBI files..." + safe_system "bundle", "exec", "ruby", "sorbet/custom_generators/tty.rb" + ohai "Updating Tapioca RBI files..." safe_system "bundle", "exec", "tapioca", "gem", *tapioca_args safe_system "bundle", "exec", "parlour" diff --git a/Library/Homebrew/sorbet/custom_generators/tty.rb b/Library/Homebrew/sorbet/custom_generators/tty.rb index 1704bea2b8..ff5e22b985 100644 --- a/Library/Homebrew/sorbet/custom_generators/tty.rb +++ b/Library/Homebrew/sorbet/custom_generators/tty.rb @@ -1,12 +1,13 @@ # typed: true # frozen_string_literal: true +require_relative "../../global" +require_relative "../../env_config" require_relative "../../utils/tty" File.open("#{File.dirname(__FILE__)}/../../utils/tty.rbi", "w") do |file| file.write(<<~RUBY) # typed: strict - # frozen_string_literal: true module Tty RUBY