diff --git a/Library/Homebrew/formula_auditor.rb b/Library/Homebrew/formula_auditor.rb index 5076448ba0eb7538469b6cc787c2e0c734b642d9..6329128e710e00983dade06570e070e5b14f854d 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