Merge pull request #16086 from issyl0/revision-0-not-allowed-in-text
This commit is contained in:
commit
1085afcda5
@ -48,6 +48,10 @@ module RuboCop
|
||||
problem "\"Formula.factory(name)\" is deprecated in favor of \"Formula[name]\""
|
||||
end
|
||||
|
||||
find_method_with_args(body_node, :revision, 0) do
|
||||
problem "\"revision 0\" is unnecessary"
|
||||
end
|
||||
|
||||
find_method_with_args(body_node, :system, "xcodebuild") do
|
||||
problem %q(use "xcodebuild *args" instead of "system 'xcodebuild', *args")
|
||||
end
|
||||
|
||||
@ -24,6 +24,17 @@ describe RuboCop::Cop::FormulaAudit::Text do
|
||||
RUBY
|
||||
end
|
||||
|
||||
it "reports an offense if 'revision 0' is present" do
|
||||
expect_offense(<<~RUBY)
|
||||
class Foo < Formula
|
||||
url "https://brew.sh/foo-1.0.tgz"
|
||||
homepage "https://brew.sh"
|
||||
revision 0
|
||||
^^^^^^^^^^ FormulaAudit/Text: "revision 0" is unnecessary
|
||||
end
|
||||
RUBY
|
||||
end
|
||||
|
||||
it "reports an offense if both openssl and libressl are dependencies" do
|
||||
expect_offense(<<~RUBY)
|
||||
class Foo < Formula
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user