aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew
diff options
context:
space:
mode:
authorMike McQuaid2016-12-18 15:56:55 -0800
committerGitHub2016-12-18 15:56:55 -0800
commit0027ded5aa6195dcc153ecf0d3d3b05e99f339af (patch)
tree8c26af2c2de2b6a906680e4c587f14bcf22b7a48 /Library/Homebrew
parentf8dfad470f4b1116544fd19b3a56e256fb3b5038 (diff)
parent339ff9400f32e87eec5bde75801d55cf674adca7 (diff)
downloadbrew-0027ded5aa6195dcc153ecf0d3d3b05e99f339af.tar.bz2
Merge pull request #1674 from MikeMcQuaid/audit-os-mac-linux
audit: don't allow use of OS.mac?/OS.linux?.
Diffstat (limited to 'Library/Homebrew')
-rw-r--r--Library/Homebrew/dev-cmd/audit.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb
index 0112c524f..540925947 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)/