Merge pull request #3293 from DomT4/predicate_audit
audit: more *_predicate nudging/tweaks
This commit is contained in:
commit
77f3fcf254
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user