rubocop-ast 1.30.0 → 1.32.1
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/README.md +1 -1
- data/lib/rubocop/ast/builder.rb +1 -0
- data/lib/rubocop/ast/node/array_node.rb +5 -1
- data/lib/rubocop/ast/node/ensure_node.rb +8 -0
- data/lib/rubocop/ast/node/mixin/basic_literal_node.rb +1 -1
- data/lib/rubocop/ast/node/mixin/numeric_node.rb +1 -1
- data/lib/rubocop/ast/node/rational_node.rb +13 -0
- data/lib/rubocop/ast/node.rb +29 -21
- data/lib/rubocop/ast/node_pattern/compiler/binding.rb +3 -3
- data/lib/rubocop/ast/node_pattern/compiler/sequence_subcompiler.rb +2 -3
- data/lib/rubocop/ast/node_pattern/lexer.rex.rb +1 -2
- data/lib/rubocop/ast/node_pattern/node.rb +0 -1
- data/lib/rubocop/ast/node_pattern/parser.racc.rb +2 -2
- data/lib/rubocop/ast/processed_source.rb +89 -59
- data/lib/rubocop/ast/token.rb +1 -1
- data/lib/rubocop/ast/traversal.rb +2 -2
- data/lib/rubocop/ast/version.rb +1 -1
- data/lib/rubocop/ast.rb +1 -1
- metadata +7 -7
- data/lib/rubocop/ast/ext/range_min_max.rb +0 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e27c2b81b954a689111e1b592d34e91d6561e4b69bbdd098464671fde8488cf2
|
4
|
+
data.tar.gz: 67222d8e415d13972cc0817cd2a5468c04125600162cd0f4b3e441574deea4c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ac990087ef866dd14b059caa230aca760bba08db4394d65557df0aeba20d696ef9c25ccb89662428e26288b5cd8ea35d22a50884c2810bc01087188362a084f5
|
7
|
+
data.tar.gz: fb46af6a67f31258c33228fa5a748a7b110be68552a47a43b5487a49521b2b2c603215802a5d1a722b185388f6af97378492bfa7fbd00f563f0738c04e2afaf9
|
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# RuboCop AST
|
2
2
|
|
3
3
|
[](https://badge.fury.io/rb/rubocop-ast)
|
4
|
-
[](https://github.com/rubocop/rubocop-ast/actions/workflows/rubocop.yml)
|
5
5
|
[](https://codeclimate.com/github/rubocop/rubocop-ast/test_coverage)
|
6
6
|
[](https://codeclimate.com/github/rubocop/rubocop-ast/maintainability)
|
7
7
|
|
data/lib/rubocop/ast/builder.rb
CHANGED
@@ -17,7 +17,11 @@ module RuboCop
|
|
17
17
|
# @return [Array<Node>] an array of value nodes
|
18
18
|
alias values children
|
19
19
|
|
20
|
-
#
|
20
|
+
# Calls the given block for each `value` node in the `array` literal.
|
21
|
+
# If no block is given, an `Enumerator` is returned.
|
22
|
+
#
|
23
|
+
# @return [self] if a block is given
|
24
|
+
# @return [Enumerator] if no block is given
|
21
25
|
def each_value(&block)
|
22
26
|
return to_enum(__method__) unless block
|
23
27
|
|
@@ -12,6 +12,14 @@ module RuboCop
|
|
12
12
|
def body
|
13
13
|
node_parts[1]
|
14
14
|
end
|
15
|
+
|
16
|
+
# Checks whether this node body is a void context.
|
17
|
+
# Always `true` for `ensure`.
|
18
|
+
#
|
19
|
+
# @return [true] whether the `ensure` node body is a void context
|
20
|
+
def void_context?
|
21
|
+
true
|
22
|
+
end
|
15
23
|
end
|
16
24
|
end
|
17
25
|
end
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
module RuboCop
|
4
4
|
module AST
|
5
|
-
# Common functionality for primitive numeric nodes: `int`, `float`,
|
5
|
+
# Common functionality for primitive numeric nodes: `int`, `float`, `rational`...
|
6
6
|
module NumericNode
|
7
7
|
SIGN_REGEX = /\A[+-]/.freeze
|
8
8
|
private_constant :SIGN_REGEX
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module RuboCop
|
4
|
+
module AST
|
5
|
+
# A node extension for `rational` nodes. This will be used in place of a plain
|
6
|
+
# node when the builder constructs the AST, making its methods available to
|
7
|
+
# all `rational` nodes within RuboCop.
|
8
|
+
class RationalNode < Node
|
9
|
+
include BasicLiteralNode
|
10
|
+
include NumericNode
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
data/lib/rubocop/ast/node.rb
CHANGED
@@ -88,6 +88,27 @@ module RuboCop
|
|
88
88
|
EMPTY_PROPERTIES = {}.freeze
|
89
89
|
private_constant :EMPTY_CHILDREN, :EMPTY_PROPERTIES
|
90
90
|
|
91
|
+
# Define a +recursive_?+ predicate method for the given node kind.
|
92
|
+
private_class_method def self.def_recursive_literal_predicate(kind) # rubocop:disable Metrics/MethodLength
|
93
|
+
recursive_kind = "recursive_#{kind}?"
|
94
|
+
kind_filter = "#{kind}?"
|
95
|
+
|
96
|
+
class_eval <<~RUBY, __FILE__, __LINE__ + 1
|
97
|
+
def #{recursive_kind} # def recursive_literal?
|
98
|
+
case type # case type
|
99
|
+
when :send # when :send
|
100
|
+
LITERAL_RECURSIVE_METHODS.include?(method_name) && # LITERAL_RECURSIVE_METHODS.include?(method_name) &&
|
101
|
+
receiver.send(:#{recursive_kind}) && # receiver.send(:recursive_literal?) &&
|
102
|
+
arguments.all?(&:#{recursive_kind}) # arguments.all?(&:recursive_literal?)
|
103
|
+
when LITERAL_RECURSIVE_TYPES # when LITERAL_RECURSIVE_TYPES
|
104
|
+
children.compact.all?(&:#{recursive_kind}) # children.compact.all?(&:recursive_literal?)
|
105
|
+
else # else
|
106
|
+
send(:#{kind_filter}) # send(:literal?)
|
107
|
+
end # end
|
108
|
+
end # end
|
109
|
+
RUBY
|
110
|
+
end
|
111
|
+
|
91
112
|
# @see https://www.rubydoc.info/gems/ast/AST/Node:initialize
|
92
113
|
def initialize(type, children = EMPTY_CHILDREN, properties = EMPTY_PROPERTIES)
|
93
114
|
@mutable_attributes = {}
|
@@ -326,13 +347,13 @@ module RuboCop
|
|
326
347
|
# what class or module is this method/constant/etc definition in?
|
327
348
|
# returns nil if answer cannot be determined
|
328
349
|
ancestors = each_ancestor(:class, :module, :sclass, :casgn, :block)
|
329
|
-
result = ancestors.
|
350
|
+
result = ancestors.filter_map do |ancestor|
|
330
351
|
parent_module_name_part(ancestor) do |full_name|
|
331
352
|
return nil unless full_name
|
332
353
|
|
333
354
|
full_name
|
334
355
|
end
|
335
|
-
end.
|
356
|
+
end.reverse.join('::')
|
336
357
|
result.empty? ? 'Object' : result
|
337
358
|
end
|
338
359
|
|
@@ -380,22 +401,11 @@ module RuboCop
|
|
380
401
|
IMMUTABLE_LITERALS.include?(type)
|
381
402
|
end
|
382
403
|
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
when :send
|
389
|
-
LITERAL_RECURSIVE_METHODS.include?(method_name) &&
|
390
|
-
receiver.send(recursive_kind) &&
|
391
|
-
arguments.all?(&recursive_kind)
|
392
|
-
when LITERAL_RECURSIVE_TYPES
|
393
|
-
children.compact.all?(&recursive_kind)
|
394
|
-
else
|
395
|
-
send(kind_filter)
|
396
|
-
end
|
397
|
-
end
|
398
|
-
end
|
404
|
+
# @!macro [attach] def_recursive_literal_predicate
|
405
|
+
# @!method recursive_$1?
|
406
|
+
# @return [Boolean]
|
407
|
+
def_recursive_literal_predicate :literal
|
408
|
+
def_recursive_literal_predicate :basic_literal
|
399
409
|
|
400
410
|
def variable?
|
401
411
|
VARIABLES.include?(type)
|
@@ -547,8 +557,7 @@ module RuboCop
|
|
547
557
|
# So, does the return value of this node matter? If we changed it to
|
548
558
|
# `(...; nil)`, might that affect anything?
|
549
559
|
#
|
550
|
-
# rubocop:disable Metrics/MethodLength
|
551
|
-
def value_used?
|
560
|
+
def value_used? # rubocop:disable Metrics/MethodLength
|
552
561
|
# Be conservative and return true if we're not sure.
|
553
562
|
return false if parent.nil?
|
554
563
|
|
@@ -569,7 +578,6 @@ module RuboCop
|
|
569
578
|
true
|
570
579
|
end
|
571
580
|
end
|
572
|
-
# rubocop:enable Metrics/MethodLength
|
573
581
|
|
574
582
|
# Some expressions are evaluated for their value, some for their side
|
575
583
|
# effects, and some for both.
|
@@ -26,8 +26,9 @@ module RuboCop
|
|
26
26
|
var
|
27
27
|
end
|
28
28
|
|
29
|
-
#
|
30
|
-
|
29
|
+
# Yields for each branch of the given union, forbidding unification of
|
30
|
+
# bindings which only appear in a subset of the union.
|
31
|
+
def union_bind(enum) # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
|
31
32
|
# We need to reset @bound before each branch is processed.
|
32
33
|
# Moreover we need to keep track of newly encountered wildcards.
|
33
34
|
# Var `newly_bound_intersection` will hold those that are encountered
|
@@ -62,7 +63,6 @@ module RuboCop
|
|
62
63
|
|
63
64
|
result
|
64
65
|
end
|
65
|
-
# rubocop:enable Metrics/MethodLength, Metrics/AbcSize
|
66
66
|
|
67
67
|
private
|
68
68
|
|
@@ -13,8 +13,8 @@ module RuboCop
|
|
13
13
|
# Doc on how this fits in the compiling process:
|
14
14
|
# /docs/modules/ROOT/pages/node_pattern.adoc
|
15
15
|
#
|
16
|
-
# rubocop:disable Metrics/ClassLength
|
17
|
-
|
16
|
+
class SequenceSubcompiler < Subcompiler # rubocop:disable Metrics/ClassLength
|
17
|
+
# Shift of 1 from standard Ruby indices
|
18
18
|
DELTA = 1
|
19
19
|
POSITIVE = :positive?.to_proc
|
20
20
|
private_constant :POSITIVE
|
@@ -413,7 +413,6 @@ module RuboCop
|
|
413
413
|
@in_sync = sub_compilers.all?(&:in_sync)
|
414
414
|
end
|
415
415
|
end
|
416
|
-
# rubocop:enable Metrics/ClassLength
|
417
416
|
end
|
418
417
|
end
|
419
418
|
end
|
@@ -2,7 +2,7 @@
|
|
2
2
|
# encoding: UTF-8
|
3
3
|
#--
|
4
4
|
# This file is automatically generated. Do not modify it.
|
5
|
-
# Generated by: oedipus_lex version 2.6.
|
5
|
+
# Generated by: oedipus_lex version 2.6.2.
|
6
6
|
# Source: lib/rubocop/ast/node_pattern/lexer.rex
|
7
7
|
#++
|
8
8
|
|
@@ -70,7 +70,6 @@ class RuboCop::AST::NodePattern::LexerRex
|
|
70
70
|
yield
|
71
71
|
end
|
72
72
|
|
73
|
-
|
74
73
|
##
|
75
74
|
# The current scanner class. Must be overridden in subclasses.
|
76
75
|
|
@@ -1,8 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
#
|
3
3
|
# DO NOT MODIFY!!!!
|
4
|
-
# This file is automatically generated by Racc 1.
|
5
|
-
# from Racc grammar file "".
|
4
|
+
# This file is automatically generated by Racc 1.8.1
|
5
|
+
# from Racc grammar file "parser.y".
|
6
6
|
#
|
7
7
|
|
8
8
|
require 'racc/parser.rb'
|
@@ -2,28 +2,36 @@
|
|
2
2
|
|
3
3
|
require 'digest/sha1'
|
4
4
|
|
5
|
-
# rubocop:disable Metrics/ClassLength
|
6
5
|
module RuboCop
|
7
6
|
module AST
|
8
7
|
# ProcessedSource contains objects which are generated by Parser
|
9
8
|
# and other information such as disabled lines for cops.
|
10
9
|
# It also provides a convenient way to access source lines.
|
11
|
-
class ProcessedSource
|
10
|
+
class ProcessedSource # rubocop:disable Metrics/ClassLength
|
12
11
|
# @api private
|
13
12
|
STRING_SOURCE_NAME = '(string)'
|
14
13
|
|
15
14
|
INVALID_LEVELS = %i[error fatal].freeze
|
16
15
|
private_constant :INVALID_LEVELS
|
17
16
|
|
17
|
+
PARSER_ENGINES = %i[parser_whitequark parser_prism].freeze
|
18
|
+
private_constant :PARSER_ENGINES
|
19
|
+
|
18
20
|
attr_reader :path, :buffer, :ast, :comments, :tokens, :diagnostics,
|
19
|
-
:parser_error, :raw_source, :ruby_version
|
21
|
+
:parser_error, :raw_source, :ruby_version, :parser_engine
|
20
22
|
|
21
|
-
def self.from_file(path, ruby_version)
|
23
|
+
def self.from_file(path, ruby_version, parser_engine: :parser_whitequark)
|
22
24
|
file = File.read(path, mode: 'rb')
|
23
|
-
new(file, ruby_version, path)
|
25
|
+
new(file, ruby_version, path, parser_engine: parser_engine)
|
24
26
|
end
|
25
27
|
|
26
|
-
def initialize(source, ruby_version, path = nil)
|
28
|
+
def initialize(source, ruby_version, path = nil, parser_engine: :parser_whitequark)
|
29
|
+
parser_engine = parser_engine.to_sym
|
30
|
+
unless PARSER_ENGINES.include?(parser_engine)
|
31
|
+
raise ArgumentError, 'The keyword argument `parser_engine` accepts `parser_whitequark` ' \
|
32
|
+
"or `parser_prism`, but `#{parser_engine}` was passed."
|
33
|
+
end
|
34
|
+
|
27
35
|
# Defaults source encoding to UTF-8, regardless of the encoding it has
|
28
36
|
# been read with, which could be non-utf8 depending on the default
|
29
37
|
# external encoding.
|
@@ -33,9 +41,10 @@ module RuboCop
|
|
33
41
|
@path = path
|
34
42
|
@diagnostics = []
|
35
43
|
@ruby_version = ruby_version
|
44
|
+
@parser_engine = parser_engine
|
36
45
|
@parser_error = nil
|
37
46
|
|
38
|
-
parse(source, ruby_version)
|
47
|
+
parse(source, ruby_version, parser_engine)
|
39
48
|
end
|
40
49
|
|
41
50
|
def ast_with_comments
|
@@ -193,13 +202,13 @@ module RuboCop
|
|
193
202
|
end
|
194
203
|
end
|
195
204
|
|
196
|
-
def parse(source, ruby_version)
|
205
|
+
def parse(source, ruby_version, parser_engine)
|
197
206
|
buffer_name = @path || STRING_SOURCE_NAME
|
198
207
|
@buffer = Parser::Source::Buffer.new(buffer_name, 1)
|
199
208
|
|
200
209
|
begin
|
201
210
|
@buffer.source = source
|
202
|
-
rescue EncodingError => e
|
211
|
+
rescue EncodingError, Parser::UnknownEncodingInMagicComment => e
|
203
212
|
@parser_error = e
|
204
213
|
@ast = nil
|
205
214
|
@comments = []
|
@@ -207,7 +216,7 @@ module RuboCop
|
|
207
216
|
return
|
208
217
|
end
|
209
218
|
|
210
|
-
@ast, @comments, @tokens = tokenize(create_parser(ruby_version))
|
219
|
+
@ast, @comments, @tokens = tokenize(create_parser(ruby_version, parser_engine))
|
211
220
|
end
|
212
221
|
|
213
222
|
def tokenize(parser)
|
@@ -226,59 +235,81 @@ module RuboCop
|
|
226
235
|
[ast, comments, tokens]
|
227
236
|
end
|
228
237
|
|
229
|
-
# rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/MethodLength
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
238
|
+
def parser_class(ruby_version, parser_engine) # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/MethodLength
|
239
|
+
case parser_engine
|
240
|
+
when :parser_whitequark
|
241
|
+
case ruby_version
|
242
|
+
when 1.9
|
243
|
+
require 'parser/ruby19'
|
244
|
+
Parser::Ruby19
|
245
|
+
when 2.0
|
246
|
+
require 'parser/ruby20'
|
247
|
+
Parser::Ruby20
|
248
|
+
when 2.1
|
249
|
+
require 'parser/ruby21'
|
250
|
+
Parser::Ruby21
|
251
|
+
when 2.2
|
252
|
+
require 'parser/ruby22'
|
253
|
+
Parser::Ruby22
|
254
|
+
when 2.3
|
255
|
+
require 'parser/ruby23'
|
256
|
+
Parser::Ruby23
|
257
|
+
when 2.4
|
258
|
+
require 'parser/ruby24'
|
259
|
+
Parser::Ruby24
|
260
|
+
when 2.5
|
261
|
+
require 'parser/ruby25'
|
262
|
+
Parser::Ruby25
|
263
|
+
when 2.6
|
264
|
+
require 'parser/ruby26'
|
265
|
+
Parser::Ruby26
|
266
|
+
when 2.7
|
267
|
+
require 'parser/ruby27'
|
268
|
+
Parser::Ruby27
|
269
|
+
when 2.8, 3.0
|
270
|
+
require 'parser/ruby30'
|
271
|
+
Parser::Ruby30
|
272
|
+
when 3.1
|
273
|
+
require 'parser/ruby31'
|
274
|
+
Parser::Ruby31
|
275
|
+
when 3.2
|
276
|
+
require 'parser/ruby32'
|
277
|
+
Parser::Ruby32
|
278
|
+
when 3.3
|
279
|
+
require 'parser/ruby33'
|
280
|
+
Parser::Ruby33
|
281
|
+
when 3.4
|
282
|
+
require 'parser/ruby34'
|
283
|
+
Parser::Ruby34
|
284
|
+
else
|
285
|
+
raise ArgumentError, "RuboCop found unknown Ruby version: #{ruby_version.inspect}"
|
286
|
+
end
|
287
|
+
when :parser_prism
|
288
|
+
begin
|
289
|
+
require 'prism'
|
290
|
+
rescue LoadError
|
291
|
+
warn "Error: Unable to load Prism. Add `gem 'prism'` to your Gemfile."
|
292
|
+
exit!
|
293
|
+
end
|
294
|
+
|
295
|
+
case ruby_version
|
296
|
+
when 3.3
|
297
|
+
require 'prism/translation/parser33'
|
298
|
+
Prism::Translation::Parser33
|
299
|
+
when 3.4
|
300
|
+
require 'prism/translation/parser34'
|
301
|
+
Prism::Translation::Parser34
|
302
|
+
else
|
303
|
+
raise ArgumentError, 'RuboCop supports target Ruby versions 3.3 and above with Prism. ' \
|
304
|
+
"Specified target Ruby version: #{ruby_version.inspect}"
|
305
|
+
end
|
274
306
|
end
|
275
307
|
end
|
276
|
-
# rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/MethodLength
|
277
308
|
|
278
|
-
def create_parser(ruby_version)
|
309
|
+
def create_parser(ruby_version, parser_engine)
|
279
310
|
builder = RuboCop::AST::Builder.new
|
280
311
|
|
281
|
-
parser_class(ruby_version).new(builder).tap do |parser|
|
312
|
+
parser_class(ruby_version, parser_engine).new(builder).tap do |parser|
|
282
313
|
# On JRuby there's a risk that we hang in tokenize() if we
|
283
314
|
# don't set the all errors as fatal flag. The problem is caused by a bug
|
284
315
|
# in Racc that is discussed in issue #93 of the whitequark/parser
|
@@ -311,4 +342,3 @@ module RuboCop
|
|
311
342
|
end
|
312
343
|
end
|
313
344
|
end
|
314
|
-
# rubocop:enable Metrics/ClassLength
|
data/lib/rubocop/ast/token.rb
CHANGED
@@ -38,14 +38,14 @@ module RuboCop
|
|
38
38
|
body: self.body(signature, arity_check))
|
39
39
|
type, *aliases = type
|
40
40
|
lineno = caller_locations(1, 1).first.lineno
|
41
|
-
module_eval(<<~RUBY, __FILE__, lineno)
|
41
|
+
module_eval(<<~RUBY, __FILE__, lineno)
|
42
42
|
def on_#{type}(node) # def on_send(node)
|
43
43
|
#{body} # # body ...
|
44
44
|
nil # nil
|
45
45
|
end # end
|
46
46
|
RUBY
|
47
47
|
aliases.each do |m|
|
48
|
-
alias_method "on_#{m}", "on_#{type}"
|
48
|
+
alias_method :"on_#{m}", :"on_#{type}"
|
49
49
|
end
|
50
50
|
end
|
51
51
|
|
data/lib/rubocop/ast/version.rb
CHANGED
data/lib/rubocop/ast.rb
CHANGED
@@ -5,7 +5,6 @@ require 'forwardable'
|
|
5
5
|
require 'set'
|
6
6
|
|
7
7
|
require_relative 'ast/ext/range'
|
8
|
-
require_relative 'ast/ext/range_min_max'
|
9
8
|
require_relative 'ast/node_pattern/method_definer'
|
10
9
|
require_relative 'ast/node_pattern'
|
11
10
|
require_relative 'ast/node/mixin/descendence'
|
@@ -70,6 +69,7 @@ require_relative 'ast/node/or_node'
|
|
70
69
|
require_relative 'ast/node/pair_node'
|
71
70
|
require_relative 'ast/node/procarg0_node'
|
72
71
|
require_relative 'ast/node/range_node'
|
72
|
+
require_relative 'ast/node/rational_node'
|
73
73
|
require_relative 'ast/node/regexp_node'
|
74
74
|
require_relative 'ast/node/rescue_node'
|
75
75
|
require_relative 'ast/node/resbody_node'
|
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.32.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:
|
13
|
+
date: 2024-08-17 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: parser
|
@@ -18,14 +18,14 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - ">="
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 3.
|
21
|
+
version: 3.3.1.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
requirements:
|
26
26
|
- - ">="
|
27
27
|
- !ruby/object:Gem::Version
|
28
|
-
version: 3.
|
28
|
+
version: 3.3.1.0
|
29
29
|
description: " RuboCop's Node and NodePattern classes.\n"
|
30
30
|
email: rubocop@googlegroups.com
|
31
31
|
executables: []
|
@@ -40,7 +40,6 @@ files:
|
|
40
40
|
- lib/rubocop/ast.rb
|
41
41
|
- lib/rubocop/ast/builder.rb
|
42
42
|
- lib/rubocop/ast/ext/range.rb
|
43
|
-
- lib/rubocop/ast/ext/range_min_max.rb
|
44
43
|
- lib/rubocop/ast/node.rb
|
45
44
|
- lib/rubocop/ast/node/alias_node.rb
|
46
45
|
- lib/rubocop/ast/node/and_asgn_node.rb
|
@@ -92,6 +91,7 @@ files:
|
|
92
91
|
- lib/rubocop/ast/node/pair_node.rb
|
93
92
|
- lib/rubocop/ast/node/procarg0_node.rb
|
94
93
|
- lib/rubocop/ast/node/range_node.rb
|
94
|
+
- lib/rubocop/ast/node/rational_node.rb
|
95
95
|
- lib/rubocop/ast/node/regexp_node.rb
|
96
96
|
- lib/rubocop/ast/node/resbody_node.rb
|
97
97
|
- lib/rubocop/ast/node/rescue_node.rb
|
@@ -149,14 +149,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
149
149
|
requirements:
|
150
150
|
- - ">="
|
151
151
|
- !ruby/object:Gem::Version
|
152
|
-
version: 2.
|
152
|
+
version: 2.7.0
|
153
153
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
154
154
|
requirements:
|
155
155
|
- - ">="
|
156
156
|
- !ruby/object:Gem::Version
|
157
157
|
version: '0'
|
158
158
|
requirements: []
|
159
|
-
rubygems_version: 3.
|
159
|
+
rubygems_version: 3.5.11
|
160
160
|
signing_key:
|
161
161
|
specification_version: 4
|
162
162
|
summary: RuboCop tools to deal with Ruby code AST.
|
@@ -1,18 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module RuboCop
|
4
|
-
module AST
|
5
|
-
module Ext
|
6
|
-
# Refinement to circumvent broken `Range#minmax` for infinity ranges in 2.6-
|
7
|
-
module RangeMinMax
|
8
|
-
if ::Range.instance_method(:minmax).owner != ::Range
|
9
|
-
refine ::Range do
|
10
|
-
def minmax
|
11
|
-
[min, max]
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|