rubocop-grape 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rubocop/cop/grape/params_position.rb +4 -4
- data/lib/rubocop/grape/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bd6f622b828feeb370985d1d3c2bb9fd5d5e366dca5ced9f4232dc00bd69541f
|
4
|
+
data.tar.gz: 175d75a07c48e200de2417e4e951332a44c6bbd3f4cdeaef38cf025f6ab14c90
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6961acacaa6a7304899b852294f651e6aba4e9528f674756cdd0536d7384739a9bda2d928e7ef4c9b23dda30776ce020fa8f78bf98e5d5c5e9d599502d99a3d1
|
7
|
+
data.tar.gz: eb230658d3993d3c096a1e826096a4b7f6f00243a6b810a57c35d7b7a80d3ea6a3a5bc4f515e9d784e63d930710980d9e0ec2d6a5b7880bfd028d13599297a03
|
@@ -27,20 +27,20 @@ module RuboCop
|
|
27
27
|
PATTERN
|
28
28
|
|
29
29
|
def_node_matcher :http_method_node?, <<~PATTERN
|
30
|
-
(block (send _ :get) ...)
|
30
|
+
(block (send _ {:get :post :put :patch :delete}) ...)
|
31
31
|
PATTERN
|
32
32
|
|
33
33
|
def on_block(node)
|
34
34
|
return unless http_method_node?(node)
|
35
35
|
|
36
|
-
|
36
|
+
collect_violating_nodes(node).each(&method(:add_offense))
|
37
37
|
end
|
38
38
|
|
39
|
-
def
|
39
|
+
def collect_violating_nodes(node, collector = [])
|
40
40
|
collector.push(node) if node.type == :block && params_block?(node)
|
41
41
|
|
42
42
|
node.children.each do |descendant|
|
43
|
-
|
43
|
+
collect_violating_nodes(descendant, collector) if descendant.is_a?(Parser::AST::Node)
|
44
44
|
end
|
45
45
|
|
46
46
|
collector
|