Skip to content

Commit

Permalink
rubocops/lines: remove OS.mac?/OS.linux? check.
Browse files Browse the repository at this point in the history
This will be reimplemented in #11955
but this allows us to merge the homebrew-core changes before that PR is
merged.

Closes #11946
  • Loading branch information
MikeMcQuaid committed Sep 2, 2021
1 parent 8352f1a commit 227a96f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 24 deletions.
8 changes: 0 additions & 8 deletions Library/Homebrew/rubocops/lines.rb
Original file line number Diff line number Diff line change
Expand Up @@ -372,14 +372,6 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node)
end
end

[:mac?, :linux?].each do |method_name|
next if formula_tap != "homebrew-core" || file_path&.include?("linuxbrew")

find_instance_method_call(body_node, "OS", method_name) do |check|
problem "Don't use #{check.source}; homebrew/core only supports macOS"
end
end

find_instance_call(body_node, "ARGV") do |_method_node|
problem "Use build instead of ARGV to check options"
end
Expand Down
16 changes: 0 additions & 16 deletions Library/Homebrew/test/rubocops/text/miscellaneous_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,22 +45,6 @@ class Foo < Formula
RUBY
end

it "reports an offense when `OS.linux?` is used in homebrew/core" do
expect_offense(<<~RUBY, "/homebrew-core/")
class Foo < Formula
desc "foo"
url 'https://brew.sh/foo-1.0.tgz'
bottle do
if OS.linux?
^^^^^^^^^ Don\'t use OS.linux?; homebrew/core only supports macOS
nil
end
sha256 "fe0679b932dd43a87fd415b609a7fbac7a069d117642ae8ebaac46ae1fb9f0b3" => :sierra
end
end
RUBY
end

it "reports an offense when a useless `fails_with :llvm` is used" do
expect_offense(<<~RUBY)
class Foo < Formula
Expand Down

0 comments on commit 227a96f

Please sign in to comment.