diff --git a/Library/Homebrew/rubocops/text.rb b/Library/Homebrew/rubocops/text.rb index e328e63585..7f695da721 100644 --- a/Library/Homebrew/rubocops/text.rb +++ b/Library/Homebrew/rubocops/text.rb @@ -17,7 +17,7 @@ module RuboCop end if depends_on?("veclibfort") || depends_on?("lapack") - problem "Formulae should use OpenBLAS as the default serial linear algebra library." + problem "Formulae should use OpenBLAS as the default serial linear algebra library." if formula_tap == "homebrew-core" end if method_called_ever?(body_node, :virtualenv_create) || diff --git a/Library/Homebrew/test/rubocops/text_spec.rb b/Library/Homebrew/test/rubocops/text_spec.rb index 8485c5c4fe..f185fcbc9a 100644 --- a/Library/Homebrew/test/rubocops/text_spec.rb +++ b/Library/Homebrew/test/rubocops/text_spec.rb @@ -32,6 +32,28 @@ describe RuboCop::Cop::FormulaAudit::Text do RUBY end + it "when veclibfort is used instead of OpenBLAS" do + expect_offense(<<~RUBY, "/homebrew-core/") + class Foo < Formula + url "https://brew.sh/foo-1.0.tgz" + homepage "https://brew.sh" + depends_on "veclibfort" + ^^^^^^^^^^^^^^^^^^^^^^^ Formulae should use OpenBLAS as the default serial linear algebra library. + end + RUBY + end + + it "when lapack is used instead of OpenBLAS" do + expect_offense(<<~RUBY, "/homebrew-core/") + class Foo < Formula + url "https://brew.sh/foo-1.0.tgz" + homepage "https://brew.sh" + depends_on "lapack" + ^^^^^^^^^^^^^^^^^^^ Formulae should use OpenBLAS as the default serial linear algebra library. + end + RUBY + end + it "When xcodebuild is called without SYMROOT" do expect_offense(<<~RUBY) class Foo < Formula