rubocop-ast 1.18.0 → 1.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/rubocop/ast/node/mixin/method_dispatch_node.rb +2 -2
- data/lib/rubocop/ast/node/regexp_node.rb +6 -0
- data/lib/rubocop/ast/node/str_node.rb +4 -0
- data/lib/rubocop/ast/node_pattern/compiler/binding.rb +2 -2
- data/lib/rubocop/ast/token.rb +12 -0
- data/lib/rubocop/ast/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cfec7f927c495d16f847400f123da08ff90e6a94ff6319a84ce21fb0b261b7a5
|
4
|
+
data.tar.gz: c770260ba7f50b0bb233d8e95d43e1d8fa1674a2a11af4548a37f919b5ce9cc8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: efbc6b544362492884000f55fbb1b216c6f4e55bb1087c88e3218bb595f91129afd4c45ecaa3e3d02784d7cd714ad21765c376aaad5e0768917384c366657e48
|
7
|
+
data.tar.gz: 7f98a811c53a27eba7211f05b6a368b7f058dd285e6771c7ed2d97230688e88498c6f57b1d7e585ff83b5f0d3f85b928bb67ba4bbbeaa06fa7c0eb5aa7e5d20a
|
@@ -233,7 +233,7 @@ module RuboCop
|
|
233
233
|
#
|
234
234
|
# foo + bar
|
235
235
|
#
|
236
|
-
# @return [
|
236
|
+
# @return [Boolean] whether this method is a binary operation
|
237
237
|
def binary_operation?
|
238
238
|
return false unless loc.selector
|
239
239
|
|
@@ -249,7 +249,7 @@ module RuboCop
|
|
249
249
|
^{ # or the parent is...
|
250
250
|
sclass class module class_constructor? # a class-like node
|
251
251
|
[ { # or some "wrapper"
|
252
|
-
kwbegin begin block
|
252
|
+
kwbegin begin block numblock
|
253
253
|
(if _condition <%0 _>) # note: we're excluding the condition of `if` nodes
|
254
254
|
}
|
255
255
|
#in_macro_scope? # that is itself in a macro scope
|
@@ -11,6 +11,7 @@ module RuboCop
|
|
11
11
|
i: Regexp::IGNORECASE,
|
12
12
|
m: Regexp::MULTILINE,
|
13
13
|
n: Regexp::NOENCODING,
|
14
|
+
u: Regexp::FIXEDENCODING,
|
14
15
|
o: 0
|
15
16
|
}.freeze
|
16
17
|
private_constant :OPTIONS
|
@@ -87,6 +88,11 @@ module RuboCop
|
|
87
88
|
regopt_include?(:n)
|
88
89
|
end
|
89
90
|
|
91
|
+
# @return [Bool] if regexp uses the fixed-encoding regopt
|
92
|
+
def fixed_encoding?
|
93
|
+
regopt_include?(:u)
|
94
|
+
end
|
95
|
+
|
90
96
|
private
|
91
97
|
|
92
98
|
def regopt_include?(option)
|
@@ -20,8 +20,8 @@ module RuboCop
|
|
20
20
|
end
|
21
21
|
|
22
22
|
if var == :forbidden_unification
|
23
|
-
raise Invalid, "Wildcard #{name} was first seen in a subset of a" \
|
24
|
-
"
|
23
|
+
raise Invalid, "Wildcard #{name} was first seen in a subset of a " \
|
24
|
+
"union and can't be used outside that union"
|
25
25
|
end
|
26
26
|
var
|
27
27
|
end
|
data/lib/rubocop/ast/token.rb
CHANGED
@@ -100,6 +100,14 @@ module RuboCop
|
|
100
100
|
type == :tCOMMA
|
101
101
|
end
|
102
102
|
|
103
|
+
def dot?
|
104
|
+
type == :tDOT
|
105
|
+
end
|
106
|
+
|
107
|
+
def regexp_dots?
|
108
|
+
%i[tDOT2 tDOT3].include?(type)
|
109
|
+
end
|
110
|
+
|
103
111
|
def rescue_modifier?
|
104
112
|
type == :kRESCUE_MOD
|
105
113
|
end
|
@@ -111,6 +119,10 @@ module RuboCop
|
|
111
119
|
def equal_sign?
|
112
120
|
%i[tEQL tOP_ASGN].include?(type)
|
113
121
|
end
|
122
|
+
|
123
|
+
def new_line?
|
124
|
+
type == :tNL
|
125
|
+
end
|
114
126
|
end
|
115
127
|
end
|
116
128
|
end
|
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.23.0
|
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: 2022-
|
13
|
+
date: 2022-10-21 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: parser
|