audit: don't allow use of OS.mac?/OS.linux?.
Forbid their use in Homebrew/core which only supports macOS. This may be added to more/all official taps in future.
This commit is contained in:
parent
201b45d2ca
commit
339ff9400f
@ -1004,6 +1004,13 @@ class FormulaAuditor
|
|||||||
problem "'fails_with :llvm' is now a no-op so should be removed"
|
problem "'fails_with :llvm' is now a no-op so should be removed"
|
||||||
end
|
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
|
return unless @strict
|
||||||
|
|
||||||
if line =~ /system ((["'])[^"' ]*(?:\s[^"' ]*)+\2)/
|
if line =~ /system ((["'])[^"' ]*(?:\s[^"' ]*)+\2)/
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user