syntax_tree 5.0.1 → 5.1.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: 3b2322461fc3abb52a77604f2b6791c82941983bb490a8281eceb336336ae2f1
4
- data.tar.gz: 395163315be211645af6b4ed60852342d247b428cda0d29a546f700a3d311387
3
+ metadata.gz: 0adfab4347f7d3abda07479e427b2df975e98fb9dafa731cb8b2188da42ab18b
4
+ data.tar.gz: 4d730d2eaadfa61585e683f6ad444b40336787a561ac7f08c630d5aef857d3d7
5
5
  SHA512:
6
- metadata.gz: 7d6754a8cc53af931bc1c14a18ed85a86e0c15412e127ad9a0c94592694c8ffdb359cf51e89ba87b84c9c3c5da64a2cee4ebf5638cbb2d2c672f47bc69a4d376
7
- data.tar.gz: 90d86586324ca16f482f29f77dc8091a297b237970abdbb95745455ef6619cce854682be8f4ea98e5a6b6006379379fe5cc5e3e15ce96d1883da983b085fce22
6
+ metadata.gz: 890fdc12c1d6d0643231a908bb0f1a503d365fc56d1349f36dc99497eff6a30e51309ecce2cb19e10159e3dd1a1f811a8fd8c3904c94943992ff069811f85ced
7
+ data.tar.gz: f1e546cd8397b62f4c518103b18c712fead74c82e23ecb527909727a91f7556cddc9886c730be8a968e957b64addb79c9665869e6fcb57b1d26b1b7f13f5bfa5
data/.rubocop.yml CHANGED
@@ -16,6 +16,15 @@ Layout/LineLength:
16
16
  Lint/AmbiguousBlockAssociation:
17
17
  Enabled: false
18
18
 
19
+ Lint/AmbiguousOperatorPrecedence:
20
+ Enabled: false
21
+
22
+ Lint/AmbiguousRange:
23
+ Enabled: false
24
+
25
+ Lint/BooleanSymbol:
26
+ Enabled: false
27
+
19
28
  Lint/DuplicateBranch:
20
29
  Enabled: false
21
30
 
@@ -28,9 +37,18 @@ Lint/InterpolationCheck:
28
37
  Lint/MissingSuper:
29
38
  Enabled: false
30
39
 
40
+ Lint/NonLocalExitFromIterator:
41
+ Enabled: false
42
+
31
43
  Lint/RedundantRequireStatement:
32
44
  Enabled: false
33
45
 
46
+ Lint/SuppressedException:
47
+ Enabled: false
48
+
49
+ Lint/UnderscorePrefixedVariableName:
50
+ Enabled: false
51
+
34
52
  Lint/UnusedMethodArgument:
35
53
  AllowUnusedKeywordArguments: true
36
54
 
@@ -46,15 +64,42 @@ Naming/MethodParameterName:
46
64
  Naming/RescuedExceptionsVariableName:
47
65
  PreferredName: error
48
66
 
67
+ Naming/VariableNumber:
68
+ Enabled: false
69
+
70
+ Security/Eval:
71
+ Enabled: false
72
+
73
+ Style/AccessorGrouping:
74
+ Enabled: false
75
+
49
76
  Style/CaseEquality:
50
77
  Enabled: false
51
78
 
79
+ Style/CaseLikeIf:
80
+ Enabled: false
81
+
82
+ Style/ClassVars:
83
+ Enabled: false
84
+
85
+ Style/DocumentDynamicEvalDefinition:
86
+ Enabled: false
87
+
88
+ Style/Documentation:
89
+ Enabled: false
90
+
91
+ Style/EndBlock:
92
+ Enabled: false
93
+
52
94
  Style/ExplicitBlockArgument:
53
95
  Enabled: false
54
96
 
55
97
  Style/FormatString:
56
98
  Enabled: false
57
99
 
100
+ Style/FormatStringToken:
101
+ Enabled: false
102
+
58
103
  Style/GuardClause:
59
104
  Enabled: false
60
105
 
@@ -79,6 +124,9 @@ Style/MutableConstant:
79
124
  Style/NegatedIfElseCondition:
80
125
  Enabled: false
81
126
 
127
+ Style/Next:
128
+ Enabled: false
129
+
82
130
  Style/NumericPredicate:
83
131
  Enabled: false
84
132
 
@@ -88,6 +136,9 @@ Style/ParallelAssignment:
88
136
  Style/PerlBackrefs:
89
137
  Enabled: false
90
138
 
139
+ Style/SafeNavigation:
140
+ Enabled: false
141
+
91
142
  Style/SpecialGlobalVars:
92
143
  Enabled: false
93
144
 
data/CHANGELOG.md CHANGED
@@ -6,6 +6,21 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [5.1.0] - 2022-12-28
10
+
11
+ ### Added
12
+
13
+ - An experiment in working with instruction sequences has been added to Syntax Tree. This is subject to change, so it is not well documented or tested at the moment. It does not impact other functionality.
14
+ - You can now format at a different base layer of indentation. This is an optional third argument to `SyntaxTree::format`.
15
+
16
+ ### Changed
17
+
18
+ - Support forwarding anonymous keyword arguments with `**`.
19
+ - The `BodyStmt` node now has a more correct location information.
20
+ - Ignore the `textDocument/documentColor` request coming into the language server to support clients that require that request be received.
21
+ - Do not attempt to convert `if..else` into ternaries if the predicate has a `Binary` node.
22
+ - Properly handle nested pattern matching when a rightward assignment is inside a `when` clause.
23
+
9
24
  ## [5.0.1] - 2022-11-10
10
25
 
11
26
  ### Changed
@@ -456,7 +471,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
456
471
 
457
472
  - 🎉 Initial release! 🎉
458
473
 
459
- [unreleased]: https://github.com/ruby-syntax-tree/syntax_tree/compare/v5.0.1...HEAD
474
+ [unreleased]: https://github.com/ruby-syntax-tree/syntax_tree/compare/v5.1.0...HEAD
475
+ [5.1.0]: https://github.com/ruby-syntax-tree/syntax_tree/compare/v5.0.1...v5.1.0
460
476
  [5.0.1]: https://github.com/ruby-syntax-tree/syntax_tree/compare/v5.0.0...v5.0.1
461
477
  [5.0.0]: https://github.com/ruby-syntax-tree/syntax_tree/compare/v4.3.0...v5.0.0
462
478
  [4.3.0]: https://github.com/ruby-syntax-tree/syntax_tree/compare/v4.2.0...v4.3.0
data/Gemfile.lock CHANGED
@@ -1,25 +1,25 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- syntax_tree (5.0.1)
5
- prettier_print (>= 1.1.0)
4
+ syntax_tree (5.1.0)
5
+ prettier_print (>= 1.2.0)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
10
  ast (2.4.2)
11
11
  docile (1.4.0)
12
- json (2.6.2)
12
+ json (2.6.3)
13
13
  minitest (5.16.3)
14
14
  parallel (1.22.1)
15
- parser (3.1.2.1)
15
+ parser (3.1.3.0)
16
16
  ast (~> 2.4.1)
17
- prettier_print (1.1.0)
17
+ prettier_print (1.2.0)
18
18
  rainbow (3.1.1)
19
19
  rake (13.0.6)
20
- regexp_parser (2.6.0)
20
+ regexp_parser (2.6.1)
21
21
  rexml (3.2.5)
22
- rubocop (1.38.0)
22
+ rubocop (1.41.1)
23
23
  json (~> 2.3)
24
24
  parallel (~> 1.10)
25
25
  parser (>= 3.1.2.1)
@@ -29,10 +29,10 @@ GEM
29
29
  rubocop-ast (>= 1.23.0, < 2.0)
30
30
  ruby-progressbar (~> 1.7)
31
31
  unicode-display_width (>= 1.4.0, < 3.0)
32
- rubocop-ast (1.23.0)
32
+ rubocop-ast (1.24.0)
33
33
  parser (>= 3.1.1.0)
34
34
  ruby-progressbar (1.11.0)
35
- simplecov (0.21.2)
35
+ simplecov (0.22.0)
36
36
  docile (~> 1.1)
37
37
  simplecov-html (~> 0.11)
38
38
  simplecov_json_formatter (~> 0.1)
data/README.md CHANGED
@@ -324,11 +324,11 @@ stree write "**/{[!schema]*,*}.rb"
324
324
 
325
325
  ## Library
326
326
 
327
- Syntax Tree can be used as a library to access the syntax tree underlying Ruby source code.
327
+ Syntax Tree can be used as a library to access the syntax tree underlying Ruby source code. The API is described below. For the full library documentation, see the [RDoc documentation](https://ruby-syntax-tree.github.io/syntax_tree/).
328
328
 
329
329
  ### SyntaxTree.read(filepath)
330
330
 
331
- This function takes a filepath and returns a string associated with the content of that file. It is similar in functionality to `File.read`, except htat it takes into account Ruby-level file encoding (through magic comments at the top of the file).
331
+ This function takes a filepath and returns a string associated with the content of that file. It is similar in functionality to `File.read`, except that it takes into account Ruby-level file encoding (through magic comments at the top of the file).
332
332
 
333
333
  ### SyntaxTree.parse(source)
334
334
 
@@ -570,7 +570,7 @@ SyntaxTree::Formatter.format(source, program.accept(visitor))
570
570
  ### WithEnvironment
571
571
 
572
572
  The `WithEnvironment` module can be included in visitors to automatically keep track of local variables and arguments
573
- defined inside each environment. A `current_environment` accessor is made availble to the request, allowing it to find
573
+ defined inside each environment. A `current_environment` accessor is made available to the request, allowing it to find
574
574
  all usages and definitions of a local.
575
575
 
576
576
  ```ruby
@@ -611,7 +611,7 @@ The language server also responds to the relatively new inlay hints request. Thi
611
611
  1 + 2 * 3
612
612
  ```
613
613
 
614
- Implicity, the `2 * 3` is going to be executed first because the `*` operator has higher precedence than the `+` operator. To ease mental overhead, our language server includes small parentheses to make this explicit, as in:
614
+ Implicitly, the `2 * 3` is going to be executed first because the `*` operator has higher precedence than the `+` operator. To ease mental overhead, our language server includes small parentheses to make this explicit, as in:
615
615
 
616
616
  ```ruby
617
617
  1 + ₍2 * 3₎
@@ -686,7 +686,7 @@ Below are listed all of the "official" language plugins hosted under the same Gi
686
686
 
687
687
  ## Integration
688
688
 
689
- Syntax Tree's goal is to seemlessly integrate into your workflow. To this end, it provides a couple of additional tools beyond the CLI and the Ruby library.
689
+ Syntax Tree's goal is to seamlessly integrate into your workflow. To this end, it provides a couple of additional tools beyond the CLI and the Ruby library.
690
690
 
691
691
  ### Rake
692
692