brew audit - flag use of DATA with no __END__

This commit is contained in:
Adam Vandenberg 2010-08-09 09:11:01 -07:00
parent 2f3ce485f3
commit cd50954677

View File

@ -55,6 +55,11 @@ ff.each do |f|
problems << " * md5 is empty" problems << " * md5 is empty"
end 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 # Don't complain about spaces in patches
split_patch = (text.split("__END__")[0]).strip() split_patch = (text.split("__END__")[0]).strip()
if split_patch =~ /[ ]+$/ if split_patch =~ /[ ]+$/