Make audit_casks return [path, { errors:, warnings:}] for CI

- This was failing but only in CI because the annotations require
  "errors" and "warnings" hash elements. Since formulae have this
  despite formulae not having warnings (probably for compatibility with
  casks), I decided to reinstate `errors` and `warnings` hash for Casks
  _right at the end_ and we can clean this up another time (famous last
  words).
This commit is contained in:
Issy Long 2023-04-06 21:24:27 +01:00
parent a1d4a46f06
commit 8319c8f9b9
No known key found for this signature in database
GPG Key ID: 8247C390DADC67D4
2 changed files with 3 additions and 3 deletions

View File

@ -60,7 +60,7 @@ module Cask
except: [], except: [],
) )
failed_casks = results.reject { |_, result| result.empty? }.map(&:first) failed_casks = results.reject { |_, result| result[:errors].empty? }.map(&:first)
return if failed_casks.empty? return if failed_casks.empty?
raise CaskError, "audit failed for casks: #{failed_casks.join(" ")}" raise CaskError, "audit failed for casks: #{failed_casks.join(" ")}"
@ -102,7 +102,7 @@ module Cask
casks.to_h do |cask| casks.to_h do |cask|
odebug "Auditing Cask #{cask}" odebug "Auditing Cask #{cask}"
[cask.sourcefile_path, Auditor.audit(cask, **options)] [cask.sourcefile_path, { errors: Auditor.audit(cask, **options), warnings: [] }]
end end
end end
end end

View File

@ -266,7 +266,7 @@ module Homebrew
) )
end end
failed_casks = cask_results.reject { |_, result| result.empty? } failed_casks = cask_results.reject { |_, result| result[:errors].empty? }
cask_count = failed_casks.count cask_count = failed_casks.count