audit: nudge to use predicate for 'executable?' as well

This commit is contained in:
Dominyk Tiller 2017-10-09 16:48:01 +01:00
parent a0f4861934
commit 0865ab0d1b

View File

@ -978,6 +978,10 @@ class FormulaAuditor
problem "Use `refute_predicate <path_to_file>, :exist?` instead of `#{Regexp.last_match(1)}`" problem "Use `refute_predicate <path_to_file>, :exist?` instead of `#{Regexp.last_match(1)}`"
end 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 return unless @strict
problem "`#{Regexp.last_match(1)}` in formulae is deprecated" if line =~ /(env :(std|userpaths))/ problem "`#{Regexp.last_match(1)}` in formulae is deprecated" if line =~ /(env :(std|userpaths))/