diff options
| author | Mike McQuaid | 2017-10-17 21:12:21 +0100 |
|---|---|---|
| committer | GitHub | 2017-10-17 21:12:21 +0100 |
| commit | 77f3fcf25455c8ad6a6ae9c4723f638c611c0c26 (patch) | |
| tree | 2d101dd0705bb5784e6f858a72d1a7c8abac5b22 /Library/Homebrew/dev-cmd | |
| parent | 5f64d0fdcc935db1f88fec9d2ad2fd95053157d6 (diff) | |
| parent | 0865ab0d1b25c9f6809c07fe6f4c02e71c2f0d27 (diff) | |
| download | brew-77f3fcf25455c8ad6a6ae9c4723f638c611c0c26.tar.bz2 | |
Merge pull request #3293 from DomT4/predicate_audit
audit: more *_predicate nudging/tweaks
Diffstat (limited to 'Library/Homebrew/dev-cmd')
| -rw-r--r-- | Library/Homebrew/dev-cmd/audit.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb index 200b2597f..a9d27afa9 100644 --- a/Library/Homebrew/dev-cmd/audit.rb +++ b/Library/Homebrew/dev-cmd/audit.rb @@ -974,8 +974,12 @@ class FormulaAuditor problem "Use `assert_predicate <path_to_file>, :exist?` instead of `#{Regexp.last_match(1)}`" end - if line =~ /assert !File\.exist\?/ - problem "Use `refute_predicate <path_to_file>, :exist?` instead of `assert !File.exist?`" + if line =~ /(assert !File\.exist\?|assert !\(.*\)\.exist\?)/ + problem "Use `refute_predicate <path_to_file>, :exist?` instead of `#{Regexp.last_match(1)}`" + end + + if line =~ /(assert File\.executable\?|assert \(.*\)\.executable\?)/ + problem "Use `assert_predicate <path_to_file>, :executable?` instead of `#{Regexp.last_match(1)}`" end return unless @strict |
