audit: flag redundant shell_output() exit codes

This commit is contained in:
Dominyk Tiller 2018-08-11 01:49:35 +01:00
parent 8f3a80b562
commit 20311aec15
No known key found for this signature in database
GPG Key ID: FE19AEFCF658C6F6

View File

@ -803,6 +803,10 @@ module Homebrew
problem "Use separate make calls" if line.include?("make && make") problem "Use separate make calls" if line.include?("make && make")
if line =~ /shell_output\(['"].+['"], 0\)/
problem "Passing 0 to shell_output() is redundant"
end
if line =~ /JAVA_HOME/i && !formula.requirements.map(&:class).include?(JavaRequirement) if line =~ /JAVA_HOME/i && !formula.requirements.map(&:class).include?(JavaRequirement)
problem "Use `depends_on :java` to set JAVA_HOME" problem "Use `depends_on :java` to set JAVA_HOME"
end end