rubocop-ast 1.3.0 → 1.4.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/README.md +3 -1
- data/lib/rubocop/ast/builder.rb +3 -1
- data/lib/rubocop/ast/traversal.rb +3 -2
- data/lib/rubocop/ast/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 34e6f8d5799eb4f6871ac4666b174d020ca3131b801184b31324d7488abc64b8
|
4
|
+
data.tar.gz: f0be9d5375bc11ae205a2b6343aa2db37afdd330bbde6d22c82ee54b1d6ae03d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa8d27ca9cb6cb156f4a5cc1a951860fa2c04ef0cdf425c4ce2255825a08e664c0255e24c75495c66028f8aeadcf59f524b14b409c6d644129ff95e7a2c56194
|
7
|
+
data.tar.gz: 36c4874bf4e4dd2c8d076243ee08f670dcf17711ebced45f200f71dd720faf4cd1e119b9df491fcee140d33d94bc7ddc3fd88f8818665505702c24ac54e0b91e
|
data/README.md
CHANGED
@@ -35,7 +35,9 @@ See the [docs site](https://docs.rubocop.org/rubocop-ast) for more details.
|
|
35
35
|
|
36
36
|
### Parser compatibility switches
|
37
37
|
|
38
|
-
This gem, by default, uses most [legacy AST output from parser](https://github.com/whitequark/parser/#usage), except for
|
38
|
+
This gem, by default, uses most [legacy AST output from parser](https://github.com/whitequark/parser/#usage), except for the following which are set to `true`:
|
39
|
+
* `emit_forward_arg`
|
40
|
+
* `emit_match_pattern`
|
39
41
|
|
40
42
|
The main `RuboCop` gem uses these defaults (and is currently only compatible with these), but this gem can be used separately from `RuboCop` and is meant to be compatible with all settings. For example, to have `-> { ... }` emitted
|
41
43
|
as `LambdaNode` instead of `SendNode`:
|
data/lib/rubocop/ast/builder.rb
CHANGED
@@ -14,7 +14,8 @@ module RuboCop
|
|
14
14
|
# parser = Parser::Ruby25.new(builder)
|
15
15
|
# root_node = parser.parse(buffer)
|
16
16
|
class Builder < Parser::Builders::Default
|
17
|
-
self.emit_forward_arg = true
|
17
|
+
self.emit_forward_arg = true if respond_to?(:emit_forward_arg=)
|
18
|
+
self.emit_match_pattern = true if respond_to?(:emit_match_pattern=)
|
18
19
|
|
19
20
|
# @api private
|
20
21
|
NODE_MAP = {
|
@@ -52,6 +53,7 @@ module RuboCop
|
|
52
53
|
indexasgn: IndexasgnNode,
|
53
54
|
irange: RangeNode,
|
54
55
|
erange: RangeNode,
|
56
|
+
kwargs: HashNode,
|
55
57
|
kwsplat: KeywordSplatNode,
|
56
58
|
lambda: LambdaNode,
|
57
59
|
module: ModuleNode,
|
@@ -114,9 +114,10 @@ module RuboCop
|
|
114
114
|
in_match match_alt break next
|
115
115
|
match_as array_pattern array_pattern_with_tail
|
116
116
|
hash_pattern const_pattern find_pattern
|
117
|
-
index indexasgn procarg0]
|
117
|
+
index indexasgn procarg0 kwargs]
|
118
118
|
many_opt_node_children = %i[case rescue resbody ensure for when
|
119
|
-
case_match in_pattern irange erange
|
119
|
+
case_match in_pattern irange erange
|
120
|
+
match_pattern match_pattern_p]
|
120
121
|
|
121
122
|
### Callbacks for above
|
122
123
|
def_callback no_children
|
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.4.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:
|
13
|
+
date: 2021-01-01 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: parser
|
@@ -168,7 +168,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
168
168
|
- !ruby/object:Gem::Version
|
169
169
|
version: '0'
|
170
170
|
requirements: []
|
171
|
-
rubygems_version: 3.
|
171
|
+
rubygems_version: 3.2.3
|
172
172
|
signing_key:
|
173
173
|
specification_version: 4
|
174
174
|
summary: RuboCop tools to deal with Ruby code AST.
|