rubocop-ast 1.12.0 → 1.15.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rubocop/ast/node/class_node.rb +2 -2
- data/lib/rubocop/ast/node/mixin/method_dispatch_node.rb +1 -1
- data/lib/rubocop/ast/node/module_node.rb +2 -2
- data/lib/rubocop/ast/node/pair_node.rb +7 -0
- data/lib/rubocop/ast/node/self_class_node.rb +2 -2
- data/lib/rubocop/ast/node.rb +2 -2
- data/lib/rubocop/ast/node_pattern/lexer.rex.rb +1 -1
- data/lib/rubocop/ast/traversal.rb +2 -3
- data/lib/rubocop/ast/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 81689137631e287fd256ecec1afe9ce91033dcb77663f11c7a7d06a778630b9c
|
4
|
+
data.tar.gz: 6bfab6b417e2318d0a3d8d0ae5df70ce06de90a9826b39a00ba17c00a88021aa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 50af89026c7e223a9ba293bdbe7d129586793dfbc853eba03e813f5f37d2b1baeffd3bfccc2b8b68e3f8b927d250ec8cf258d12cf7816a6580f80345fd00a9d2
|
7
|
+
data.tar.gz: 23ac600eb4d70e3cf2d978ecfa85e966dfc9ccc3347cff3e26d6862508a1a63bae483a56f3f21b60c9fb32cea250d47ec503f5b311492f9c641c99c1754d9f05
|
@@ -6,9 +6,9 @@ module RuboCop
|
|
6
6
|
# node when the builder constructs the AST, making its methods available
|
7
7
|
# to all `class` nodes within RuboCop.
|
8
8
|
class ClassNode < Node
|
9
|
-
# The
|
9
|
+
# The identifier for this `class` node.
|
10
10
|
#
|
11
|
-
# @return [Node] the
|
11
|
+
# @return [Node] the identifier of the class
|
12
12
|
def identifier
|
13
13
|
node_parts[0]
|
14
14
|
end
|
@@ -171,7 +171,7 @@ module RuboCop
|
|
171
171
|
#
|
172
172
|
# private def foo; end
|
173
173
|
#
|
174
|
-
# @return
|
174
|
+
# @return whether the `def|defs` node is a modifier or not.
|
175
175
|
# See also `def_modifier` that returns the node or `nil`
|
176
176
|
def def_modifier?(node = self)
|
177
177
|
!!def_modifier(node)
|
@@ -6,9 +6,9 @@ module RuboCop
|
|
6
6
|
# plain node when the builder constructs the AST, making its methods
|
7
7
|
# available to all `module` nodes within RuboCop.
|
8
8
|
class ModuleNode < Node
|
9
|
-
# The
|
9
|
+
# The identifier for this `module` node.
|
10
10
|
#
|
11
|
-
# @return [Node] the
|
11
|
+
# @return [Node] the identifier of the module
|
12
12
|
def identifier
|
13
13
|
node_parts[0]
|
14
14
|
end
|
@@ -62,6 +62,13 @@ module RuboCop
|
|
62
62
|
def value_on_new_line?
|
63
63
|
key.loc.line != value.loc.line
|
64
64
|
end
|
65
|
+
|
66
|
+
# Checks whether the `pair` uses hash value omission.
|
67
|
+
#
|
68
|
+
# @return [Boolean] whether this `pair` uses hash value omission
|
69
|
+
def value_omission?
|
70
|
+
source.end_with?(':')
|
71
|
+
end
|
65
72
|
end
|
66
73
|
end
|
67
74
|
end
|
@@ -6,9 +6,9 @@ module RuboCop
|
|
6
6
|
# plain node when the builder constructs the AST, making its methods
|
7
7
|
# available to all `sclass` nodes within RuboCop.
|
8
8
|
class SelfClassNode < Node
|
9
|
-
# The
|
9
|
+
# The identifier for this `sclass` node. (Always `self`.)
|
10
10
|
#
|
11
|
-
# @return [Node] the
|
11
|
+
# @return [Node] the identifier of the class
|
12
12
|
def identifier
|
13
13
|
node_parts[0]
|
14
14
|
end
|
data/lib/rubocop/ast/node.rb
CHANGED
@@ -274,7 +274,7 @@ module RuboCop
|
|
274
274
|
|
275
275
|
# @!method receiver(node = self)
|
276
276
|
def_node_matcher :receiver, <<~PATTERN
|
277
|
-
{(send $_ ...) ({block numblock} (
|
277
|
+
{(send $_ ...) ({block numblock} (call $_ ...) ...)}
|
278
278
|
PATTERN
|
279
279
|
|
280
280
|
# @!method str_content(node = self)
|
@@ -464,7 +464,7 @@ module RuboCop
|
|
464
464
|
end
|
465
465
|
|
466
466
|
def numeric_type?
|
467
|
-
int_type? || float_type?
|
467
|
+
int_type? || float_type? || rational_type? || complex_type?
|
468
468
|
end
|
469
469
|
|
470
470
|
def range_type?
|
@@ -91,11 +91,10 @@ module RuboCop
|
|
91
91
|
|
92
92
|
many_symbol_children = %i[regopt]
|
93
93
|
|
94
|
-
node_child = %i[
|
95
|
-
match_current_line defined?
|
94
|
+
node_child = %i[not match_current_line defined?
|
96
95
|
arg_expr pin if_guard unless_guard
|
97
96
|
match_with_trailing_comma]
|
98
|
-
node_or_nil_child = %i[preexe postexe]
|
97
|
+
node_or_nil_child = %i[block_pass preexe postexe]
|
99
98
|
|
100
99
|
NO_CHILD_NODES = (no_children + opt_symbol_child + literal_child).to_set.freeze
|
101
100
|
private_constant :NO_CHILD_NODES # Used by Commissioner
|
data/lib/rubocop/ast/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubocop-ast
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.15.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bozhidar Batsov
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2021-
|
13
|
+
date: 2021-12-27 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: parser
|
@@ -159,6 +159,7 @@ metadata:
|
|
159
159
|
source_code_uri: https://github.com/rubocop/rubocop-ast/
|
160
160
|
documentation_uri: https://docs.rubocop.org/rubocop-ast/
|
161
161
|
bug_tracker_uri: https://github.com/rubocop/rubocop-ast/issues
|
162
|
+
rubygems_mfa_required: 'true'
|
162
163
|
post_install_message:
|
163
164
|
rdoc_options: []
|
164
165
|
require_paths:
|