audit: always run and don't fail after tap audits
This commit is contained in:
parent
2a941ec6b1
commit
2d76e830a8
@ -119,18 +119,21 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
|
|
||||||
# Run tap audits first
|
# Run tap audits first
|
||||||
if args.tap
|
tap_problem_count = 0
|
||||||
tap = Tap.fetch(args.tap)
|
tap_count = 0
|
||||||
ta = TapAuditor.new(tap, strict: args.strict?)
|
Tap.each do |tap|
|
||||||
|
next if args.tap && tap != args.tap
|
||||||
|
|
||||||
|
ta = TapAuditor.new tap, strict: args.strict?
|
||||||
ta.audit
|
ta.audit
|
||||||
|
|
||||||
if ta.problems.any?
|
next if ta.problems.empty?
|
||||||
tap_problem_lines = format_problem_lines(ta.problems)
|
|
||||||
tap_problem_count = ta.problems.size
|
|
||||||
|
|
||||||
puts "#{tap.name}:", tap_problem_lines.map { |s| " #{s}" }
|
tap_count += 1
|
||||||
odie "#{tap_problem_count} #{"problem".pluralize(tap_problem_count)} in 1 tap detected"
|
tap_problem_count += ta.problems.size
|
||||||
end
|
tap_problem_lines = format_problem_lines(ta.problems)
|
||||||
|
|
||||||
|
puts "#{tap.name}:", tap_problem_lines.map { |s| " #{s}" }
|
||||||
end
|
end
|
||||||
|
|
||||||
# Check style in a single batch run up front for performance
|
# Check style in a single batch run up front for performance
|
||||||
@ -184,14 +187,24 @@ module Homebrew
|
|||||||
new_formula_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}" }
|
||||||
|
|
||||||
total_problems_count = problem_count + new_formula_problem_count
|
total_problems_count = problem_count + new_formula_problem_count + tap_problem_count
|
||||||
|
|
||||||
|
return unless total_problems_count.positive?
|
||||||
|
|
||||||
problem_plural = "#{total_problems_count} #{"problem".pluralize(total_problems_count)}"
|
problem_plural = "#{total_problems_count} #{"problem".pluralize(total_problems_count)}"
|
||||||
formula_plural = "#{formula_count} #{"formula".pluralize(formula_count)}"
|
formula_plural = "#{formula_count} #{"formula".pluralize(formula_count)}"
|
||||||
|
tap_plural = "#{tap_count} #{"tap".pluralize(tap_count)}"
|
||||||
corrected_problem_plural = "#{corrected_problem_count} #{"problem".pluralize(corrected_problem_count)}"
|
corrected_problem_plural = "#{corrected_problem_count} #{"problem".pluralize(corrected_problem_count)}"
|
||||||
errors_summary = "#{problem_plural} in #{formula_plural} detected"
|
errors_summary = if tap_count.zero?
|
||||||
|
"#{problem_plural} in #{formula_plural} detected"
|
||||||
|
elsif formula_count.zero?
|
||||||
|
"#{problem_plural} in #{tap_plural} detected"
|
||||||
|
else
|
||||||
|
"#{problem_plural} in #{formula_plural} and #{tap_plural} detected"
|
||||||
|
end
|
||||||
errors_summary += ", #{corrected_problem_plural} corrected" if corrected_problem_count.positive?
|
errors_summary += ", #{corrected_problem_plural} corrected" if corrected_problem_count.positive?
|
||||||
|
|
||||||
ofail errors_summary if problem_count.positive? || new_formula_problem_count.positive?
|
ofail errors_summary
|
||||||
end
|
end
|
||||||
|
|
||||||
def format_problem_lines(problems)
|
def format_problem_lines(problems)
|
||||||
@ -1162,7 +1175,6 @@ module Homebrew
|
|||||||
@name = tap.name
|
@name = tap.name
|
||||||
@path = tap.path
|
@path = tap.path
|
||||||
@tap_audit_exceptions = tap.audit_exceptions
|
@tap_audit_exceptions = tap.audit_exceptions
|
||||||
@strict = strict
|
|
||||||
@problems = []
|
@problems = []
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user