commit
0088914887
@ -3,17 +3,17 @@ describe Hbc::CaskLoader::FromURILoader do
|
|||||||
|
|
||||||
describe "::can_load?" do
|
describe "::can_load?" do
|
||||||
it "returns true when given an URI" do
|
it "returns true when given an URI" do
|
||||||
expect(described_class).to be_able_to_load(URI("http://example.com/"))
|
expect(described_class).to be_able_to_load(URI("https://example.com/"))
|
||||||
end
|
end
|
||||||
|
|
||||||
it "returns true when given a String which can be parsed to a URI" do
|
it "returns true when given a String which can be parsed to a URI" do
|
||||||
expect(described_class).to be_able_to_load("http://example.com/")
|
expect(described_class).to be_able_to_load("https://example.com/")
|
||||||
end
|
end
|
||||||
|
|
||||||
it "returns false when given a String with Cask contents containing a URL" do
|
it "returns false when given a String with Cask contents containing a URL" do
|
||||||
expect(described_class).not_to be_able_to_load <<~RUBY
|
expect(described_class).not_to be_able_to_load <<~RUBY
|
||||||
cask 'token' do
|
cask 'token' do
|
||||||
url 'http://example.com/'
|
url 'https://example.com/'
|
||||||
end
|
end
|
||||||
RUBY
|
RUBY
|
||||||
end
|
end
|
||||||
|
|||||||
@ -7,8 +7,8 @@ describe RuboCop::Cop::FormulaAudit::Caveats do
|
|||||||
it "When there is setuid mentioned in caveats" do
|
it "When there is setuid mentioned in caveats" do
|
||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
homepage "http://example.com/foo"
|
homepage "https://example.com/foo"
|
||||||
url "http://example.com/foo-1.0.tgz"
|
url "https://example.com/foo-1.0.tgz"
|
||||||
def caveats
|
def caveats
|
||||||
"setuid"
|
"setuid"
|
||||||
^^^^^^ Don\'t recommend setuid in the caveats, suggest sudo instead.
|
^^^^^^ Don\'t recommend setuid in the caveats, suggest sudo instead.
|
||||||
|
|||||||
@ -7,7 +7,7 @@ describe RuboCop::Cop::FormulaAudit::Checksum do
|
|||||||
it "When the checksum is empty" do
|
it "When the checksum is empty" do
|
||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
stable do
|
stable do
|
||||||
url "https://github.com/foo-lang/foo-compiler/archive/0.18.0.tar.gz"
|
url "https://github.com/foo-lang/foo-compiler/archive/0.18.0.tar.gz"
|
||||||
sha256 ""
|
sha256 ""
|
||||||
@ -26,7 +26,7 @@ describe RuboCop::Cop::FormulaAudit::Checksum do
|
|||||||
it "When the checksum is not 64 characters" do
|
it "When the checksum is not 64 characters" do
|
||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
stable do
|
stable do
|
||||||
url "https://github.com/foo-lang/foo-compiler/archive/0.18.0.tar.gz"
|
url "https://github.com/foo-lang/foo-compiler/archive/0.18.0.tar.gz"
|
||||||
sha256 "5cf6e1ae0a645b426c0474cc7cd3f7d1605ffa1ac5756a39a8b2268ddc7ea0e9ad"
|
sha256 "5cf6e1ae0a645b426c0474cc7cd3f7d1605ffa1ac5756a39a8b2268ddc7ea0e9ad"
|
||||||
@ -45,7 +45,7 @@ describe RuboCop::Cop::FormulaAudit::Checksum do
|
|||||||
it "When the checksum has invalid chars" do
|
it "When the checksum has invalid chars" do
|
||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
stable do
|
stable do
|
||||||
url "https://github.com/foo-lang/foo-compiler/archive/0.18.0.tar.gz"
|
url "https://github.com/foo-lang/foo-compiler/archive/0.18.0.tar.gz"
|
||||||
sha256 "5cf6e1ae0a645b426c0k7cc7cd3f7d1605ffa1ac5756a39a8b2268ddc7ea0e9a"
|
sha256 "5cf6e1ae0a645b426c0k7cc7cd3f7d1605ffa1ac5756a39a8b2268ddc7ea0e9a"
|
||||||
@ -70,7 +70,7 @@ describe RuboCop::Cop::FormulaAudit::ChecksumCase do
|
|||||||
it "When the checksum has upper case characters" do
|
it "When the checksum has upper case characters" do
|
||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
stable do
|
stable do
|
||||||
url "https://github.com/foo-lang/foo-compiler/archive/0.18.0.tar.gz"
|
url "https://github.com/foo-lang/foo-compiler/archive/0.18.0.tar.gz"
|
||||||
sha256 "5cf6e1ae0A645b426c0a7cc7cd3f7d1605ffa1ac5756a39a8b2268ddc7ea0e9a"
|
sha256 "5cf6e1ae0A645b426c0a7cc7cd3f7d1605ffa1ac5756a39a8b2268ddc7ea0e9a"
|
||||||
@ -89,7 +89,7 @@ describe RuboCop::Cop::FormulaAudit::ChecksumCase do
|
|||||||
it "When auditing stable blocks outside spec blocks" do
|
it "When auditing stable blocks outside spec blocks" do
|
||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
resource "foo-outside" do
|
resource "foo-outside" do
|
||||||
url "https://github.com/foo-lang/foo-outside/archive/0.18.0.tar.gz"
|
url "https://github.com/foo-lang/foo-outside/archive/0.18.0.tar.gz"
|
||||||
sha256 "A4cc7cd3f7d1605ffa1ac5755cf6e1ae0a645b426b047a6a39a8b2268ddc7ea9"
|
sha256 "A4cc7cd3f7d1605ffa1ac5755cf6e1ae0a645b426b047a6a39a8b2268ddc7ea9"
|
||||||
@ -113,7 +113,7 @@ describe RuboCop::Cop::FormulaAudit::ChecksumCase do
|
|||||||
it "When there is uppercase sha256" do
|
it "When there is uppercase sha256" do
|
||||||
source = <<~RUBY
|
source = <<~RUBY
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
stable do
|
stable do
|
||||||
url "https://github.com/foo-lang/foo-compiler/archive/0.18.0.tar.gz"
|
url "https://github.com/foo-lang/foo-compiler/archive/0.18.0.tar.gz"
|
||||||
sha256 "5cf6e1ae0A645b426c0a7cc7cd3f7d1605ffa1ac5756a39a8b2268ddc7ea0e9a"
|
sha256 "5cf6e1ae0A645b426c0a7cc7cd3f7d1605ffa1ac5756a39a8b2268ddc7ea0e9a"
|
||||||
@ -128,7 +128,7 @@ describe RuboCop::Cop::FormulaAudit::ChecksumCase do
|
|||||||
|
|
||||||
corrected_source = <<~RUBY
|
corrected_source = <<~RUBY
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
stable do
|
stable do
|
||||||
url "https://github.com/foo-lang/foo-compiler/archive/0.18.0.tar.gz"
|
url "https://github.com/foo-lang/foo-compiler/archive/0.18.0.tar.gz"
|
||||||
sha256 "5cf6e1ae0a645b426c0a7cc7cd3f7d1605ffa1ac5756a39a8b2268ddc7ea0e9a"
|
sha256 "5cf6e1ae0a645b426c0a7cc7cd3f7d1605ffa1ac5756a39a8b2268ddc7ea0e9a"
|
||||||
|
|||||||
@ -7,7 +7,7 @@ describe RuboCop::Cop::FormulaAudit::ClassName do
|
|||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < ScriptFileFormula
|
class Foo < ScriptFileFormula
|
||||||
^^^^^^^^^^^^^^^^^ ScriptFileFormula is deprecated, use Formula instead
|
^^^^^^^^^^^^^^^^^ ScriptFileFormula is deprecated, use Formula instead
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
end
|
end
|
||||||
RUBY
|
RUBY
|
||||||
end
|
end
|
||||||
@ -16,7 +16,7 @@ describe RuboCop::Cop::FormulaAudit::ClassName do
|
|||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < GithubGistFormula
|
class Foo < GithubGistFormula
|
||||||
^^^^^^^^^^^^^^^^^ GithubGistFormula is deprecated, use Formula instead
|
^^^^^^^^^^^^^^^^^ GithubGistFormula is deprecated, use Formula instead
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
end
|
end
|
||||||
RUBY
|
RUBY
|
||||||
end
|
end
|
||||||
@ -25,7 +25,7 @@ describe RuboCop::Cop::FormulaAudit::ClassName do
|
|||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < AmazonWebServicesFormula
|
class Foo < AmazonWebServicesFormula
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^ AmazonWebServicesFormula is deprecated, use Formula instead
|
^^^^^^^^^^^^^^^^^^^^^^^^ AmazonWebServicesFormula is deprecated, use Formula instead
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
end
|
end
|
||||||
RUBY
|
RUBY
|
||||||
end
|
end
|
||||||
@ -33,13 +33,13 @@ describe RuboCop::Cop::FormulaAudit::ClassName do
|
|||||||
it "supports auto-correcting deprecated parent classes" do
|
it "supports auto-correcting deprecated parent classes" do
|
||||||
source = <<~RUBY
|
source = <<~RUBY
|
||||||
class Foo < AmazonWebServicesFormula
|
class Foo < AmazonWebServicesFormula
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
end
|
end
|
||||||
RUBY
|
RUBY
|
||||||
|
|
||||||
corrected_source = <<~RUBY
|
corrected_source = <<~RUBY
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
end
|
end
|
||||||
RUBY
|
RUBY
|
||||||
|
|
||||||
@ -55,7 +55,7 @@ describe RuboCop::Cop::FormulaAuditStrict::Test do
|
|||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
^^^^^^^^^^^^^^^^^^^ A `test do` test block should be added
|
^^^^^^^^^^^^^^^^^^^ A `test do` test block should be added
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
end
|
end
|
||||||
RUBY
|
RUBY
|
||||||
end
|
end
|
||||||
|
|||||||
@ -7,9 +7,9 @@ describe RuboCop::Cop::FormulaAudit::ComponentsOrder do
|
|||||||
it "When url precedes homepage" do
|
it "When url precedes homepage" do
|
||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
url "http://example.com/foo-1.0.tgz"
|
url "https://example.com/foo-1.0.tgz"
|
||||||
homepage "http://example.com"
|
homepage "https://example.com"
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `homepage` (line 3) should be put before `url` (line 2)
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `homepage` (line 3) should be put before `url` (line 2)
|
||||||
end
|
end
|
||||||
RUBY
|
RUBY
|
||||||
end
|
end
|
||||||
@ -64,15 +64,15 @@ describe RuboCop::Cop::FormulaAudit::ComponentsOrder do
|
|||||||
it "When url precedes homepage" do
|
it "When url precedes homepage" do
|
||||||
source = <<~RUBY
|
source = <<~RUBY
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
url "http://example.com/foo-1.0.tgz"
|
url "https://example.com/foo-1.0.tgz"
|
||||||
homepage "http://example.com"
|
homepage "https://example.com"
|
||||||
end
|
end
|
||||||
RUBY
|
RUBY
|
||||||
|
|
||||||
correct_source = <<~RUBY
|
correct_source = <<~RUBY
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
homepage "http://example.com"
|
homepage "https://example.com"
|
||||||
url "http://example.com/foo-1.0.tgz"
|
url "https://example.com/foo-1.0.tgz"
|
||||||
end
|
end
|
||||||
RUBY
|
RUBY
|
||||||
|
|
||||||
|
|||||||
@ -7,8 +7,8 @@ describe RuboCop::Cop::FormulaAudit::ComponentsRedundancy do
|
|||||||
it "When url outside stable block" do
|
it "When url outside stable block" do
|
||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
url "http://example.com/foo-1.0.tgz"
|
url "https://example.com/foo-1.0.tgz"
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `url` should be put inside `stable` block
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `url` should be put inside `stable` block
|
||||||
stable do
|
stable do
|
||||||
# stuff
|
# stuff
|
||||||
end
|
end
|
||||||
@ -23,7 +23,7 @@ describe RuboCop::Cop::FormulaAudit::ComponentsRedundancy do
|
|||||||
it "When both `head` and `head do` are present" do
|
it "When both `head` and `head do` are present" do
|
||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
head "http://example.com/foo.git"
|
head "https://example.com/foo.git"
|
||||||
head do
|
head do
|
||||||
^^^^^^^ `head` and `head do` should not be simultaneously present
|
^^^^^^^ `head` and `head do` should not be simultaneously present
|
||||||
# stuff
|
# stuff
|
||||||
@ -35,7 +35,7 @@ describe RuboCop::Cop::FormulaAudit::ComponentsRedundancy do
|
|||||||
it "When both `bottle :modifier` and `bottle do` are present" do
|
it "When both `bottle :modifier` and `bottle do` are present" do
|
||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
url "http://example.com/foo-1.0.tgz"
|
url "https://example.com/foo-1.0.tgz"
|
||||||
bottle do
|
bottle do
|
||||||
^^^^^^^^^ `bottle :modifier` and `bottle do` should not be simultaneously present
|
^^^^^^^^^ `bottle :modifier` and `bottle do` should not be simultaneously present
|
||||||
# bottles go here
|
# bottles go here
|
||||||
@ -48,7 +48,7 @@ describe RuboCop::Cop::FormulaAudit::ComponentsRedundancy do
|
|||||||
it "When `stable do` is present with a `head` method" do
|
it "When `stable do` is present with a `head` method" do
|
||||||
expect_no_offenses(<<~RUBY)
|
expect_no_offenses(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
head "http://example.com/foo.git"
|
head "https://example.com/foo.git"
|
||||||
|
|
||||||
stable do
|
stable do
|
||||||
# stuff
|
# stuff
|
||||||
|
|||||||
@ -7,7 +7,7 @@ describe RuboCop::Cop::FormulaAudit::Conflicts do
|
|||||||
it "multiple conflicts_with" do
|
it "multiple conflicts_with" do
|
||||||
expect_offense(<<~RUBY, "/homebrew-core/Formula/foo@2.0.rb")
|
expect_offense(<<~RUBY, "/homebrew-core/Formula/foo@2.0.rb")
|
||||||
class FooAT20 < Formula
|
class FooAT20 < Formula
|
||||||
url 'http://example.com/foo-2.0.tgz'
|
url 'https://example.com/foo-2.0.tgz'
|
||||||
conflicts_with "mysql", "mariadb", "percona-server",
|
conflicts_with "mysql", "mariadb", "percona-server",
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Versioned formulae should not use `conflicts_with`. Use `keg_only :versioned_formula` instead.
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Versioned formulae should not use `conflicts_with`. Use `keg_only :versioned_formula` instead.
|
||||||
:because => "both install plugins"
|
:because => "both install plugins"
|
||||||
@ -18,7 +18,7 @@ describe RuboCop::Cop::FormulaAudit::Conflicts do
|
|||||||
it "no conflicts_with" do
|
it "no conflicts_with" do
|
||||||
expect_no_offenses(<<~RUBY, "/homebrew-core/Formula/foo@2.0.rb")
|
expect_no_offenses(<<~RUBY, "/homebrew-core/Formula/foo@2.0.rb")
|
||||||
class FooAT20 < Formula
|
class FooAT20 < Formula
|
||||||
url 'http://example.com/foo-2.0.tgz'
|
url 'https://example.com/foo-2.0.tgz'
|
||||||
desc 'Bar'
|
desc 'Bar'
|
||||||
end
|
end
|
||||||
RUBY
|
RUBY
|
||||||
|
|||||||
@ -7,8 +7,8 @@ describe RuboCop::Cop::NewFormulaAudit::DependencyOrder do
|
|||||||
it "wrong conditional depends_on order" do
|
it "wrong conditional depends_on order" do
|
||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
homepage "http://example.com"
|
homepage "https://example.com"
|
||||||
url "http://example.com/foo-1.0.tgz"
|
url "https://example.com/foo-1.0.tgz"
|
||||||
depends_on "apple" if build.with? "foo"
|
depends_on "apple" if build.with? "foo"
|
||||||
depends_on "foo" => :optional
|
depends_on "foo" => :optional
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ dependency "foo" (line 5) should be put before dependency "apple" (line 4)
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ dependency "foo" (line 5) should be put before dependency "apple" (line 4)
|
||||||
@ -19,8 +19,8 @@ describe RuboCop::Cop::NewFormulaAudit::DependencyOrder do
|
|||||||
it "wrong alphabetical depends_on order" do
|
it "wrong alphabetical depends_on order" do
|
||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
homepage "http://example.com"
|
homepage "https://example.com"
|
||||||
url "http://example.com/foo-1.0.tgz"
|
url "https://example.com/foo-1.0.tgz"
|
||||||
depends_on "foo"
|
depends_on "foo"
|
||||||
depends_on "bar"
|
depends_on "bar"
|
||||||
^^^^^^^^^^^^^^^^ dependency "bar" (line 5) should be put before dependency "foo" (line 4)
|
^^^^^^^^^^^^^^^^ dependency "bar" (line 5) should be put before dependency "foo" (line 4)
|
||||||
@ -31,8 +31,8 @@ describe RuboCop::Cop::NewFormulaAudit::DependencyOrder do
|
|||||||
it "supports requirement constants" do
|
it "supports requirement constants" do
|
||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
homepage "http://example.com"
|
homepage "https://example.com"
|
||||||
url "http://example.com/foo-1.0.tgz"
|
url "https://example.com/foo-1.0.tgz"
|
||||||
depends_on FooRequirement
|
depends_on FooRequirement
|
||||||
depends_on "bar"
|
depends_on "bar"
|
||||||
^^^^^^^^^^^^^^^^ dependency "bar" (line 5) should be put before dependency "FooRequirement" (line 4)
|
^^^^^^^^^^^^^^^^ dependency "bar" (line 5) should be put before dependency "FooRequirement" (line 4)
|
||||||
@ -43,8 +43,8 @@ describe RuboCop::Cop::NewFormulaAudit::DependencyOrder do
|
|||||||
it "wrong conditional depends_on order" do
|
it "wrong conditional depends_on order" do
|
||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
homepage "http://example.com"
|
homepage "https://example.com"
|
||||||
url "http://example.com/foo-1.0.tgz"
|
url "https://example.com/foo-1.0.tgz"
|
||||||
head do
|
head do
|
||||||
depends_on "apple" if build.with? "foo"
|
depends_on "apple" if build.with? "foo"
|
||||||
depends_on "bar"
|
depends_on "bar"
|
||||||
@ -62,8 +62,8 @@ describe RuboCop::Cop::NewFormulaAudit::DependencyOrder do
|
|||||||
it "correct depends_on order for multiple tags" do
|
it "correct depends_on order for multiple tags" do
|
||||||
expect_no_offenses(<<~RUBY)
|
expect_no_offenses(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
homepage "http://example.com"
|
homepage "https://example.com"
|
||||||
url "http://example.com/foo-1.0.tgz"
|
url "https://example.com/foo-1.0.tgz"
|
||||||
depends_on "bar" => [:build, :test]
|
depends_on "bar" => [:build, :test]
|
||||||
depends_on "foo" => :build
|
depends_on "foo" => :build
|
||||||
depends_on "apple"
|
depends_on "apple"
|
||||||
@ -76,8 +76,8 @@ describe RuboCop::Cop::NewFormulaAudit::DependencyOrder do
|
|||||||
it "wrong conditional depends_on order" do
|
it "wrong conditional depends_on order" do
|
||||||
source = <<~RUBY
|
source = <<~RUBY
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
homepage "http://example.com"
|
homepage "https://example.com"
|
||||||
url "http://example.com/foo-1.0.tgz"
|
url "https://example.com/foo-1.0.tgz"
|
||||||
depends_on "apple" if build.with? "foo"
|
depends_on "apple" if build.with? "foo"
|
||||||
depends_on "foo" => :optional
|
depends_on "foo" => :optional
|
||||||
end
|
end
|
||||||
@ -85,8 +85,8 @@ describe RuboCop::Cop::NewFormulaAudit::DependencyOrder do
|
|||||||
|
|
||||||
correct_source = <<~RUBY
|
correct_source = <<~RUBY
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
homepage "http://example.com"
|
homepage "https://example.com"
|
||||||
url "http://example.com/foo-1.0.tgz"
|
url "https://example.com/foo-1.0.tgz"
|
||||||
depends_on "foo" => :optional
|
depends_on "foo" => :optional
|
||||||
depends_on "apple" if build.with? "foo"
|
depends_on "apple" if build.with? "foo"
|
||||||
end
|
end
|
||||||
|
|||||||
@ -8,7 +8,7 @@ describe RuboCop::Cop::FormulaAudit::DescLength do
|
|||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
^^^^^^^^^^^^^^^^^^^ Formula should have a desc (Description).
|
^^^^^^^^^^^^^^^^^^^ Formula should have a desc (Description).
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
end
|
end
|
||||||
RUBY
|
RUBY
|
||||||
end
|
end
|
||||||
@ -16,7 +16,7 @@ describe RuboCop::Cop::FormulaAudit::DescLength do
|
|||||||
it "reports an offense when desc is an empty string" do
|
it "reports an offense when desc is an empty string" do
|
||||||
expect_offense(<<~RUBY, "/homebrew-core/Formula/foo.rb")
|
expect_offense(<<~RUBY, "/homebrew-core/Formula/foo.rb")
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
desc ''
|
desc ''
|
||||||
^^^^^^^ The desc (description) should not be an empty string.
|
^^^^^^^ The desc (description) should not be an empty string.
|
||||||
end
|
end
|
||||||
@ -26,7 +26,7 @@ describe RuboCop::Cop::FormulaAudit::DescLength do
|
|||||||
it "When desc is too long" do
|
it "When desc is too long" do
|
||||||
expect_offense(<<~RUBY, "/homebrew-core/Formula/foo.rb")
|
expect_offense(<<~RUBY, "/homebrew-core/Formula/foo.rb")
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
desc 'Bar#{"bar" * 29}'
|
desc 'Bar#{"bar" * 29}'
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Description is too long. "name: desc" should be less than 80 characters. Length is calculated as foo + desc. (currently 95)
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Description is too long. "name: desc" should be less than 80 characters. Length is calculated as foo + desc. (currently 95)
|
||||||
end
|
end
|
||||||
@ -36,7 +36,7 @@ describe RuboCop::Cop::FormulaAudit::DescLength do
|
|||||||
it "When desc is multiline string" do
|
it "When desc is multiline string" do
|
||||||
expect_offense(<<~RUBY, "/homebrew-core/Formula/foo.rb")
|
expect_offense(<<~RUBY, "/homebrew-core/Formula/foo.rb")
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
desc 'Bar#{"bar" * 9}'\
|
desc 'Bar#{"bar" * 9}'\
|
||||||
'#{"foo" * 21}'
|
'#{"foo" * 21}'
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Description is too long. "name: desc" should be less than 80 characters. Length is calculated as foo + desc. (currently 98)
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Description is too long. "name: desc" should be less than 80 characters. Length is calculated as foo + desc. (currently 98)
|
||||||
@ -53,7 +53,7 @@ describe RuboCop::Cop::FormulaAuditStrict::Desc do
|
|||||||
it "When wrong \"command-line\" usage in desc" do
|
it "When wrong \"command-line\" usage in desc" do
|
||||||
expect_offense(<<~RUBY, "/homebrew-core/Formula/foo.rb")
|
expect_offense(<<~RUBY, "/homebrew-core/Formula/foo.rb")
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
desc 'command line'
|
desc 'command line'
|
||||||
^ Description should start with a capital letter
|
^ Description should start with a capital letter
|
||||||
^^^^^^^^^^^^ Description should use \"command-line\" instead of \"command line\"
|
^^^^^^^^^^^^ Description should use \"command-line\" instead of \"command line\"
|
||||||
@ -64,7 +64,7 @@ describe RuboCop::Cop::FormulaAuditStrict::Desc do
|
|||||||
it "When an article is used in desc" do
|
it "When an article is used in desc" do
|
||||||
expect_offense(<<~RUBY, "/homebrew-core/Formula/foo.rb")
|
expect_offense(<<~RUBY, "/homebrew-core/Formula/foo.rb")
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
desc 'An aardvark'
|
desc 'An aardvark'
|
||||||
^^^ Description shouldn\'t start with an indefinite article i.e. \"An\"
|
^^^ Description shouldn\'t start with an indefinite article i.e. \"An\"
|
||||||
end
|
end
|
||||||
@ -74,7 +74,7 @@ describe RuboCop::Cop::FormulaAuditStrict::Desc do
|
|||||||
it "When an lowercase letter starts a desc" do
|
it "When an lowercase letter starts a desc" do
|
||||||
expect_offense(<<~RUBY, "/homebrew-core/Formula/foo.rb")
|
expect_offense(<<~RUBY, "/homebrew-core/Formula/foo.rb")
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
desc 'bar'
|
desc 'bar'
|
||||||
^ Description should start with a capital letter
|
^ Description should start with a capital letter
|
||||||
end
|
end
|
||||||
@ -84,7 +84,7 @@ describe RuboCop::Cop::FormulaAuditStrict::Desc do
|
|||||||
it "When formula name is in desc" do
|
it "When formula name is in desc" do
|
||||||
expect_offense(<<~RUBY, "/homebrew-core/Formula/foo.rb")
|
expect_offense(<<~RUBY, "/homebrew-core/Formula/foo.rb")
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
desc 'Foo is a foobar'
|
desc 'Foo is a foobar'
|
||||||
^^^^ Description shouldn\'t start with the formula name
|
^^^^ Description shouldn\'t start with the formula name
|
||||||
end
|
end
|
||||||
@ -94,7 +94,7 @@ describe RuboCop::Cop::FormulaAuditStrict::Desc do
|
|||||||
it "When the description ends with a full stop" do
|
it "When the description ends with a full stop" do
|
||||||
expect_offense(<<~RUBY, "/homebrew-core/Formula/foo.rb")
|
expect_offense(<<~RUBY, "/homebrew-core/Formula/foo.rb")
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
desc 'Description with a full stop at the end.'
|
desc 'Description with a full stop at the end.'
|
||||||
^ Description shouldn\'t end with a full stop
|
^ Description shouldn\'t end with a full stop
|
||||||
end
|
end
|
||||||
@ -104,7 +104,7 @@ describe RuboCop::Cop::FormulaAuditStrict::Desc do
|
|||||||
it "When the description starts with a leading space" do
|
it "When the description starts with a leading space" do
|
||||||
expect_offense(<<~RUBY, "/homebrew-core/Formula/foo.rb")
|
expect_offense(<<~RUBY, "/homebrew-core/Formula/foo.rb")
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
desc ' Description with a leading space'
|
desc ' Description with a leading space'
|
||||||
^ Description shouldn\'t have a leading space
|
^ Description shouldn\'t have a leading space
|
||||||
end
|
end
|
||||||
@ -114,7 +114,7 @@ describe RuboCop::Cop::FormulaAuditStrict::Desc do
|
|||||||
it "When the description ends with a trailing space" do
|
it "When the description ends with a trailing space" do
|
||||||
expect_offense(<<~RUBY, "/homebrew-core/Formula/foo.rb")
|
expect_offense(<<~RUBY, "/homebrew-core/Formula/foo.rb")
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
desc 'Description with a trailing space '
|
desc 'Description with a trailing space '
|
||||||
^ Description shouldn\'t have a trailing space
|
^ Description shouldn\'t have a trailing space
|
||||||
end
|
end
|
||||||
@ -124,14 +124,14 @@ describe RuboCop::Cop::FormulaAuditStrict::Desc do
|
|||||||
it "autocorrects all rules" do
|
it "autocorrects all rules" do
|
||||||
source = <<~RUBY
|
source = <<~RUBY
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
desc ' an bar: commandline foo '
|
desc ' an bar: commandline foo '
|
||||||
end
|
end
|
||||||
RUBY
|
RUBY
|
||||||
|
|
||||||
correct_source = <<~RUBY
|
correct_source = <<~RUBY
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
desc 'an bar: command-line'
|
desc 'an bar: command-line'
|
||||||
end
|
end
|
||||||
RUBY
|
RUBY
|
||||||
|
|||||||
@ -7,7 +7,7 @@ describe RuboCop::Cop::FormulaAudit::Homepage do
|
|||||||
it "When there is no homepage" do
|
it "When there is no homepage" do
|
||||||
source = <<~RUBY
|
source = <<~RUBY
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
end
|
end
|
||||||
RUBY
|
RUBY
|
||||||
|
|
||||||
@ -28,7 +28,7 @@ describe RuboCop::Cop::FormulaAudit::Homepage do
|
|||||||
source = <<~RUBY
|
source = <<~RUBY
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
homepage "ftp://example.com/foo"
|
homepage "ftp://example.com/foo"
|
||||||
url "http://example.com/foo-1.0.tgz"
|
url "https://example.com/foo-1.0.tgz"
|
||||||
end
|
end
|
||||||
RUBY
|
RUBY
|
||||||
|
|
||||||
@ -65,7 +65,7 @@ describe RuboCop::Cop::FormulaAudit::Homepage do
|
|||||||
source = <<~RUBY
|
source = <<~RUBY
|
||||||
class #{name.capitalize} < Formula
|
class #{name.capitalize} < Formula
|
||||||
homepage "#{homepage}"
|
homepage "#{homepage}"
|
||||||
url "http://example.com/#{name}-1.0.tgz"
|
url "https://example.com/#{name}-1.0.tgz"
|
||||||
end
|
end
|
||||||
RUBY
|
RUBY
|
||||||
|
|
||||||
|
|||||||
@ -6,7 +6,7 @@ describe RuboCop::Cop::FormulaAudit::Lines do
|
|||||||
it "reports an offense when using depends_on :automake" do
|
it "reports an offense when using depends_on :automake" do
|
||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
depends_on :automake
|
depends_on :automake
|
||||||
^^^^^^^^^^^^^^^^^^^^ :automake is deprecated. Usage should be \"automake\".
|
^^^^^^^^^^^^^^^^^^^^ :automake is deprecated. Usage should be \"automake\".
|
||||||
end
|
end
|
||||||
@ -16,7 +16,7 @@ describe RuboCop::Cop::FormulaAudit::Lines do
|
|||||||
it "reports an offense when using depends_on :autoconf" do
|
it "reports an offense when using depends_on :autoconf" do
|
||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
depends_on :autoconf
|
depends_on :autoconf
|
||||||
^^^^^^^^^^^^^^^^^^^^ :autoconf is deprecated. Usage should be \"autoconf\".
|
^^^^^^^^^^^^^^^^^^^^ :autoconf is deprecated. Usage should be \"autoconf\".
|
||||||
end
|
end
|
||||||
@ -26,7 +26,7 @@ describe RuboCop::Cop::FormulaAudit::Lines do
|
|||||||
it "reports an offense when using depends_on :libtool" do
|
it "reports an offense when using depends_on :libtool" do
|
||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
depends_on :libtool
|
depends_on :libtool
|
||||||
^^^^^^^^^^^^^^^^^^^ :libtool is deprecated. Usage should be \"libtool\".
|
^^^^^^^^^^^^^^^^^^^ :libtool is deprecated. Usage should be \"libtool\".
|
||||||
end
|
end
|
||||||
@ -36,7 +36,7 @@ describe RuboCop::Cop::FormulaAudit::Lines do
|
|||||||
it "reports an offense when using depends_on :apr" do
|
it "reports an offense when using depends_on :apr" do
|
||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
depends_on :apr
|
depends_on :apr
|
||||||
^^^^^^^^^^^^^^^ :apr is deprecated. Usage should be \"apr-util\".
|
^^^^^^^^^^^^^^^ :apr is deprecated. Usage should be \"apr-util\".
|
||||||
end
|
end
|
||||||
@ -46,7 +46,7 @@ describe RuboCop::Cop::FormulaAudit::Lines do
|
|||||||
it "reports an offense when using depends_on :tex" do
|
it "reports an offense when using depends_on :tex" do
|
||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
depends_on :tex
|
depends_on :tex
|
||||||
^^^^^^^^^^^^^^^ :tex is deprecated.
|
^^^^^^^^^^^^^^^ :tex is deprecated.
|
||||||
end
|
end
|
||||||
@ -62,7 +62,7 @@ describe RuboCop::Cop::FormulaAudit::ClassInheritance do
|
|||||||
class Foo<Formula
|
class Foo<Formula
|
||||||
^^^^^^^ Use a space in class inheritance: class Foo < Formula
|
^^^^^^^ Use a space in class inheritance: class Foo < Formula
|
||||||
desc "foo"
|
desc "foo"
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
end
|
end
|
||||||
RUBY
|
RUBY
|
||||||
end
|
end
|
||||||
@ -76,7 +76,7 @@ describe RuboCop::Cop::FormulaAudit::Comments do
|
|||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
desc "foo"
|
desc "foo"
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
# system "cmake", ".", *std_cmake_args
|
# system "cmake", ".", *std_cmake_args
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Please remove default template comments
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Please remove default template comments
|
||||||
end
|
end
|
||||||
@ -89,7 +89,7 @@ describe RuboCop::Cop::FormulaAudit::Comments do
|
|||||||
# PLEASE REMOVE
|
# PLEASE REMOVE
|
||||||
^^^^^^^^^^^^^^^ Please remove default template comments
|
^^^^^^^^^^^^^^^ Please remove default template comments
|
||||||
desc "foo"
|
desc "foo"
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
end
|
end
|
||||||
RUBY
|
RUBY
|
||||||
end
|
end
|
||||||
@ -98,7 +98,7 @@ describe RuboCop::Cop::FormulaAudit::Comments do
|
|||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
desc "foo"
|
desc "foo"
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
# depends_on "foo"
|
# depends_on "foo"
|
||||||
^^^^^^^^^^^^^^^^^^ Commented-out dependency "foo"
|
^^^^^^^^^^^^^^^^^^ Commented-out dependency "foo"
|
||||||
end
|
end
|
||||||
@ -114,7 +114,7 @@ describe RuboCop::Cop::FormulaAudit::AssertStatements do
|
|||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
desc "foo"
|
desc "foo"
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
assert File.read("inbox").include?("Sample message 1")
|
assert File.read("inbox").include?("Sample message 1")
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Use `assert_match` instead of `assert ...include?`
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Use `assert_match` instead of `assert ...include?`
|
||||||
end
|
end
|
||||||
@ -125,7 +125,7 @@ describe RuboCop::Cop::FormulaAudit::AssertStatements do
|
|||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
desc "foo"
|
desc "foo"
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
assert File.exist? "default.ini"
|
assert File.exist? "default.ini"
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^ Use `assert_predicate <path_to_file>, :exist?` instead of `assert File.exist? "default.ini"`
|
^^^^^^^^^^^^^^^^^^^^^^^^^ Use `assert_predicate <path_to_file>, :exist?` instead of `assert File.exist? "default.ini"`
|
||||||
end
|
end
|
||||||
@ -136,7 +136,7 @@ describe RuboCop::Cop::FormulaAudit::AssertStatements do
|
|||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
desc "foo"
|
desc "foo"
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
assert !File.exist?("default.ini")
|
assert !File.exist?("default.ini")
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^ Use `refute_predicate <path_to_file>, :exist?` instead of `assert !File.exist?("default.ini")`
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^ Use `refute_predicate <path_to_file>, :exist?` instead of `assert !File.exist?("default.ini")`
|
||||||
end
|
end
|
||||||
@ -147,7 +147,7 @@ describe RuboCop::Cop::FormulaAudit::AssertStatements do
|
|||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
desc "foo"
|
desc "foo"
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
assert File.executable? f
|
assert File.executable? f
|
||||||
^^^^^^^^^^^^^^^^^^ Use `assert_predicate <path_to_file>, :executable?` instead of `assert File.executable? f`
|
^^^^^^^^^^^^^^^^^^ Use `assert_predicate <path_to_file>, :executable?` instead of `assert File.executable? f`
|
||||||
end
|
end
|
||||||
@ -162,7 +162,7 @@ describe RuboCop::Cop::FormulaAudit::OptionDeclarations do
|
|||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
desc "foo"
|
desc "foo"
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
def post_install
|
def post_install
|
||||||
return unless build.without? "bar"
|
return unless build.without? "bar"
|
||||||
^^^^^^^^^^^^^^^^^^^^ Use if build.with? "bar" instead of unless build.without? "bar"
|
^^^^^^^^^^^^^^^^^^^^ Use if build.with? "bar" instead of unless build.without? "bar"
|
||||||
@ -175,7 +175,7 @@ describe RuboCop::Cop::FormulaAudit::OptionDeclarations do
|
|||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
desc "foo"
|
desc "foo"
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
def post_install
|
def post_install
|
||||||
return unless build.with? "bar"
|
return unless build.with? "bar"
|
||||||
^^^^^^^^^^^^^^^^^ Use if build.without? "bar" instead of unless build.with? "bar"
|
^^^^^^^^^^^^^^^^^ Use if build.without? "bar" instead of unless build.with? "bar"
|
||||||
@ -188,7 +188,7 @@ describe RuboCop::Cop::FormulaAudit::OptionDeclarations do
|
|||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
desc "foo"
|
desc "foo"
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
def post_install
|
def post_install
|
||||||
return if !build.with? "bar"
|
return if !build.with? "bar"
|
||||||
^^^^^^^^^^^^^^^^^^ Don't negate 'build.with?': use 'build.without?'
|
^^^^^^^^^^^^^^^^^^ Don't negate 'build.with?': use 'build.without?'
|
||||||
@ -201,7 +201,7 @@ describe RuboCop::Cop::FormulaAudit::OptionDeclarations do
|
|||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
desc "foo"
|
desc "foo"
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
def post_install
|
def post_install
|
||||||
return if !build.without? "bar"
|
return if !build.without? "bar"
|
||||||
^^^^^^^^^^^^^^^^^^^^^ Don't negate 'build.without?': use 'build.with?'
|
^^^^^^^^^^^^^^^^^^^^^ Don't negate 'build.without?': use 'build.with?'
|
||||||
@ -214,7 +214,7 @@ describe RuboCop::Cop::FormulaAudit::OptionDeclarations do
|
|||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
desc "foo"
|
desc "foo"
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
def post_install
|
def post_install
|
||||||
return if build.without? "--without-bar"
|
return if build.without? "--without-bar"
|
||||||
^^^^^^^^^^^^^ Don't duplicate 'without': Use `build.without? \"bar\"` to check for \"--without-bar\"
|
^^^^^^^^^^^^^ Don't duplicate 'without': Use `build.without? \"bar\"` to check for \"--without-bar\"
|
||||||
@ -227,7 +227,7 @@ describe RuboCop::Cop::FormulaAudit::OptionDeclarations do
|
|||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
desc "foo"
|
desc "foo"
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
def post_install
|
def post_install
|
||||||
return if build.with? "--with-bar"
|
return if build.with? "--with-bar"
|
||||||
^^^^^^^^^^ Don't duplicate 'with': Use `build.with? \"bar\"` to check for \"--with-bar\"
|
^^^^^^^^^^ Don't duplicate 'with': Use `build.with? \"bar\"` to check for \"--with-bar\"
|
||||||
@ -240,7 +240,7 @@ describe RuboCop::Cop::FormulaAudit::OptionDeclarations do
|
|||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
desc "foo"
|
desc "foo"
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
def post_install
|
def post_install
|
||||||
return if build.include? "without-bar"
|
return if build.include? "without-bar"
|
||||||
^^^^^^^^^^^ Use build.without? \"bar\" instead of build.include? 'without-bar'
|
^^^^^^^^^^^ Use build.without? \"bar\" instead of build.include? 'without-bar'
|
||||||
@ -253,7 +253,7 @@ describe RuboCop::Cop::FormulaAudit::OptionDeclarations do
|
|||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
desc "foo"
|
desc "foo"
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
def post_install
|
def post_install
|
||||||
return if build.include? "--bar"
|
return if build.include? "--bar"
|
||||||
^^^^^ Reference 'bar' without dashes
|
^^^^^ Reference 'bar' without dashes
|
||||||
@ -266,7 +266,7 @@ describe RuboCop::Cop::FormulaAudit::OptionDeclarations do
|
|||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
desc "foo"
|
desc "foo"
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
|
|
||||||
def options
|
def options
|
||||||
^^^^^^^^^^^ Use new-style option definitions
|
^^^^^^^^^^^ Use new-style option definitions
|
||||||
@ -285,7 +285,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do
|
|||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
desc "foo"
|
desc "foo"
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
FileUtils.mv "hello"
|
FileUtils.mv "hello"
|
||||||
^^^^^^^^^^^^^^^^^^^^ Don\'t need \'FileUtils.\' before mv
|
^^^^^^^^^^^^^^^^^^^^ Don\'t need \'FileUtils.\' before mv
|
||||||
end
|
end
|
||||||
@ -296,7 +296,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do
|
|||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
desc "foo"
|
desc "foo"
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
inreplace "foo" do |longvar|
|
inreplace "foo" do |longvar|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^ \"inreplace <filenames> do |s|\" is preferred over \"|longvar|\".
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^ \"inreplace <filenames> do |s|\" is preferred over \"|longvar|\".
|
||||||
somerandomCall(longvar)
|
somerandomCall(longvar)
|
||||||
@ -309,7 +309,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do
|
|||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
desc "foo"
|
desc "foo"
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
bottle do
|
bottle do
|
||||||
rebuild 0
|
rebuild 0
|
||||||
^^^^^^^^^ 'rebuild 0' should be removed
|
^^^^^^^^^ 'rebuild 0' should be removed
|
||||||
@ -323,7 +323,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do
|
|||||||
expect_offense(<<~RUBY, "/homebrew-core/")
|
expect_offense(<<~RUBY, "/homebrew-core/")
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
desc "foo"
|
desc "foo"
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
bottle do
|
bottle do
|
||||||
if OS.linux?
|
if OS.linux?
|
||||||
^^^^^^^^^ Don\'t use OS.linux?; Homebrew/core only supports macOS
|
^^^^^^^^^ Don\'t use OS.linux?; Homebrew/core only supports macOS
|
||||||
@ -339,7 +339,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do
|
|||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
desc "foo"
|
desc "foo"
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
bottle do
|
bottle do
|
||||||
sha256 "fe0679b932dd43a87fd415b609a7fbac7a069d117642ae8ebaac46ae1fb9f0b3" => :sierra
|
sha256 "fe0679b932dd43a87fd415b609a7fbac7a069d117642ae8ebaac46ae1fb9f0b3" => :sierra
|
||||||
end
|
end
|
||||||
@ -356,7 +356,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do
|
|||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
desc "foo"
|
desc "foo"
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
|
|
||||||
def test
|
def test
|
||||||
^^^^^^^^ Use new-style test definitions (test do)
|
^^^^^^^^ Use new-style test definitions (test do)
|
||||||
@ -370,7 +370,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do
|
|||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
desc "foo"
|
desc "foo"
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
skip_clean :all
|
skip_clean :all
|
||||||
^^^^^^^^^^^^^^^ `skip_clean :all` is deprecated; brew no longer strips symbols. Pass explicit paths to prevent Homebrew from removing empty folders.
|
^^^^^^^^^^^^^^^ `skip_clean :all` is deprecated; brew no longer strips symbols. Pass explicit paths to prevent Homebrew from removing empty folders.
|
||||||
end
|
end
|
||||||
@ -381,7 +381,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do
|
|||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
desc "foo"
|
desc "foo"
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
if build.universal?
|
if build.universal?
|
||||||
^^^^^^^^^^^^^^^^ macOS has been 64-bit only since 10.6 so build.universal? is deprecated.
|
^^^^^^^^^^^^^^^^ macOS has been 64-bit only since 10.6 so build.universal? is deprecated.
|
||||||
"foo"
|
"foo"
|
||||||
@ -394,7 +394,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do
|
|||||||
expect_no_offenses(<<~RUBY, "/homebrew-core/Formula/wine.rb")
|
expect_no_offenses(<<~RUBY, "/homebrew-core/Formula/wine.rb")
|
||||||
class Wine < Formula
|
class Wine < Formula
|
||||||
desc "foo"
|
desc "foo"
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
if build.universal?
|
if build.universal?
|
||||||
"foo"
|
"foo"
|
||||||
end
|
end
|
||||||
@ -406,7 +406,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do
|
|||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
desc "foo"
|
desc "foo"
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
if build?
|
if build?
|
||||||
ENV.universal_binary
|
ENV.universal_binary
|
||||||
^^^^^^^^^^^^^^^^^^^^ macOS has been 64-bit only since 10.6 so ENV.universal_binary is deprecated.
|
^^^^^^^^^^^^^^^^^^^^ macOS has been 64-bit only since 10.6 so ENV.universal_binary is deprecated.
|
||||||
@ -419,7 +419,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do
|
|||||||
expect_no_offenses(<<~RUBY, "/homebrew-core/Formula/wine.rb")
|
expect_no_offenses(<<~RUBY, "/homebrew-core/Formula/wine.rb")
|
||||||
class Wine < Formula
|
class Wine < Formula
|
||||||
desc "foo"
|
desc "foo"
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
if build?
|
if build?
|
||||||
ENV.universal_binary
|
ENV.universal_binary
|
||||||
end
|
end
|
||||||
@ -431,7 +431,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do
|
|||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
desc "foo"
|
desc "foo"
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
if build?
|
if build?
|
||||||
ENV.x11
|
ENV.x11
|
||||||
^^^^^^^ Use "depends_on :x11" instead of "ENV.x11"
|
^^^^^^^ Use "depends_on :x11" instead of "ENV.x11"
|
||||||
@ -444,7 +444,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do
|
|||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
desc "foo"
|
desc "foo"
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
system "install_name_tool", "-id"
|
system "install_name_tool", "-id"
|
||||||
^^^^^^^^^^^^^^^^^ Use ruby-macho instead of calling "install_name_tool"
|
^^^^^^^^^^^^^^^^^ Use ruby-macho instead of calling "install_name_tool"
|
||||||
end
|
end
|
||||||
@ -455,7 +455,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do
|
|||||||
expect_no_offenses(<<~RUBY, "/homebrew-core/Formula/cctools.rb")
|
expect_no_offenses(<<~RUBY, "/homebrew-core/Formula/cctools.rb")
|
||||||
class Cctools < Formula
|
class Cctools < Formula
|
||||||
desc "foo"
|
desc "foo"
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
system "install_name_tool", "-id"
|
system "install_name_tool", "-id"
|
||||||
end
|
end
|
||||||
RUBY
|
RUBY
|
||||||
@ -465,7 +465,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do
|
|||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
desc "foo"
|
desc "foo"
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
system "npm", "install"
|
system "npm", "install"
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^ Use Language::Node for npm install args
|
^^^^^^^^^^^^^^^^^^^^^^^ Use Language::Node for npm install args
|
||||||
end
|
end
|
||||||
@ -476,7 +476,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do
|
|||||||
expect_no_offenses(<<~RUBY, "/homebrew-core/Formula/kibana@4.4.rb")
|
expect_no_offenses(<<~RUBY, "/homebrew-core/Formula/kibana@4.4.rb")
|
||||||
class KibanaAT44 < Formula
|
class KibanaAT44 < Formula
|
||||||
desc "foo"
|
desc "foo"
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
system "npm", "install"
|
system "npm", "install"
|
||||||
end
|
end
|
||||||
RUBY
|
RUBY
|
||||||
@ -486,7 +486,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do
|
|||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
desc "foo"
|
desc "foo"
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
depends_on FOO::BAR.new
|
depends_on FOO::BAR.new
|
||||||
^^^^^^^^^^^^ `depends_on` can take requirement classes instead of instances
|
^^^^^^^^^^^^ `depends_on` can take requirement classes instead of instances
|
||||||
end
|
end
|
||||||
@ -497,7 +497,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do
|
|||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
desc "foo"
|
desc "foo"
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
depends_on :foo if MacOS.snow_leopard?
|
depends_on :foo if MacOS.snow_leopard?
|
||||||
^^^^^^^^^^^^^^^^^^^ \"MacOS.snow_leopard?\" is deprecated, use a comparison to MacOS.version instead
|
^^^^^^^^^^^^^^^^^^^ \"MacOS.snow_leopard?\" is deprecated, use a comparison to MacOS.version instead
|
||||||
end
|
end
|
||||||
@ -508,7 +508,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do
|
|||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
desc "foo"
|
desc "foo"
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
rm_rf Dir["src/{llvm,test,librustdoc,etc/snapshot.pyc}"]
|
rm_rf Dir["src/{llvm,test,librustdoc,etc/snapshot.pyc}"]
|
||||||
rm_rf Dir["src/snapshot.pyc"]
|
rm_rf Dir["src/snapshot.pyc"]
|
||||||
^^^^^^^^^^^^^^^^ Dir(["src/snapshot.pyc"]) is unnecessary; just use "src/snapshot.pyc"
|
^^^^^^^^^^^^^^^^ Dir(["src/snapshot.pyc"]) is unnecessary; just use "src/snapshot.pyc"
|
||||||
@ -520,7 +520,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do
|
|||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
desc "foo"
|
desc "foo"
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
system "mkdir", "foo"
|
system "mkdir", "foo"
|
||||||
^^^^^ Use the `mkdir` Ruby method instead of `system "mkdir", "foo"`
|
^^^^^ Use the `mkdir` Ruby method instead of `system "mkdir", "foo"`
|
||||||
end
|
end
|
||||||
@ -535,7 +535,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do
|
|||||||
end
|
end
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
desc "foo"
|
desc "foo"
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
end
|
end
|
||||||
RUBY
|
RUBY
|
||||||
end
|
end
|
||||||
@ -544,7 +544,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do
|
|||||||
expect_no_offenses(<<~RUBY)
|
expect_no_offenses(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
desc "foo"
|
desc "foo"
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
def install
|
def install
|
||||||
verbose = ARGV.verbose?
|
verbose = ARGV.verbose?
|
||||||
end
|
end
|
||||||
@ -556,7 +556,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do
|
|||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
desc "foo"
|
desc "foo"
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
def install
|
def install
|
||||||
man1.install man+"man8" => "faad.1"
|
man1.install man+"man8" => "faad.1"
|
||||||
^^^^ "man+"man8"" should be "man8"
|
^^^^ "man+"man8"" should be "man8"
|
||||||
@ -569,7 +569,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do
|
|||||||
expect_offense(<<~'RUBY')
|
expect_offense(<<~'RUBY')
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
desc "foo"
|
desc "foo"
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
def install
|
def install
|
||||||
system "/usr/bin/gcc", "foo"
|
system "/usr/bin/gcc", "foo"
|
||||||
^^^^^^^^^^^^ Use "#{ENV.cc}" instead of hard-coding "gcc"
|
^^^^^^^^^^^^ Use "#{ENV.cc}" instead of hard-coding "gcc"
|
||||||
@ -582,7 +582,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do
|
|||||||
expect_offense(<<~'RUBY')
|
expect_offense(<<~'RUBY')
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
desc "foo"
|
desc "foo"
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
def install
|
def install
|
||||||
system "/usr/bin/g++", "-o", "foo", "foo.cc"
|
system "/usr/bin/g++", "-o", "foo", "foo.cc"
|
||||||
^^^^^^^^^^^^ Use "#{ENV.cxx}" instead of hard-coding "g++"
|
^^^^^^^^^^^^ Use "#{ENV.cxx}" instead of hard-coding "g++"
|
||||||
@ -595,7 +595,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do
|
|||||||
expect_offense(<<~'RUBY')
|
expect_offense(<<~'RUBY')
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
desc "foo"
|
desc "foo"
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
def install
|
def install
|
||||||
ENV["COMPILER_PATH"] = "/usr/bin/llvm-g++"
|
ENV["COMPILER_PATH"] = "/usr/bin/llvm-g++"
|
||||||
^^^^^^^^^^^^^^^^^ Use "#{ENV.cxx}" instead of hard-coding "llvm-g++"
|
^^^^^^^^^^^^^^^^^ Use "#{ENV.cxx}" instead of hard-coding "llvm-g++"
|
||||||
@ -608,7 +608,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do
|
|||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
desc "foo"
|
desc "foo"
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
def install
|
def install
|
||||||
ENV["COMPILER_PATH"] = "/usr/bin/gcc"
|
ENV["COMPILER_PATH"] = "/usr/bin/gcc"
|
||||||
^^^^^^^^^^^^ Use \"\#{ENV.cc}\" instead of hard-coding \"gcc\"
|
^^^^^^^^^^^^ Use \"\#{ENV.cc}\" instead of hard-coding \"gcc\"
|
||||||
@ -621,7 +621,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do
|
|||||||
expect_offense(<<~'RUBY')
|
expect_offense(<<~'RUBY')
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
desc "foo"
|
desc "foo"
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
def install
|
def install
|
||||||
mv "#{share}/man", share
|
mv "#{share}/man", share
|
||||||
^^^^ "#{share}/man" should be "#{man}"
|
^^^^ "#{share}/man" should be "#{man}"
|
||||||
@ -634,7 +634,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do
|
|||||||
expect_offense(<<~'RUBY')
|
expect_offense(<<~'RUBY')
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
desc "foo"
|
desc "foo"
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
def install
|
def install
|
||||||
mv "#{prefix}/libexec", share
|
mv "#{prefix}/libexec", share
|
||||||
^^^^^^^^ "#{prefix}/libexec" should be "#{libexec}"
|
^^^^^^^^ "#{prefix}/libexec" should be "#{libexec}"
|
||||||
@ -647,7 +647,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do
|
|||||||
expect_offense(<<~'RUBY')
|
expect_offense(<<~'RUBY')
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
desc "foo"
|
desc "foo"
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
def install
|
def install
|
||||||
system "./configure", "--INFODIR=#{prefix}/share/info"
|
system "./configure", "--INFODIR=#{prefix}/share/info"
|
||||||
^^^^^^ "#{prefix}/share" should be "#{share}"
|
^^^^^^ "#{prefix}/share" should be "#{share}"
|
||||||
@ -661,7 +661,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do
|
|||||||
expect_offense(<<~'RUBY')
|
expect_offense(<<~'RUBY')
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
desc "foo"
|
desc "foo"
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
def install
|
def install
|
||||||
system "./configure", "--MANDIR=#{prefix}/share/man/man8"
|
system "./configure", "--MANDIR=#{prefix}/share/man/man8"
|
||||||
^^^^^^ "#{prefix}/share" should be "#{share}"
|
^^^^^^ "#{prefix}/share" should be "#{share}"
|
||||||
@ -675,7 +675,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do
|
|||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
desc "foo"
|
desc "foo"
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
depends_on "lpeg" => :lua51
|
depends_on "lpeg" => :lua51
|
||||||
^^^^^ lua modules should be vendored rather than use deprecated depends_on \"lpeg\" => :lua51`
|
^^^^^ lua modules should be vendored rather than use deprecated depends_on \"lpeg\" => :lua51`
|
||||||
end
|
end
|
||||||
@ -686,7 +686,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do
|
|||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
desc "foo"
|
desc "foo"
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
system "export", "var=value"
|
system "export", "var=value"
|
||||||
^^^^^^ Use ENV instead of invoking 'export' to modify the environment
|
^^^^^^ Use ENV instead of invoking 'export' to modify the environment
|
||||||
end
|
end
|
||||||
@ -697,7 +697,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do
|
|||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
desc "foo"
|
desc "foo"
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
depends_on "foo" => "with-bar"
|
depends_on "foo" => "with-bar"
|
||||||
^^^^^^^^ Dependency foo should not use option with-bar
|
^^^^^^^^ Dependency foo should not use option with-bar
|
||||||
end
|
end
|
||||||
@ -708,7 +708,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do
|
|||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
desc "foo"
|
desc "foo"
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
depends_on "httpd" => [:build, :test]
|
depends_on "httpd" => [:build, :test]
|
||||||
depends_on "foo" => [:optional, "with-bar"]
|
depends_on "foo" => [:optional, "with-bar"]
|
||||||
^^^^^^^^ Dependency foo should not use option with-bar
|
^^^^^^^^ Dependency foo should not use option with-bar
|
||||||
@ -722,7 +722,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do
|
|||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
desc "foo"
|
desc "foo"
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
if version == "HEAD"
|
if version == "HEAD"
|
||||||
^^^^^^^^^^^^^^^^^ Use 'build.head?' instead of inspecting 'version'
|
^^^^^^^^^^^^^^^^^ Use 'build.head?' instead of inspecting 'version'
|
||||||
foo()
|
foo()
|
||||||
@ -735,7 +735,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do
|
|||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
desc "foo"
|
desc "foo"
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
test do
|
test do
|
||||||
head = ARGV.include? "--HEAD"
|
head = ARGV.include? "--HEAD"
|
||||||
^^^^^^ Use "if build.head?" instead
|
^^^^^^ Use "if build.head?" instead
|
||||||
@ -749,7 +749,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do
|
|||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
desc "foo"
|
desc "foo"
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
needs :openmp
|
needs :openmp
|
||||||
^^^^^^^^^^^^^ 'needs :openmp' should be replaced with 'depends_on \"gcc\"'
|
^^^^^^^^^^^^^ 'needs :openmp' should be replaced with 'depends_on \"gcc\"'
|
||||||
end
|
end
|
||||||
@ -760,7 +760,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do
|
|||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
desc "foo"
|
desc "foo"
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
test do
|
test do
|
||||||
version = MACOS_VERSION
|
version = MACOS_VERSION
|
||||||
^^^^^^^^^^^^^ Use MacOS.version instead of MACOS_VERSION
|
^^^^^^^^^^^^^ Use MacOS.version instead of MACOS_VERSION
|
||||||
@ -773,7 +773,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do
|
|||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
desc "foo"
|
desc "foo"
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
depends_on "foo" if build.with? "foo"
|
depends_on "foo" if build.with? "foo"
|
||||||
^^^^^^^^^^^^^^^^ Replace depends_on "foo" if build.with? "foo" with depends_on "foo" => :optional
|
^^^^^^^^^^^^^^^^ Replace depends_on "foo" if build.with? "foo" with depends_on "foo" => :optional
|
||||||
end
|
end
|
||||||
@ -784,7 +784,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do
|
|||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
desc "foo"
|
desc "foo"
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
depends_on :foo unless build.without? "foo"
|
depends_on :foo unless build.without? "foo"
|
||||||
^^^^^^^^^^^^^^^ Replace depends_on :foo unless build.without? "foo" with depends_on :foo => :recommended
|
^^^^^^^^^^^^^^^ Replace depends_on :foo unless build.without? "foo" with depends_on :foo => :recommended
|
||||||
end
|
end
|
||||||
@ -795,7 +795,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do
|
|||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
desc "foo"
|
desc "foo"
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
depends_on :foo unless build.include? "without-foo"
|
depends_on :foo unless build.include? "without-foo"
|
||||||
^^^^^^^^^^^^^^^ Replace depends_on :foo unless build.include? "without-foo" with depends_on :foo => :recommended
|
^^^^^^^^^^^^^^^ Replace depends_on :foo unless build.include? "without-foo" with depends_on :foo => :recommended
|
||||||
end
|
end
|
||||||
|
|||||||
@ -6,7 +6,7 @@ describe RuboCop::Cop::FormulaAudit::Options do
|
|||||||
it "reports an offense when using the 32-bit option" do
|
it "reports an offense when using the 32-bit option" do
|
||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
option "32-bit", "with 32-bit"
|
option "32-bit", "with 32-bit"
|
||||||
^^^^^^ macOS has been 64-bit only since 10.6 so 32-bit options are deprecated.
|
^^^^^^ macOS has been 64-bit only since 10.6 so 32-bit options are deprecated.
|
||||||
end
|
end
|
||||||
@ -21,7 +21,7 @@ describe RuboCop::Cop::FormulaAuditStrict::Options do
|
|||||||
it "with universal" do
|
it "with universal" do
|
||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
option :universal
|
option :universal
|
||||||
^^^^^^^^^^^^^^^^^ macOS has been 64-bit only since 10.6 so universal options are deprecated.
|
^^^^^^^^^^^^^^^^^ macOS has been 64-bit only since 10.6 so universal options are deprecated.
|
||||||
end
|
end
|
||||||
@ -31,7 +31,7 @@ describe RuboCop::Cop::FormulaAuditStrict::Options do
|
|||||||
it "with deprecated options" do
|
it "with deprecated options" do
|
||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
option :cxx11
|
option :cxx11
|
||||||
option "examples", "with-examples"
|
option "examples", "with-examples"
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Options should begin with with/without. Migrate '--examples' with `deprecated_option`.
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Options should begin with with/without. Migrate '--examples' with `deprecated_option`.
|
||||||
@ -42,7 +42,7 @@ describe RuboCop::Cop::FormulaAuditStrict::Options do
|
|||||||
it "with misc deprecated options" do
|
it "with misc deprecated options" do
|
||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
option "without-check"
|
option "without-check"
|
||||||
^^^^^^^^^^^^^^^^^^^^^^ Use '--without-test' instead of '--without-check'. Migrate '--without-check' with `deprecated_option`.
|
^^^^^^^^^^^^^^^^^^^^^^ Use '--without-test' instead of '--without-check'. Migrate '--without-check' with `deprecated_option`.
|
||||||
end
|
end
|
||||||
@ -58,7 +58,7 @@ describe RuboCop::Cop::NewFormulaAudit::Options do
|
|||||||
it "with deprecated options" do
|
it "with deprecated options" do
|
||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
deprecated_option "examples" => "with-examples"
|
deprecated_option "examples" => "with-examples"
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ New formulae should not use `deprecated_option`
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ New formulae should not use `deprecated_option`
|
||||||
end
|
end
|
||||||
@ -68,7 +68,7 @@ describe RuboCop::Cop::NewFormulaAudit::Options do
|
|||||||
it "with options" do
|
it "with options" do
|
||||||
expect_offense(<<~RUBY, "/homebrew-core/")
|
expect_offense(<<~RUBY, "/homebrew-core/")
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
option "with-examples"
|
option "with-examples"
|
||||||
^^^^^^^^^^^^^^^^^^^^^^ Formulae should not have an `option`
|
^^^^^^^^^^^^^^^^^^^^^^ Formulae should not have an `option`
|
||||||
end
|
end
|
||||||
|
|||||||
@ -7,7 +7,7 @@ describe RuboCop::Cop::FormulaAudit::Patches do
|
|||||||
it "When there is no legacy patch" do
|
it "When there is no legacy patch" do
|
||||||
expect_no_offenses(<<~RUBY)
|
expect_no_offenses(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
url 'http://example.com/foo-1.0.tgz'
|
url 'https://example.com/foo-1.0.tgz'
|
||||||
end
|
end
|
||||||
RUBY
|
RUBY
|
||||||
end
|
end
|
||||||
@ -16,7 +16,7 @@ describe RuboCop::Cop::FormulaAudit::Patches do
|
|||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
homepage "ftp://example.com/foo"
|
homepage "ftp://example.com/foo"
|
||||||
url "http://example.com/foo-1.0.tgz"
|
url "https://example.com/foo-1.0.tgz"
|
||||||
def patches
|
def patches
|
||||||
^^^^^^^^^^^ Use the patch DSL instead of defining a 'patches' method
|
^^^^^^^^^^^ Use the patch DSL instead of defining a 'patches' method
|
||||||
DATA
|
DATA
|
||||||
@ -38,7 +38,7 @@ describe RuboCop::Cop::FormulaAudit::Patches do
|
|||||||
source = <<~EOS
|
source = <<~EOS
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
homepage "ftp://example.com/foo"
|
homepage "ftp://example.com/foo"
|
||||||
url "http://example.com/foo-1.0.tgz"
|
url "https://example.com/foo-1.0.tgz"
|
||||||
def patches
|
def patches
|
||||||
"#{patch_url}"
|
"#{patch_url}"
|
||||||
end
|
end
|
||||||
@ -116,7 +116,7 @@ describe RuboCop::Cop::FormulaAudit::Patches do
|
|||||||
source = <<~RUBY
|
source = <<~RUBY
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
homepage "ftp://example.com/foo"
|
homepage "ftp://example.com/foo"
|
||||||
url "http://example.com/foo-1.0.tgz"
|
url "https://example.com/foo-1.0.tgz"
|
||||||
def patches
|
def patches
|
||||||
files = %w[patch-domain_resolver.c patch-colormask.c patch-trafshow.c patch-trafshow.1 patch-configure]
|
files = %w[patch-domain_resolver.c patch-colormask.c patch-trafshow.c patch-trafshow.1 patch-configure]
|
||||||
{
|
{
|
||||||
@ -165,7 +165,7 @@ describe RuboCop::Cop::FormulaAudit::Patches do
|
|||||||
source = <<~RUBY
|
source = <<~RUBY
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
homepage "ftp://example.com/foo"
|
homepage "ftp://example.com/foo"
|
||||||
url "http://example.com/foo-1.0.tgz"
|
url "https://example.com/foo-1.0.tgz"
|
||||||
patch do
|
patch do
|
||||||
url "#{patch_url}"
|
url "#{patch_url}"
|
||||||
sha256 "63376b8fdd6613a91976106d9376069274191860cd58f039b29ff16de1925621"
|
sha256 "63376b8fdd6613a91976106d9376069274191860cd58f039b29ff16de1925621"
|
||||||
|
|||||||
@ -7,8 +7,8 @@ describe RuboCop::Cop::FormulaAudit::Text do
|
|||||||
it "with both openssl and libressl optional dependencies" do
|
it "with both openssl and libressl optional dependencies" do
|
||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
url "http://example.com/foo-1.0.tgz"
|
url "https://example.com/foo-1.0.tgz"
|
||||||
homepage "http://example.com"
|
homepage "https://example.com"
|
||||||
|
|
||||||
depends_on "openssl"
|
depends_on "openssl"
|
||||||
depends_on "libressl" => :optional
|
depends_on "libressl" => :optional
|
||||||
@ -20,8 +20,8 @@ describe RuboCop::Cop::FormulaAudit::Text do
|
|||||||
it "with both openssl and libressl dependencies" do
|
it "with both openssl and libressl dependencies" do
|
||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
url "http://example.com/foo-1.0.tgz"
|
url "https://example.com/foo-1.0.tgz"
|
||||||
homepage "http://example.com"
|
homepage "https://example.com"
|
||||||
|
|
||||||
depends_on "openssl"
|
depends_on "openssl"
|
||||||
depends_on "libressl"
|
depends_on "libressl"
|
||||||
@ -33,8 +33,8 @@ describe RuboCop::Cop::FormulaAudit::Text do
|
|||||||
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
|
||||||
url "http://example.com/foo-1.0.tgz"
|
url "https://example.com/foo-1.0.tgz"
|
||||||
homepage "http://example.com"
|
homepage "https://example.com"
|
||||||
|
|
||||||
def install
|
def install
|
||||||
xcodebuild "-project", "meow.xcodeproject"
|
xcodebuild "-project", "meow.xcodeproject"
|
||||||
@ -47,8 +47,8 @@ describe RuboCop::Cop::FormulaAudit::Text do
|
|||||||
it "When xcodebuild is called without any args" do
|
it "When xcodebuild is called without any args" do
|
||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
url "http://example.com/foo-1.0.tgz"
|
url "https://example.com/foo-1.0.tgz"
|
||||||
homepage "http://example.com"
|
homepage "https://example.com"
|
||||||
|
|
||||||
def install
|
def install
|
||||||
xcodebuild
|
xcodebuild
|
||||||
@ -61,8 +61,8 @@ describe RuboCop::Cop::FormulaAudit::Text do
|
|||||||
it "When go get is executed" do
|
it "When go get is executed" do
|
||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
url "http://example.com/foo-1.0.tgz"
|
url "https://example.com/foo-1.0.tgz"
|
||||||
homepage "http://example.com"
|
homepage "https://example.com"
|
||||||
|
|
||||||
def install
|
def install
|
||||||
system "go", "get", "bar"
|
system "go", "get", "bar"
|
||||||
@ -75,8 +75,8 @@ describe RuboCop::Cop::FormulaAudit::Text do
|
|||||||
it "When xcodebuild is executed" do
|
it "When xcodebuild is executed" do
|
||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
url "http://example.com/foo-1.0.tgz"
|
url "https://example.com/foo-1.0.tgz"
|
||||||
homepage "http://example.com"
|
homepage "https://example.com"
|
||||||
|
|
||||||
def install
|
def install
|
||||||
system "xcodebuild", "foo", "bar"
|
system "xcodebuild", "foo", "bar"
|
||||||
@ -89,8 +89,8 @@ describe RuboCop::Cop::FormulaAudit::Text do
|
|||||||
it "When scons is executed" do
|
it "When scons is executed" do
|
||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
url "http://example.com/foo-1.0.tgz"
|
url "https://example.com/foo-1.0.tgz"
|
||||||
homepage "http://example.com"
|
homepage "https://example.com"
|
||||||
|
|
||||||
def install
|
def install
|
||||||
system "scons", "foo", "bar"
|
system "scons", "foo", "bar"
|
||||||
@ -103,8 +103,8 @@ describe RuboCop::Cop::FormulaAudit::Text do
|
|||||||
it "When plist_options are not defined when using a formula-defined plist", :ruby23 do
|
it "When plist_options are not defined when using a formula-defined plist", :ruby23 do
|
||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
url "http://example.com/foo-1.0.tgz"
|
url "https://example.com/foo-1.0.tgz"
|
||||||
homepage "http://example.com"
|
homepage "https://example.com"
|
||||||
|
|
||||||
def install
|
def install
|
||||||
system "xcodebuild", "foo", "bar"
|
system "xcodebuild", "foo", "bar"
|
||||||
@ -134,8 +134,8 @@ describe RuboCop::Cop::FormulaAudit::Text do
|
|||||||
^^^^^^^^^^^^^^^^^^^^^ require "language/go" is unnecessary unless using `go_resource`s
|
^^^^^^^^^^^^^^^^^^^^^ require "language/go" is unnecessary unless using `go_resource`s
|
||||||
|
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
url "http://example.com/foo-1.0.tgz"
|
url "https://example.com/foo-1.0.tgz"
|
||||||
homepage "http://example.com"
|
homepage "https://example.com"
|
||||||
|
|
||||||
def install
|
def install
|
||||||
system "go", "get", "bar"
|
system "go", "get", "bar"
|
||||||
@ -148,8 +148,8 @@ describe RuboCop::Cop::FormulaAudit::Text do
|
|||||||
it "When formula uses virtualenv and also `setuptools` resource" do
|
it "When formula uses virtualenv and also `setuptools` resource" do
|
||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
url "http://example.com/foo-1.0.tgz"
|
url "https://example.com/foo-1.0.tgz"
|
||||||
homepage "http://example.com"
|
homepage "https://example.com"
|
||||||
|
|
||||||
resource "setuptools" do
|
resource "setuptools" do
|
||||||
^^^^^^^^^^^^^^^^^^^^^ Formulae using virtualenvs do not need a `setuptools` resource.
|
^^^^^^^^^^^^^^^^^^^^^ Formulae using virtualenvs do not need a `setuptools` resource.
|
||||||
@ -167,8 +167,8 @@ describe RuboCop::Cop::FormulaAudit::Text do
|
|||||||
it "When Formula.factory(name) is used" do
|
it "When Formula.factory(name) is used" do
|
||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
url "http://example.com/foo-1.0.tgz"
|
url "https://example.com/foo-1.0.tgz"
|
||||||
homepage "http://example.com"
|
homepage "https://example.com"
|
||||||
|
|
||||||
def install
|
def install
|
||||||
Formula.factory(name)
|
Formula.factory(name)
|
||||||
@ -181,8 +181,8 @@ describe RuboCop::Cop::FormulaAudit::Text do
|
|||||||
it "When dep ensure is used without `-vendor-only`" do
|
it "When dep ensure is used without `-vendor-only`" do
|
||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
url "http://example.com/foo-1.0.tgz"
|
url "https://example.com/foo-1.0.tgz"
|
||||||
homepage "http://example.com"
|
homepage "https://example.com"
|
||||||
|
|
||||||
def install
|
def install
|
||||||
system "dep", "ensure"
|
system "dep", "ensure"
|
||||||
@ -195,8 +195,8 @@ describe RuboCop::Cop::FormulaAudit::Text do
|
|||||||
it "When cargo build is executed" do
|
it "When cargo build is executed" do
|
||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
url "http://example.com/foo-1.0.tgz"
|
url "https://example.com/foo-1.0.tgz"
|
||||||
homepage "http://example.com"
|
homepage "https://example.com"
|
||||||
|
|
||||||
def install
|
def install
|
||||||
system "cargo", "build"
|
system "cargo", "build"
|
||||||
|
|||||||
@ -31,10 +31,9 @@ describe Utils do
|
|||||||
end
|
end
|
||||||
|
|
||||||
it "returns true when remote exists", :needs_network, :needs_svn do
|
it "returns true when remote exists", :needs_network, :needs_svn do
|
||||||
remote = "http://github.com/Homebrew/install"
|
HOMEBREW_CACHE.cd do
|
||||||
svn = HOMEBREW_SHIMS_PATH/"scm/svn"
|
system HOMEBREW_SHIMS_PATH/"scm/svn", "checkout", "https://github.com/Homebrew/install"
|
||||||
|
end
|
||||||
HOMEBREW_CACHE.cd { system svn, "checkout", remote }
|
|
||||||
|
|
||||||
expect(described_class).to be_svn_remote_exists(HOMEBREW_CACHE/"install")
|
expect(described_class).to be_svn_remote_exists(HOMEBREW_CACHE/"install")
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user