New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

audit: prefer assert/refute_predicate over File.exist? #3269

Merged
merged 1 commit into from Oct 6, 2017
Jump to file or symbol
Failed to load files and symbols.
+8 −0
Diff settings

Always

Just for now

@@ -967,6 +967,14 @@ def line_problems(line, _lineno)
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))/
ProTip! Use n and p to navigate between commits in a pull request.