From cef60aba9c5ee17bff6df52175db8db7dcd4baf7 Mon Sep 17 00:00:00 2001 From: Sam Ford <1584702+samford@users.noreply.github.com> Date: Tue, 11 Jun 2024 21:56:10 -0400 Subject: [PATCH] Fix style issues While fixing `brew style` tap support, brew CI surfaced some style issues in the test-bot tap. This fixes the style issues, so brew CI will pass and the fix can be merged. --- cmd/test-bot.rb | 3 ++- lib/test_bot.rb | 1 - lib/tests/formulae.rb | 12 +++++++----- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/cmd/test-bot.rb b/cmd/test-bot.rb index 998550fc..4e48fa1b 100755 --- a/cmd/test-bot.rb +++ b/cmd/test-bot.rb @@ -43,7 +43,8 @@ class TestBotCmd < AbstractCommand description: "Print test step output in real time. Has the side effect of " \ "passing output as raw bytes instead of re-encoding in UTF-8." switch "--test-default-formula", - description: "Use a default testing formula when not building a tap and no other formulae are specified." + description: "Use a default testing formula when not building " \ + "a tap and no other formulae are specified." flag "--root-url=", description: "Use the specified as the root of the bottle's URL instead of Homebrew's default." flag "--git-name=", diff --git a/lib/test_bot.rb b/lib/test_bot.rb index 328848f4..ed3247ba 100644 --- a/lib/test_bot.rb +++ b/lib/test_bot.rb @@ -22,7 +22,6 @@ module TestBot HOMEBREW_TAP_REGEX = %r{^([\w-]+)/homebrew-([\w-]+)$} - def cleanup?(args) args.cleanup? || ENV["GITHUB_ACTIONS"].present? end diff --git a/lib/tests/formulae.rb b/lib/tests/formulae.rb index 354b8cc8..f9490059 100644 --- a/lib/tests/formulae.rb +++ b/lib/tests/formulae.rb @@ -134,10 +134,10 @@ def setup_formulae_deps_instances(formula, formula_name, args:) installed = Utils.safe_popen_read("brew", "list", "--formula", "--full-name").split("\n") dependencies = Utils.safe_popen_read("brew", "deps", "--formula", - "--include-build", - "--include-test", - "--full-name", - formula_name) + "--include-build", + "--include-test", + "--full-name", + formula_name) .split("\n") installed_dependencies = installed & dependencies installed_dependencies.each do |name| @@ -588,7 +588,9 @@ def formula!(formula_name, args:) ensure cleanup_bottle_etc_var(formula) if cleanup?(args) - test "brew", "uninstall", "--formulae", "--force", *@unchanged_dependencies if @unchanged_dependencies.present? + if @unchanged_dependencies.present? + test "brew", "uninstall", "--formulae", "--force", *@unchanged_dependencies + end end def deleted_formula!(formula_name)