diff options
| author | Jack Nagel | 2013-04-22 15:06:42 -0500 |
|---|---|---|
| committer | Jack Nagel | 2013-04-22 15:19:03 -0500 |
| commit | 10e60b092c4ac87dff73407cc42803f425339ab5 (patch) | |
| tree | 41fe82f9d172ebfb3ae27256f437f0c4cc1c525c /Library/Homebrew/cmd | |
| parent | 10e219de7e93f626e2c1f9141366f273a39f0c43 (diff) | |
| download | homebrew-10e60b092c4ac87dff73407cc42803f425339ab5.tar.bz2 | |
audit: warn about top-level methods
Diffstat (limited to 'Library/Homebrew/cmd')
| -rw-r--r-- | Library/Homebrew/cmd/audit.rb | 4 |
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 |
