Skip to content

Commit

Permalink
Refactor condition.
Browse files Browse the repository at this point in the history
  • Loading branch information
reitermarkus committed Jul 30, 2024
1 parent 77e3a40 commit 4a1643e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Library/Homebrew/cask/audit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ def audit_languages
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 ")}."
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/formula_auditor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def audit_name
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
Expand Down

0 comments on commit 4a1643e

Please sign in to comment.