mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
Only treat cask audit
warnings as errors if --strict
is passed.
This commit is contained in:
parent
e4356e85d1
commit
b72e7ee34d
@ -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,8 +91,12 @@ module Cask
|
||||
end
|
||||
|
||||
def add_warning(message)
|
||||
if strict?
|
||||
add_error message
|
||||
else
|
||||
warnings << message
|
||||
end
|
||||
end
|
||||
|
||||
def errors?
|
||||
errors.any?
|
||||
@ -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?
|
||||
|
Loading…
x
Reference in New Issue
Block a user