diff options
| author | Mike McQuaid | 2014-12-27 14:00:51 +0000 |
|---|---|---|
| committer | Mike McQuaid | 2014-12-27 16:31:43 +0000 |
| commit | 3e3a4cad500ccc347209a7df40ad5e73dc6f88f2 (patch) | |
| tree | 2078dd25f7e09e54cbca6e0b891e1c927ab1d0a1 | |
| parent | 9bd8229ba252d9c360b51092db27d84b60db00bc (diff) | |
| download | brew-3e3a4cad500ccc347209a7df40ad5e73dc6f88f2.tar.bz2 | |
audit: check for use of FileUtils methods.
| -rw-r--r-- | Library/Homebrew/cmd/audit.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Library/Homebrew/cmd/audit.rb b/Library/Homebrew/cmd/audit.rb index f8db07c94..7d70ad053 100644 --- a/Library/Homebrew/cmd/audit.rb +++ b/Library/Homebrew/cmd/audit.rb @@ -78,6 +78,8 @@ class FormulaAuditor swig ] + FILEUTILS_METHODS = FileUtils.singleton_methods(false).join "|" + def initialize(formula, options={}) @formula = formula @strict = !!options[:strict] @@ -534,6 +536,12 @@ class FormulaAuditor if line =~ /(Dir\[("[^\*{},]+")\])/ problem "#{$1} is unnecessary; just use #{$2}" end + + if line =~ /system (["'](#{FILEUTILS_METHODS}))["' ]/ + system = $1 + method = $2 + problem "Use the `#{method}` Ruby method instead of `system #{system}`" + end end def audit_conditional_dep(dep, condition, line) |
