Limit veclibfort & lapack cop to core & add tests
This commit is contained in:
parent
65fbcc86d0
commit
75bc30bfff
@ -17,7 +17,7 @@ module RuboCop
|
|||||||
end
|
end
|
||||||
|
|
||||||
if depends_on?("veclibfort") || depends_on?("lapack")
|
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
|
end
|
||||||
|
|
||||||
if method_called_ever?(body_node, :virtualenv_create) ||
|
if method_called_ever?(body_node, :virtualenv_create) ||
|
||||||
|
|||||||
@ -32,6 +32,28 @@ describe RuboCop::Cop::FormulaAudit::Text do
|
|||||||
RUBY
|
RUBY
|
||||||
end
|
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
|
it "When xcodebuild is called without SYMROOT" do
|
||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user