Merge pull request #3293 from DomT4/predicate_audit

audit: more *_predicate nudging/tweaks
This commit is contained in:
Mike McQuaid 2017-10-17 21:12:21 +01:00 committed by GitHub
commit 77f3fcf254

View File

@ -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