audit: add strict mode, argument.

This commit is contained in:
Mike McQuaid 2014-12-27 12:38:04 +00:00
parent a1ba5a5da6
commit 24f183dd12

View File

@ -17,8 +17,10 @@ module Homebrew
ARGV.formulae ARGV.formulae
end end
strict = ARGV.include? "--strict"
ff.each do |f| ff.each do |f|
fa = FormulaAuditor.new f fa = FormulaAuditor.new(f, :strict => strict)
fa.audit fa.audit
unless fa.problems.empty? unless fa.problems.empty?
@ -76,8 +78,9 @@ class FormulaAuditor
swig swig
] ]
def initialize(formula) def initialize(formula, options={})
@formula = formula @formula = formula
@strict = !!options[:strict]
@problems = [] @problems = []
@text = FormulaText.new(formula.path) @text = FormulaText.new(formula.path)
@specs = %w{stable devel head}.map { |s| formula.send(s) }.compact @specs = %w{stable devel head}.map { |s| formula.send(s) }.compact