rubocop-graphql 0.12.2 → 0.12.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1d488e2bcf0fac1f61555afb433e26834bc653b88598ba9fd23d58be29db44cc
4
- data.tar.gz: 31afb3a28f7cd44f165dcd4bd93aecebf270ccc2af05f50816f171f19c88680d
3
+ metadata.gz: b0b5a6defb854d907bf12c23a7262adc13b55228e3d7cf345f19ea7b1371bacb
4
+ data.tar.gz: 3250274062d10447eb23994e4bc1e99393d4d03a6b17221cdbda5f1d1bd4b2d6
5
5
  SHA512:
6
- metadata.gz: a5d35e978439e99de72eb4d90088b6a726bfbf78a6303ce422bfb09a05b4d965e7a28acb06ada12538dea8148f691384a48682ad651cc39d631e779d41098cfb
7
- data.tar.gz: 44ca6c9891b4184b6ab40b1a4be8d9398fb94276502a603f09639bf5993c553aee01f845e61a119470f1a7eb5f51659db7114bf47a472c41394649b91fc20c28
6
+ metadata.gz: 3f59543ad00f27cf92048d5fa3fb7e09ea99c9e1179839f848316025eb48d66a92012f2cdb13847113d602b740a49aab128d8a4538cf5d8c0f8ea8a2c0f47321
7
+ data.tar.gz: 2b5110aa616044c726f466c6e82a36af0cdad58d096c6359a97a91b3d0c6e023dd4e2ce96f8ecaf44638393bce6b2a4330fa2b3ff76b8c5ecc89d0b07ed6f5e4
@@ -72,7 +72,7 @@ module RuboCop
72
72
  arg.arg_type? || arg.kwrestarg_type?
73
73
  end
74
74
 
75
- declared_arg_nodes = argument_declarations(node)
75
+ declared_arg_nodes = find_declared_arg_nodes(node)
76
76
  return unless declared_arg_nodes.any?
77
77
 
78
78
  unresolved_args = find_unresolved_args(resolve_method_node, declared_arg_nodes)
@@ -81,6 +81,13 @@ module RuboCop
81
81
 
82
82
  private
83
83
 
84
+ def find_declared_arg_nodes(node)
85
+ argument_declarations(node).select do |arg_declaration|
86
+ # argument is declared on the same class that is being analyzed
87
+ arg_declaration.each_ancestor(:class).first == node
88
+ end
89
+ end
90
+
84
91
  def find_resolve_method_node(node)
85
92
  resolve_method_nodes = resolve_method_definition(node)
86
93
  resolve_method_nodes.to_a.last if resolve_method_nodes.any?
@@ -7,10 +7,6 @@ module RuboCop
7
7
  def current_class_full_name(node)
8
8
  node.each_ancestor(:class).map(&:defined_module_name).join("::")
9
9
  end
10
-
11
- def nested_class?(node)
12
- node.each_ancestor(:class).any?
13
- end
14
10
  end
15
11
  end
16
12
  end
@@ -1,5 +1,5 @@
1
1
  module RuboCop
2
2
  module GraphQL
3
- VERSION = "0.12.2".freeze
3
+ VERSION = "0.12.3".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-graphql
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.2
4
+ version: 0.12.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitry Tsepelev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-01-07 00:00:00.000000000 Z
11
+ date: 2022-01-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler