From 57911f479af8660536a1e87a87ac0390af04b1a6 Mon Sep 17 00:00:00 2001 From: hyuraku <32809703+hyuraku@users.noreply.github.com> Date: Tue, 13 Jul 2021 21:55:47 +0900 Subject: [PATCH] formula_auditor: repair audit_specs --- Library/Homebrew/formula_auditor.rb | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/Library/Homebrew/formula_auditor.rb b/Library/Homebrew/formula_auditor.rb index 5076448ba0..6329128e71 100644 --- a/Library/Homebrew/formula_auditor.rb +++ b/Library/Homebrew/formula_auditor.rb @@ -555,14 +555,6 @@ module Homebrew ) end - if (stable = formula.stable) - version = stable.version - problem "Stable: version (#{version}) is set to a string without a digit" if version.to_s !~ /\d/ - if version.to_s.start_with?("HEAD") - problem "Stable: non-HEAD version name (#{version}) should not begin with HEAD" - end - end - return unless @core_tap if formula.head && @versioned_formula && @@ -574,7 +566,14 @@ module Homebrew return unless stable return unless stable.url - stable_version_string = stable.version.to_s + version = stable.version + problem "Stable: version (#{version}) is set to a string without a digit" if version.to_s !~ /\d/ + + stable_version_string = version.to_s + if stable_version_string.start_with?("HEAD") + problem "Stable: non-HEAD version name (#{stable_version_string}) should not begin with HEAD" + end + stable_url_version = Version.parse(stable.url) stable_url_minor_version = stable_url_version.minor.to_i