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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0f538f2ba2d235b12111dfc20f5cb568ed1212310bf90f3f9abf783866153b93
4
- data.tar.gz: 9a67f643a7b4371f6592a846664933cd56399689a3c8005ef4ef8ddfb4857341
3
+ metadata.gz: 34e6f8d5799eb4f6871ac4666b174d020ca3131b801184b31324d7488abc64b8
4
+ data.tar.gz: f0be9d5375bc11ae205a2b6343aa2db37afdd330bbde6d22c82ee54b1d6ae03d
5
5
  SHA512:
6
- metadata.gz: 9df6cd1a8593620ac41fc08a9798b5c0e5c2973f62d8068605435f6d0231ab0ccd9555610645951d2550f7150753395f64d4ffd9d8fe74b40ffbce6a095f3ce1
7
- data.tar.gz: c4d67ddff04232bead212dcc7632ac3e5195c29f0314a5137c0c2da57ba7805f386600f4a21fdd490d7a0988165974482fc1e60a7aed9227a9f37466b79e85eb
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 `emit_forward_arg` which is set to `true`.
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`:
@@ -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
@@ -3,7 +3,7 @@
3
3
  module RuboCop
4
4
  module AST
5
5
  module Version
6
- STRING = '1.3.0'
6
+ STRING = '1.4.0'
7
7
  end
8
8
  end
9
9
  end
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.3.0
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: 2020-12-01 00:00:00.000000000 Z
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.1.4
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.