From 51f010ac390e838e59dfe5c1d2811b7a20f9ab2a Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Wed, 21 Sep 2011 15:22:05 -0500 Subject: [PATCH] audit: recognize options used with 'ARGV.flag?' A few formula use ARGV.flag? instead of ARGV.include?. This made `audit` recognize a few undocumented instances of a '--devel' option, but we can just ignore that like '--HEAD' for now, and change the behavior if we decide they need to be documented explicitly in each formula. cf. Homebrew/homebrew#7456. Signed-off-by: Jack Nagel --- Library/Homebrew/cmd/audit.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/cmd/audit.rb b/Library/Homebrew/cmd/audit.rb index 03b2bf78d8..5f4796a6e5 100755 --- a/Library/Homebrew/cmd/audit.rb +++ b/Library/Homebrew/cmd/audit.rb @@ -124,7 +124,7 @@ def audit_formula_options f, text # Find possible options options = [] - text.scan(/ARGV\.include\?[ ]*\(?(['"])(.+?)\1/) { |m| options << m[1] } + text.scan(/ARGV\.(include|flag)\?[ ]*\(?(['"])(.+?)\2/) { |m| options << m[2] } options.reject! {|o| o.include? "#"} options.uniq! @@ -140,7 +140,7 @@ def audit_formula_options f, text if options.length > 0 options.each do |o| - next if o == '--HEAD' + next if o == '--HEAD' || o == '--devel' problems << " * Option #{o} is not documented" unless documented_options.include? o end end