audit: broaden refute_predicate nudge

This commit is contained in:
Dominyk Tiller 2017-10-09 16:46:01 +01:00
parent 56458f03fc
commit a0f4861934
No known key found for this signature in database
GPG Key ID: FE19AEFCF658C6F6

View File

@ -974,8 +974,8 @@ 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
return unless @strict