From 79ab11c62db5afc59ce22d77019685d926868c66 Mon Sep 17 00:00:00 2001 From: Issy Long Date: Wed, 3 Jul 2024 22:15:31 +0000 Subject: [PATCH 1/4] dev-cmd/typecheck: Stop dry running Spoom sigil bumps - Sixteen months ago in PR 14921, I made it so that CI ran `brew typecheck --update --suggest-typed` and could commit the changes. - Except it never actually ever made any changes because of the `--dry` option in the Spoom CLI args. Whoops! --- Library/Homebrew/dev-cmd/typecheck.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/dev-cmd/typecheck.rb b/Library/Homebrew/dev-cmd/typecheck.rb index d87e54bfb2..272a9ed285 100644 --- a/Library/Homebrew/dev-cmd/typecheck.rb +++ b/Library/Homebrew/dev-cmd/typecheck.rb @@ -60,9 +60,9 @@ module Homebrew if args.suggest_typed? ohai "Checking if we can bump Sorbet `typed` sigils..." # --sorbet needed because of https://github.com/Shopify/spoom/issues/488 - safe_system "bundle", "exec", "spoom", "srb", "bump", "--dry", "--from", "false", "--to", "true", + safe_system "bundle", "exec", "spoom", "srb", "bump", "--from", "false", "--to", "true", "--sorbet", "#{Gem.bin_path("sorbet", "srb")} tc" - safe_system "bundle", "exec", "spoom", "srb", "bump", "--dry", "--from", "true", "--to", "strict", + safe_system "bundle", "exec", "spoom", "srb", "bump", "--from", "true", "--to", "strict", "--sorbet", "#{Gem.bin_path("sorbet", "srb")} tc" end From e52a582290734e3903a38be02a0c27c84e99fee4 Mon Sep 17 00:00:00 2001 From: Issy Long Date: Wed, 3 Jul 2024 22:51:51 +0000 Subject: [PATCH 2/4] workflows/sorbet: Continue if the RBI files step fails - Annoyingly `spoom srb bump` exits with a status code of 1 even if it has done work to bump files, so we need to continue so the next workflow step commits the changes. --- .github/workflows/sorbet.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/sorbet.yml b/.github/workflows/sorbet.yml index 34873decea..b928ebe679 100644 --- a/.github/workflows/sorbet.yml +++ b/.github/workflows/sorbet.yml @@ -46,6 +46,7 @@ jobs: - name: Update RBI files id: update working-directory: ${{ steps.set-up-homebrew.outputs.repository-path }} + continue-on-error: true run: | if [[ "${GITHUB_EVENT_NAME}" != "pull_request" ]] then From e7b9a732b4ba879e31898f8ae6f977019a8f2396 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Thu, 4 Jul 2024 08:27:21 +0100 Subject: [PATCH 3/4] dev-cmd/typecheck: improve exit code handling. --- .github/workflows/sorbet.yml | 1 - Library/Homebrew/dev-cmd/typecheck.rb | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/sorbet.yml b/.github/workflows/sorbet.yml index b928ebe679..34873decea 100644 --- a/.github/workflows/sorbet.yml +++ b/.github/workflows/sorbet.yml @@ -46,7 +46,6 @@ jobs: - name: Update RBI files id: update working-directory: ${{ steps.set-up-homebrew.outputs.repository-path }} - continue-on-error: true run: | if [[ "${GITHUB_EVENT_NAME}" != "pull_request" ]] then diff --git a/Library/Homebrew/dev-cmd/typecheck.rb b/Library/Homebrew/dev-cmd/typecheck.rb index 272a9ed285..def2b9652e 100644 --- a/Library/Homebrew/dev-cmd/typecheck.rb +++ b/Library/Homebrew/dev-cmd/typecheck.rb @@ -60,9 +60,9 @@ module Homebrew if args.suggest_typed? ohai "Checking if we can bump Sorbet `typed` sigils..." # --sorbet needed because of https://github.com/Shopify/spoom/issues/488 - safe_system "bundle", "exec", "spoom", "srb", "bump", "--from", "false", "--to", "true", + system "bundle", "exec", "spoom", "srb", "bump", "--from", "false", "--to", "true", "--sorbet", "#{Gem.bin_path("sorbet", "srb")} tc" - safe_system "bundle", "exec", "spoom", "srb", "bump", "--from", "true", "--to", "strict", + system "bundle", "exec", "spoom", "srb", "bump", "--from", "true", "--to", "strict", "--sorbet", "#{Gem.bin_path("sorbet", "srb")} tc" end From a934713992b597282dd9460d9c91ef20af923789 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Thu, 4 Jul 2024 08:28:24 +0100 Subject: [PATCH 4/4] dev-cmd/typecheck: improve indentation. --- Library/Homebrew/dev-cmd/typecheck.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/dev-cmd/typecheck.rb b/Library/Homebrew/dev-cmd/typecheck.rb index def2b9652e..4e6af62914 100644 --- a/Library/Homebrew/dev-cmd/typecheck.rb +++ b/Library/Homebrew/dev-cmd/typecheck.rb @@ -61,9 +61,9 @@ module Homebrew ohai "Checking if we can bump Sorbet `typed` sigils..." # --sorbet needed because of https://github.com/Shopify/spoom/issues/488 system "bundle", "exec", "spoom", "srb", "bump", "--from", "false", "--to", "true", - "--sorbet", "#{Gem.bin_path("sorbet", "srb")} tc" + "--sorbet", "#{Gem.bin_path("sorbet", "srb")} tc" system "bundle", "exec", "spoom", "srb", "bump", "--from", "true", "--to", "strict", - "--sorbet", "#{Gem.bin_path("sorbet", "srb")} tc" + "--sorbet", "#{Gem.bin_path("sorbet", "srb")} tc" end return