Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rubocops/lines: remove OS.mac?/OS.linux? check. #11958

Merged
merged 1 commit into from Sep 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 0 additions & 8 deletions Library/Homebrew/rubocops/lines.rb
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
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