Skip to content
Snippets Groups Projects
Commit b72e7ee3 authored by Markus Reiter's avatar Markus Reiter
Browse files

Only treat `cask audit` warnings as errors if `--strict` is passed.

parent e4356e85
No related branches found
No related tags found
No related merge requests found
......@@ -30,8 +30,8 @@ module Cask
appcast = online if appcast.nil?
download = online if download.nil?
# `strict` implies `token_conflicts`
token_conflicts = strict if token_conflicts.nil?
# `new_cask` implies `token_conflicts`
token_conflicts = new_cask if token_conflicts.nil?
@cask = cask
@appcast = appcast
......@@ -91,7 +91,11 @@ module Cask
end
def add_warning(message)
warnings << message
if strict?
add_error message
else
warnings << message
end
end
def errors?
......@@ -299,11 +303,9 @@ module Cask
end
def check_desc
return unless new_cask?
return if cask.desc.present?
add_error "Cask should have a description. Please add a `desc` stanza."
add_warning "Cask should have a description. Please add a `desc` stanza."
end
def check_url
......@@ -380,7 +382,7 @@ module Cask
end
def check_token_bad_words
return unless strict?
return unless new_cask?
token = cask.token
......
......@@ -59,8 +59,6 @@ module Cask
odebug "Auditing Cask #{cask}"
result = Auditor.audit(cask, **options)
next true if result[:warnings].empty? && result[:errors].empty?
if ENV["GITHUB_ACTIONS"]
cask_path = cask.sourcefile_path
annotations = (result[:warnings].map { |w| [:warning, w] } + result[:errors].map { |e| [:error, e] })
......@@ -71,7 +69,7 @@ module Cask
end
end
false
result[:errors].empty?
end
return if failed_casks.empty?
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment