From 339ff9400f32e87eec5bde75801d55cf674adca7 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Tue, 13 Dec 2016 02:32:38 +0000 Subject: [PATCH] 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. --- Library/Homebrew/dev-cmd/audit.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb index 0112c524ff..540925947d 100644 --- a/Library/Homebrew/dev-cmd/audit.rb +++ b/Library/Homebrew/dev-cmd/audit.rb @@ -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)/