Skip to content
Snippets Groups Projects
Commit 51f010ac authored by Jack Nagel's avatar Jack Nagel
Browse files

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: default avatarJack Nagel <jacknagel@gmail.com>
parent d817e5e5
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment