Skip to content
Snippets Groups Projects
Unverified Commit 4e957165 authored by Dominyk Tiller's avatar Dominyk Tiller
Browse files

audit: prefer assert/refute_predicate over File.exist?

parent 57035b3b
No related branches found
No related tags found
No related merge requests found
......@@ -967,6 +967,14 @@ class FormulaAuditor
problem "Use `assert_match` instead of `assert ...include?`"
end
if line =~ /(assert File\.exist\?|File\.exist\?)/
problem "Use `assert_predicate <path_to_file>, :exist?` instead of `#{Regexp.last_match(1)}`"
end
if line =~ /(assert !File\.exist\?|!File\.exist\?)/
problem "Use `refute_predicate <path_to_file>, :exist?` instead of `#{Regexp.last_match(1)}`"
end
return unless @strict
problem "`#{Regexp.last_match(1)}` in formulae is deprecated" if line =~ /(env :(std|userpaths))/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment