aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/dev-cmd/audit.rb
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew/dev-cmd/audit.rb')
-rw-r--r--Library/Homebrew/dev-cmd/audit.rb8
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