From 39843b5d4099d6ed870ac84d7b4f1604560f68f7 Mon Sep 17 00:00:00 2001 From: Douglas Eichelberger Date: Thu, 13 Mar 2025 12:16:11 -0700 Subject: [PATCH] Resolve violations --- Library/Homebrew/cleanup.rb | 5 ++--- Library/Homebrew/extend/os/mac/extend/ENV/super.rb | 6 +++--- Library/Homebrew/github_runner_matrix.rb | 10 +++++----- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/Library/Homebrew/cleanup.rb b/Library/Homebrew/cleanup.rb index 9c20506a87..df3fcbe460 100644 --- a/Library/Homebrew/cleanup.rb +++ b/Library/Homebrew/cleanup.rb @@ -10,7 +10,8 @@ module Homebrew # Helper class for cleaning up the Homebrew cache. class Cleanup CLEANUP_DEFAULT_DAYS = Homebrew::EnvConfig.cleanup_periodic_full_days.to_i.freeze - private_constant :CLEANUP_DEFAULT_DAYS + GH_ACTIONS_ARTIFACT_CLEANUP_DAYS = 3 + private_constant :CLEANUP_DEFAULT_DAYS, :GH_ACTIONS_ARTIFACT_CLEANUP_DAYS class << self sig { params(pathname: Pathname).returns(T::Boolean) } @@ -68,8 +69,6 @@ module Homebrew private - GH_ACTIONS_ARTIFACT_CLEANUP_DAYS = 3 - sig { params(pathname: Pathname, scrub: T::Boolean).returns(T::Boolean) } def stale_gh_actions_artifact?(pathname, scrub) scrub || prune?(pathname, GH_ACTIONS_ARTIFACT_CLEANUP_DAYS) diff --git a/Library/Homebrew/extend/os/mac/extend/ENV/super.rb b/Library/Homebrew/extend/os/mac/extend/ENV/super.rb index 940bb6e744..8ed7ef263f 100644 --- a/Library/Homebrew/extend/os/mac/extend/ENV/super.rb +++ b/Library/Homebrew/extend/os/mac/extend/ENV/super.rb @@ -156,9 +156,9 @@ module Superenv # Pass `-ld_classic` whenever the linker is invoked with `-dead_strip_dylibs` # on `ld` versions that don't properly handle that option. - if OS::Mac::DevelopmentTools.ld64_version >= "1015.7" && OS::Mac::DevelopmentTools.ld64_version <= "1022.1" - append_to_cccfg "c" - end + return unless OS::Mac::DevelopmentTools.ld64_version.between?("1015.7", "1022.1") + + append_to_cccfg "c" end def no_weak_imports diff --git a/Library/Homebrew/github_runner_matrix.rb b/Library/Homebrew/github_runner_matrix.rb index e8584f487a..f1aeca9c67 100644 --- a/Library/Homebrew/github_runner_matrix.rb +++ b/Library/Homebrew/github_runner_matrix.rb @@ -124,7 +124,7 @@ class GitHubRunnerMatrix sig { params(macos_version: MacOSVersion).returns(T::Boolean) } def runner_enabled?(macos_version) - macos_version <= NEWEST_HOMEBREW_CORE_MACOS_RUNNER && macos_version >= OLDEST_HOMEBREW_CORE_MACOS_RUNNER + macos_version.between?(OLDEST_HOMEBREW_CORE_MACOS_RUNNER, NEWEST_HOMEBREW_CORE_MACOS_RUNNER) end NEWEST_GITHUB_ACTIONS_INTEL_MACOS_RUNNER = :ventura @@ -163,8 +163,8 @@ class GitHubRunnerMatrix macos_version = MacOSVersion.new(version) next unless runner_enabled?(macos_version) - github_runner_available = macos_version <= NEWEST_GITHUB_ACTIONS_ARM_MACOS_RUNNER && - macos_version >= OLDEST_GITHUB_ACTIONS_ARM_MACOS_RUNNER + github_runner_available = macos_version.between?(OLDEST_GITHUB_ACTIONS_ARM_MACOS_RUNNER, + NEWEST_GITHUB_ACTIONS_ARM_MACOS_RUNNER) runner, timeout = if use_github_runner && github_runner_available ["macos-#{version}", GITHUB_ACTIONS_RUNNER_TIMEOUT] @@ -186,8 +186,8 @@ class GitHubRunnerMatrix next if !@all_supported && macos_version > NEWEST_HOMEBREW_CORE_INTEL_MACOS_RUNNER - github_runner_available = macos_version <= NEWEST_GITHUB_ACTIONS_INTEL_MACOS_RUNNER && - macos_version >= OLDEST_GITHUB_ACTIONS_INTEL_MACOS_RUNNER + github_runner_available = macos_version.between?(OLDEST_GITHUB_ACTIONS_INTEL_MACOS_RUNNER, + NEWEST_GITHUB_ACTIONS_INTEL_MACOS_RUNNER) runner, timeout = if use_github_runner && github_runner_available ["macos-#{version}", GITHUB_ACTIONS_RUNNER_TIMEOUT]