rubocop-ast 1.10.0 → 1.13.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b3a3081c514303a8fb2f6ac3e4616da1d5f41ac4bd21d63407f9281534443385
|
4
|
+
data.tar.gz: dabd9d626ee4dd67946126b81f1a8852da16bb561caaabc91fa4b89648186fa6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f678e9d3b6da22c1be2861fd023121c50b161dfff5986ed14f49199c251bb041a2d2c3e93cacb86c9368dd71f8ed7575620984eeb54e65eaf183f062ffa11dee
|
7
|
+
data.tar.gz: 948888c0e83bca6acf73b06a0e5030bab2fde65cafa6366c6a3054cb07eca722d938f28a8b1e1bb226c8f48c9bb483b9d66704d432fdc87e23a4d2461809bb38
|
data/README.md
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
# RuboCop AST
|
2
2
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/rubocop-ast.svg)](https://badge.fury.io/rb/rubocop-ast)
|
4
|
-
[![CI](https://github.com/rubocop
|
5
|
-
[![Test Coverage](https://api.codeclimate.com/v1/badges/a29666e6373bc41bc0a9/test_coverage)](https://codeclimate.com/github/rubocop
|
6
|
-
[![Maintainability](https://api.codeclimate.com/v1/badges/a29666e6373bc41bc0a9/maintainability)](https://codeclimate.com/github/rubocop
|
4
|
+
[![CI](https://github.com/rubocop/rubocop-ast/workflows/CI/badge.svg)](https://github.com/rubocop/rubocop-ast/actions?query=workflow%3ACI)
|
5
|
+
[![Test Coverage](https://api.codeclimate.com/v1/badges/a29666e6373bc41bc0a9/test_coverage)](https://codeclimate.com/github/rubocop/rubocop-ast/test_coverage)
|
6
|
+
[![Maintainability](https://api.codeclimate.com/v1/badges/a29666e6373bc41bc0a9/maintainability)](https://codeclimate.com/github/rubocop/rubocop-ast/maintainability)
|
7
7
|
|
8
|
-
Contains the classes needed by [RuboCop](https://github.com/rubocop
|
8
|
+
Contains the classes needed by [RuboCop](https://github.com/rubocop/rubocop) to deal with Ruby's AST, in particular:
|
9
9
|
|
10
10
|
* `RuboCop::AST::Node` ([doc](docs/modules/ROOT/pages/node_types.adoc))
|
11
11
|
* `RuboCop::AST::NodePattern` ([doc](docs/modules/ROOT/pages/node_pattern.adoc))
|
@@ -28,9 +28,9 @@ module RuboCop
|
|
28
28
|
node_parts[1]
|
29
29
|
end
|
30
30
|
|
31
|
-
# The `block` node associated with this method dispatch, if any.
|
31
|
+
# The `block` or `numblock` node associated with this method dispatch, if any.
|
32
32
|
#
|
33
|
-
# @return [BlockNode, nil] the `block` node associated with this method
|
33
|
+
# @return [BlockNode, nil] the `block` or `numblock` node associated with this method
|
34
34
|
# call or `nil`
|
35
35
|
def block_node
|
36
36
|
parent if block_literal?
|
@@ -154,7 +154,7 @@ module RuboCop
|
|
154
154
|
#
|
155
155
|
# @return [Boolean] whether the dispatched method has a block
|
156
156
|
def block_literal?
|
157
|
-
parent&.block_type? && eql?(parent.send_node)
|
157
|
+
(parent&.block_type? || parent&.numblock_type?) && eql?(parent.send_node)
|
158
158
|
end
|
159
159
|
|
160
160
|
# Checks whether this node is an arithmetic operation
|
data/lib/rubocop/ast/node.rb
CHANGED
@@ -425,7 +425,7 @@ module RuboCop
|
|
425
425
|
end
|
426
426
|
|
427
427
|
def keyword?
|
428
|
-
return true if special_keyword? || send_type? && prefix_not?
|
428
|
+
return true if special_keyword? || (send_type? && prefix_not?)
|
429
429
|
return false unless KEYWORDS.include?(type)
|
430
430
|
|
431
431
|
!OPERATOR_KEYWORDS.include?(type) || loc.operator.is?(type.to_s)
|
@@ -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?
|
@@ -507,20 +507,20 @@ module RuboCop
|
|
507
507
|
# @deprecated Use `:class_constructor?`
|
508
508
|
# @!method struct_constructor?(node = self)
|
509
509
|
def_node_matcher :struct_constructor?, <<~PATTERN
|
510
|
-
(block (send #global_const?(:Struct) :new ...) _ $_)
|
510
|
+
({block numblock} (send #global_const?(:Struct) :new ...) _ $_)
|
511
511
|
PATTERN
|
512
512
|
|
513
513
|
# @!method class_definition?(node = self)
|
514
514
|
def_node_matcher :class_definition?, <<~PATTERN
|
515
515
|
{(class _ _ $_)
|
516
516
|
(sclass _ $_)
|
517
|
-
(block (send #global_const?({:Struct :Class}) :new ...) _ $_)}
|
517
|
+
({block numblock} (send #global_const?({:Struct :Class}) :new ...) _ $_)}
|
518
518
|
PATTERN
|
519
519
|
|
520
520
|
# @!method module_definition?(node = self)
|
521
521
|
def_node_matcher :module_definition?, <<~PATTERN
|
522
522
|
{(module _ $_)
|
523
|
-
(block (send #global_const?(:Module) :new ...) _ $_)}
|
523
|
+
({block numblock} (send #global_const?(:Module) :new ...) _ $_)}
|
524
524
|
PATTERN
|
525
525
|
|
526
526
|
# Some expressions are evaluated for their value, some for their side
|
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.13.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: 2021-
|
13
|
+
date: 2021-11-07 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: parser
|
@@ -150,15 +150,15 @@ files:
|
|
150
150
|
- lib/rubocop/ast/token.rb
|
151
151
|
- lib/rubocop/ast/traversal.rb
|
152
152
|
- lib/rubocop/ast/version.rb
|
153
|
-
homepage: https://github.com/rubocop
|
153
|
+
homepage: https://github.com/rubocop/rubocop-ast
|
154
154
|
licenses:
|
155
155
|
- MIT
|
156
156
|
metadata:
|
157
157
|
homepage_uri: https://www.rubocop.org/
|
158
|
-
changelog_uri: https://github.com/rubocop
|
159
|
-
source_code_uri: https://github.com/rubocop
|
158
|
+
changelog_uri: https://github.com/rubocop/rubocop-ast/blob/master/CHANGELOG.md
|
159
|
+
source_code_uri: https://github.com/rubocop/rubocop-ast/
|
160
160
|
documentation_uri: https://docs.rubocop.org/rubocop-ast/
|
161
|
-
bug_tracker_uri: https://github.com/rubocop
|
161
|
+
bug_tracker_uri: https://github.com/rubocop/rubocop-ast/issues
|
162
162
|
post_install_message:
|
163
163
|
rdoc_options: []
|
164
164
|
require_paths:
|