audit: warn about top-level methods

This commit is contained in:
Jack Nagel 2013-04-22 15:06:42 -05:00
parent 4f45077fde
commit 8a74e648e7

View File

@ -442,6 +442,10 @@ class FormulaAuditor
if text =~ /depends_on [A-Z][\w:]+\.new$/
problem "`depends_on` can take requirement classes instead of instances"
end
if text =~ /^def (\w+).*$/
problem "Define method #{$1.inspect} in the class body, not at the top-level"
end
end
def audit