diff options
| author | Dominyk Tiller | 2016-01-09 16:32:23 +0000 |
|---|---|---|
| committer | Dominyk Tiller | 2016-01-11 09:49:54 +0000 |
| commit | f4f2266923b9530ddbefbf55b8764d73b617cadd (patch) | |
| tree | 87e17cfd53a57a4e6b3eec735a815989815375c6 /Library/Homebrew/cmd | |
| parent | 08fb36252c2495c7886d2dac1a837613795b3555 (diff) | |
| download | brew-f4f2266923b9530ddbefbf55b8764d73b617cadd.tar.bz2 | |
audit: check for more unused shorthand
Adding a strict check for usage that should be using pkgshare.
Pulled onto two unique checks to provide a better problem message, with a
clearer solution, but open to thoughts.
* Use pkgshare instead of (share/"example")
* Use #{pkgshare} instead of #{share}/example
Closes Homebrew/homebrew#47900.
Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com>
Diffstat (limited to 'Library/Homebrew/cmd')
| -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 3750eaf25..99614a3fd 100644 --- a/Library/Homebrew/cmd/audit.rb +++ b/Library/Homebrew/cmd/audit.rb @@ -855,6 +855,14 @@ class FormulaAuditor if line =~ /(require ["']formula["'])/ problem "`#{$1}` is now unnecessary" end + + if line =~ /#\{share\}\/#{formula.name}/ + problem "Use \#{pkgshare} instead of \#{share}/#{formula.name}" + end + + if line =~ /share\/"#{formula.name}"/ + problem "Use pkgshare instead of (share/\"#{formula.name}\")" + end end end |
