From c294ce22a78685c9ab6c23a8104214fe8fae1f59 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Sun, 4 Jan 2015 10:48:28 +0000 Subject: [PATCH] audit: also run `brew style` on `--strict`. Closes Homebrew/homebrew#35465. Signed-off-by: Mike McQuaid --- Library/Homebrew/cmd/audit.rb | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/cmd/audit.rb b/Library/Homebrew/cmd/audit.rb index 8b2de4ba6d..53a8322303 100644 --- a/Library/Homebrew/cmd/audit.rb +++ b/Library/Homebrew/cmd/audit.rb @@ -8,6 +8,13 @@ module Homebrew formula_count = 0 problem_count = 0 + strict = ARGV.include? "--strict" + if strict && ARGV.formulae.any? + require "cmd/style" + ohai "brew style #{ARGV.formulae.join " "}" + style + end + ENV.activate_extensions! ENV.setup_build_environment @@ -17,13 +24,19 @@ module Homebrew ARGV.formulae end - strict = ARGV.include? "--strict" + output_header = !strict ff.each do |f| fa = FormulaAuditor.new(f, :strict => strict) fa.audit unless fa.problems.empty? + unless output_header + puts + ohai "audit problems" + output_header = true + end + formula_count += 1 problem_count += fa.problems.size puts "#{f.name}:", fa.problems.map { |p| " * #{p}" }, ""