diff --git a/Library/Homebrew/cask/audit.rb b/Library/Homebrew/cask/audit.rb index cacc2afe4c..217b7250a4 100644 --- a/Library/Homebrew/cask/audit.rb +++ b/Library/Homebrew/cask/audit.rb @@ -396,7 +396,7 @@ module Cask sig { void } def audit_token token_auditor = Homebrew::FormulaNameCaskTokenAuditor.new(cask.token) - return if (errors = token_auditor.errors).empty? + return if (errors = token_auditor.errors).none? add_error "Cask token '#{cask.token}' must not contain #{errors.to_sentence(two_words_connector: " or ", last_word_connector: " or ")}." diff --git a/Library/Homebrew/formula_auditor.rb b/Library/Homebrew/formula_auditor.rb index 4c2aa07401..1c0319a630 100644 --- a/Library/Homebrew/formula_auditor.rb +++ b/Library/Homebrew/formula_auditor.rb @@ -165,7 +165,7 @@ module Homebrew name = formula.name name_auditor = Homebrew::FormulaNameCaskTokenAuditor.new(name) - unless (errors = name_auditor.errors).empty? + if (errors = name_auditor.errors).any? problem "Formula name '#{name}' must not contain #{errors.to_sentence(two_words_connector: " or ", last_word_connector: " or ")}." end