diff options
| author | Mike McQuaid | 2014-03-29 09:16:27 -0500 |
|---|---|---|
| committer | Mike McQuaid | 2014-03-31 11:52:59 -0500 |
| commit | bf8ff2dcb72649ae87d4561ceef4e0a590bdea60 (patch) | |
| tree | 94441dac5387e3d153296deac0d2b0bde3aa9d57 /Library/Homebrew/cmd | |
| parent | 94f324d778e672539116e2a89273398e91eaa7d2 (diff) | |
| download | brew-bf8ff2dcb72649ae87d4561ceef4e0a590bdea60.tar.bz2 | |
audit: check the use of Dir[]
Sometimes `Dir[]` is used with single files/directories unnecessarily.
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 db56663a4..721f6c987 100644 --- a/Library/Homebrew/cmd/audit.rb +++ b/Library/Homebrew/cmd/audit.rb @@ -525,6 +525,10 @@ class FormulaAuditor if line =~ /depends_on ['"](.+)['"] (if.+|unless.+)$/ audit_conditional_dep($1, $2, $&) end + + if line =~ /(Dir\[("[^\*{},]+")\])/ + problem "#{$1} is unnecessary; just use #{$2}" + end end def audit_conditional_dep(dep, condition, line) |
