audit: fix go audit problems.

This commit is contained in:
Mike McQuaid 2013-10-16 08:36:32 +01:00
parent e9d608587d
commit a64e9d4f0a

View File

@ -399,8 +399,10 @@ class FormulaAuditor
end
# Avoid hard-coding compilers
if line =~ %r{(system|ENV\[.+\]\s?=)\s?['"](/usr/bin/)?(gcc|llvm-gcc|clang)['" ]}
problem "Use \"\#{ENV.cc}\" instead of hard-coding \"#{$3}\""
unless f.name == 'go' # Go needs to set CC for cgo support.
if line =~ %r{(system|ENV\[.+\]\s?=)\s?['"](/usr/bin/)?(gcc|llvm-gcc|clang)['" ]}
problem "Use \"\#{ENV.cc}\" instead of hard-coding \"#{$3}\""
end
end
if line =~ %r{(system|ENV\[.+\]\s?=)\s?['"](/usr/bin/)?((g|llvm-g|clang)\+\+)['" ]}