aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew
diff options
context:
space:
mode:
authorJack Nagel2013-04-22 15:06:42 -0500
committerJack Nagel2013-04-22 15:19:03 -0500
commit8a74e648e7dea3a350ac9b8f1054d60df34dc160 (patch)
tree9f145c4a860dec323b07d0cce46bdff5c099ac36 /Library/Homebrew
parent4f45077fdee34243f2506ce6328a6d16f8330019 (diff)
downloadbrew-8a74e648e7dea3a350ac9b8f1054d60df34dc160.tar.bz2
audit: warn about top-level methods
Diffstat (limited to 'Library/Homebrew')
-rw-r--r--Library/Homebrew/cmd/audit.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/Library/Homebrew/cmd/audit.rb b/Library/Homebrew/cmd/audit.rb
index 8b773345d..2ed56da80 100644
--- a/Library/Homebrew/cmd/audit.rb
+++ b/Library/Homebrew/cmd/audit.rb
@@ -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