rubocops/lines: remove existing npm audit
This commit is contained in:
parent
95e30ee2ab
commit
5304b70c92
@ -750,18 +750,6 @@ module RuboCop
|
|||||||
problem "Use ruby-macho instead of calling #{@offensive_node.source}"
|
problem "Use ruby-macho instead of calling #{@offensive_node.source}"
|
||||||
end
|
end
|
||||||
|
|
||||||
find_every_method_call_by_name(body_node, :system).each do |method_node|
|
|
||||||
# Skip Kibana: npm cache edge (see formula for more details)
|
|
||||||
next if @formula_name.match?(/^kibana(@\d[\d.]*)?$/)
|
|
||||||
|
|
||||||
first_param, second_param = parameters(method_node)
|
|
||||||
next if !node_equals?(first_param, "npm") ||
|
|
||||||
!node_equals?(second_param, "install")
|
|
||||||
|
|
||||||
offending_node(method_node)
|
|
||||||
problem "Use Language::Node for npm install args" unless languageNodeModule?(method_node)
|
|
||||||
end
|
|
||||||
|
|
||||||
problem "Use new-style test definitions (test do)" if find_method_def(body_node, :test)
|
problem "Use new-style test definitions (test do)" if find_method_def(body_node, :test)
|
||||||
|
|
||||||
find_method_with_args(body_node, :skip_clean, :all) do
|
find_method_with_args(body_node, :skip_clean, :all) do
|
||||||
@ -856,11 +844,6 @@ module RuboCop
|
|||||||
{(dstr (begin (send nil? %1)) $(str _ ))
|
{(dstr (begin (send nil? %1)) $(str _ ))
|
||||||
(dstr _ (begin (send nil? %1)) $(str _ ))}
|
(dstr _ (begin (send nil? %1)) $(str _ ))}
|
||||||
EOS
|
EOS
|
||||||
|
|
||||||
# Node Pattern search for Language::Node
|
|
||||||
def_node_search :languageNodeModule?, <<~EOS
|
|
||||||
(const (const nil? :Language) :Node)
|
|
||||||
EOS
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -147,27 +147,6 @@ RSpec.describe RuboCop::Cop::FormulaAudit::Miscellaneous do
|
|||||||
RUBY
|
RUBY
|
||||||
end
|
end
|
||||||
|
|
||||||
it "reports an offense when `npm install` is called without Language::Node arguments" do
|
|
||||||
expect_offense(<<~RUBY)
|
|
||||||
class Foo < Formula
|
|
||||||
desc "foo"
|
|
||||||
url 'https://brew.sh/foo-1.0.tgz'
|
|
||||||
system "npm", "install"
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Miscellaneous: Use Language::Node for npm install args
|
|
||||||
end
|
|
||||||
RUBY
|
|
||||||
end
|
|
||||||
|
|
||||||
it "reports no offenses when `npm install` is called without Language::Node arguments in an exempt formula" do
|
|
||||||
expect_no_offenses(<<~RUBY, "/homebrew-core/Formula/kibana@4.4.rb")
|
|
||||||
class KibanaAT44 < Formula
|
|
||||||
desc "foo"
|
|
||||||
url 'https://brew.sh/foo-1.0.tgz'
|
|
||||||
system "npm", "install"
|
|
||||||
end
|
|
||||||
RUBY
|
|
||||||
end
|
|
||||||
|
|
||||||
it "reports an offense when `depends_on` is called with an instance" do
|
it "reports an offense when `depends_on` is called with an instance" do
|
||||||
expect_offense(<<~RUBY)
|
expect_offense(<<~RUBY)
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
|
Loading…
x
Reference in New Issue
Block a user