Skip to content
Snippets Groups Projects
Commit b12cc1eb authored by Adam Vandenberg's avatar Adam Vandenberg
Browse files

brew audit - most audits shouldn't happen against __END__

parent c5a95203
No related branches found
No related tags found
No related merge requests found
......@@ -52,14 +52,8 @@ def audit_formula_text text
problems << " * md5 is empty"
end
# DATA with no __END__
if (text =~ /\bDATA\b/) and not (text =~ /^\s*__END__\s*$/)
problems << " * 'DATA' was found, but no '__END__'"
end
# Don't complain about spaces in patches
split_patch = (text.split("__END__")[0]).strip()
if split_patch =~ /[ ]+$/
# No trailing whitespace, please
if text =~ /[ ]+$/
problems << " * Trailing whitespace was found."
end
......@@ -79,7 +73,15 @@ def audit_some_formulae
text = ""
File.open(f.path, "r") { |afile| text = afile.read }
problems += audit_formula_text(text)
# DATA with no __END__
if (text =~ /\bDATA\b/) and not (text =~ /^\s*__END__\s*$/)
problems << " * 'DATA' was found, but no '__END__'"
end
# Don't try remaining audits on text in __END__
text_without_patch = (text.split("__END__")[0]).strip()
problems += audit_formula_text(text_without_patch)
unless problems.empty?
puts "#{f.name}:"
......
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