audit: exit with code 1 if regular audit errors or new formula audit errors when comment is not created
This commit is contained in:
parent
b01446d059
commit
38c832b029
@ -74,6 +74,7 @@ module Homebrew
|
|||||||
|
|
||||||
formula_count = 0
|
formula_count = 0
|
||||||
problem_count = 0
|
problem_count = 0
|
||||||
|
new_formula_problem_count = 0
|
||||||
new_formula = args.new_formula?
|
new_formula = args.new_formula?
|
||||||
strict = new_formula || args.strict?
|
strict = new_formula || args.strict?
|
||||||
online = new_formula || args.online?
|
online = new_formula || args.online?
|
||||||
@ -148,13 +149,14 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
|
|
||||||
unless created_pr_comment
|
unless created_pr_comment
|
||||||
problem_count += new_formula_problem_lines.size
|
new_formula_problem_count += new_formula_problem_lines.size
|
||||||
puts new_formula_problem_lines.map { |s| " #{s}" }
|
puts new_formula_problem_lines.map { |s| " #{s}" }
|
||||||
end
|
end
|
||||||
|
|
||||||
errors_summary = "#{Formatter.pluralize(problem_count, "problem")} in #{Formatter.pluralize(formula_count, "formula")}"
|
total_problems_count = problem_count + new_formula_problem_count
|
||||||
return if problem_count.zero?
|
errors_summary = "#{Formatter.pluralize(total_problems_count, "problem")} in #{Formatter.pluralize(formula_count, "formula")}"
|
||||||
ofail errors_summary unless created_pr_comment
|
|
||||||
|
ofail errors_summary if problem_count.positive? || (new_formula_problem_count.positive? && !created_pr_comment)
|
||||||
end
|
end
|
||||||
|
|
||||||
def format_problem_lines(problems)
|
def format_problem_lines(problems)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user