Merge pull request #1674 from MikeMcQuaid/audit-os-mac-linux

audit: don't allow use of OS.mac?/OS.linux?.
This commit is contained in:
Mike McQuaid 2016-12-18 15:56:55 -08:00 committed by GitHub
commit 0027ded5aa

View File

@ -1004,6 +1004,13 @@ class FormulaAuditor
problem "'fails_with :llvm' is now a no-op so should be removed"
end
if formula.tap.to_s == "homebrew/core"
["OS.mac?", "OS.linux?"].each do |check|
next unless line.include?(check)
problem "Don't use #{check}; Homebrew/core only supports macOS"
end
end
return unless @strict
if line =~ /system ((["'])[^"' ]*(?:\s[^"' ]*)+\2)/