prettier 1.2.5 → 1.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +353 -367
- data/README.md +10 -4
- data/package.json +1 -1
- data/src/haml/embed.js +87 -0
- data/src/haml/nodes/comment.js +27 -0
- data/src/haml/nodes/doctype.js +34 -0
- data/src/haml/nodes/filter.js +16 -0
- data/src/haml/nodes/hamlComment.js +21 -0
- data/src/haml/nodes/plain.js +6 -0
- data/src/haml/nodes/root.js +8 -0
- data/src/haml/nodes/script.js +33 -0
- data/src/haml/nodes/silentScript.js +59 -0
- data/src/haml/nodes/tag.js +193 -0
- data/src/haml/parser.js +22 -0
- data/src/haml/parser.rb +138 -0
- data/src/haml/printer.js +28 -0
- data/src/parser/getLang.js +32 -0
- data/src/parser/getNetcat.js +50 -0
- data/src/parser/netcat.js +15 -0
- data/src/parser/parseSync.js +33 -0
- data/src/parser/requestParse.js +74 -0
- data/src/parser/server.rb +61 -0
- data/src/plugin.js +26 -4
- data/src/rbs/parser.js +39 -0
- data/src/rbs/parser.rb +94 -0
- data/src/rbs/printer.js +605 -0
- data/src/ruby/embed.js +61 -13
- data/src/ruby/nodes/args.js +20 -6
- data/src/ruby/nodes/arrays.js +36 -33
- data/src/ruby/nodes/calls.js +2 -31
- data/src/ruby/nodes/class.js +17 -27
- data/src/ruby/nodes/commands.js +1 -1
- data/src/ruby/nodes/conditionals.js +1 -1
- data/src/ruby/nodes/hashes.js +28 -14
- data/src/ruby/nodes/heredocs.js +5 -3
- data/src/ruby/nodes/loops.js +4 -10
- data/src/ruby/nodes/methods.js +4 -11
- data/src/ruby/nodes/rescue.js +32 -25
- data/src/ruby/nodes/statements.js +6 -5
- data/src/ruby/nodes/strings.js +7 -6
- data/src/ruby/parser.js +2 -50
- data/src/ruby/parser.rb +118 -33
- data/src/ruby/printer.js +8 -5
- data/src/utils.js +2 -1
- data/src/utils/inlineEnsureParens.js +8 -1
- data/src/utils/isEmptyBodyStmt.js +7 -0
- data/src/utils/isEmptyStmts.js +9 -5
- data/src/utils/literallineWithoutBreakParent.js +7 -0
- data/src/utils/printEmptyCollection.js +9 -2
- metadata +26 -3
- data/src/utils/literalLineNoBreak.js +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 97cf5963c684d5bf17079800c59b79fb15f787c89c1b1d7bd315c3851307737f
|
4
|
+
data.tar.gz: 721e04eaa93f654d873e2b972b718b3d1db41d7acca278b8eec743aa92daf755
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fe8997d3c57f9ed1d6cc23d198555c51d234dd856d0e3803879fb4a92809204fcb5d8b70e0a02421e902d9fd4d33e34e02e7e6ccd778caef203ce3aa7b6c6037
|
7
|
+
data.tar.gz: 91656de653ca7b90469dfbc3e6363259d3e9977693e649846d0bc4fd39e0585798f985334b1895790efbb9613f39ba35dce3193aecb59844d0f419d0da2c5bf0
|
data/CHANGELOG.md
CHANGED
@@ -6,118 +6,167 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
|
|
6
6
|
|
7
7
|
## [Unreleased]
|
8
8
|
|
9
|
+
## [1.5.2] - 2021-02-03
|
10
|
+
|
11
|
+
### Changed
|
12
|
+
|
13
|
+
- kddeisz - Fix up `binary` node comparison operators so that it will handle either Symbol literals or the `@op` nodes which are incorrectly coming from JRuby (https://github.com/jruby/jruby/issues/6548).
|
14
|
+
|
15
|
+
## [1.5.1] - 2021-01-27
|
16
|
+
|
17
|
+
### Changed
|
18
|
+
|
19
|
+
- [#799](https://github.com/prettier/plugin-ruby/issues/799) - jscheid, kddeisz - Multi-byte characters shouldn't give invalid source string bounds.
|
20
|
+
- [#801](https://github.com/prettier/plugin-ruby/issues/801) - jscheid, kddeisz - When converting a conditional to the modifier form, make sure to add parentheses if there is a chained method call.
|
21
|
+
- [#803](https://github.com/prettier/plugin-ruby/issues/803) - jscheid, kddeisz - Fix `formatWithCursor` support to match new parser format.
|
22
|
+
|
23
|
+
## [1.5.0] - 2021-01-21
|
24
|
+
|
25
|
+
### Added
|
26
|
+
|
27
|
+
- kddeisz - Add `.rbi` as a file type that we support.
|
28
|
+
|
29
|
+
### Changed
|
30
|
+
|
31
|
+
- [#795](https://github.com/prettier/plugin-ruby/issues/795) djrodgerspryor, kddeisz - Trailing comments attached to empty arrays should not multiply.
|
32
|
+
- [#794](https://github.com/prettier/plugin-ruby/issues/794) djrodgerspryor, kddeisz - Fix embedded parser parsing by stripping common leading whitespace before passing on the content.
|
33
|
+
- [#793](https://github.com/prettier/plugin-ruby/issues/793) djrodgerspryor, kddeisz - Do not include trailing commas on arguments within `arg_paren` nodes if they could not be parsed with them (`command` and `command_call`).
|
34
|
+
- [#788](https://github.com/prettier/plugin-ruby/issues/788) clarkdave, kddeisz - Break child hashes within a multi-line hash regardless of whether or not they can fit on one line.
|
35
|
+
- kddeisz - Stop using `;` to separate empty class definitions, module definitions, and loops.
|
36
|
+
|
37
|
+
## [1.4.0] - 2021-01-15
|
38
|
+
|
39
|
+
### Added
|
40
|
+
|
41
|
+
- ianks, kddeisz - Use `netcat` to communicate to a parser server for better performance when formatting multiple files.
|
42
|
+
|
43
|
+
### Changed
|
44
|
+
|
45
|
+
- jeffcarbs, kddeisz - Long strings with interpolated expressions should only break if the contents in the original source is broken.
|
46
|
+
- johannesluedke, kddeisz - Fix for rescues with inline comments.
|
47
|
+
- johncsnyder, kddeisz - Comments should not attach to nodes beyond a double newline.
|
48
|
+
- blampe, kddeisz - Comments inside of a broken method chain get dropped.
|
49
|
+
- clarkdave, kddeisz - Don't ignore Sorbet `sig` transformations.
|
50
|
+
|
51
|
+
## [1.3.0] - 2021-01-05
|
52
|
+
|
53
|
+
### Added
|
54
|
+
|
55
|
+
- kddeisz - Handling of the RBS language.
|
56
|
+
- kddeisz - Incorporate the HAML plugin.
|
57
|
+
|
9
58
|
## [1.2.5] - 2021-01-04
|
10
59
|
|
11
60
|
### Changed
|
12
61
|
|
13
|
-
-
|
14
|
-
-
|
15
|
-
-
|
62
|
+
- nruth, kddeisz - Ensure unary operators on method calls that are sending operators get the correct scanner events.
|
63
|
+
- cvoege, kddeisz - Do not add parentheses when they're not needed to non-breaking command_calls with ternary arguments.
|
64
|
+
- valscion, kddeisz - Print method chains more nicely off array and hash literals.
|
16
65
|
|
17
66
|
## [1.2.4] - 2021-01-03
|
18
67
|
|
19
68
|
### Added
|
20
69
|
|
21
|
-
-
|
70
|
+
- andyw8 - Explain usage with Rubocop, as well as shipping a rubocop.yml config.
|
22
71
|
|
23
72
|
### Changed
|
24
73
|
|
25
|
-
-
|
26
|
-
-
|
74
|
+
- kddeisz - Reduce JSON size passing from Ruby process to node process by changing `char_start` -> `sc`, `char_end` -> `ec`, `start` -> `sl`, `end` -> `el`.
|
75
|
+
- kddeisz - Up the max buffer size between the Ruby and node processes to 15K.
|
27
76
|
|
28
77
|
## [1.2.3] - 2021-01-02
|
29
78
|
|
30
79
|
### Changed
|
31
80
|
|
32
|
-
-
|
33
|
-
-
|
34
|
-
-
|
35
|
-
-
|
36
|
-
-
|
37
|
-
-
|
81
|
+
- lukyth, kddeisz - Ensure if a ternary breaks into an `if..else..end` within a `command_call` node that parentheses are added.
|
82
|
+
- AlanFoster, kddeisz - Ensure you consume the optional `do` keyword on `while` and `until` loops so that it doesn't confuse the parser.
|
83
|
+
- AlanFoster, kddeisz - Ensure key-value pairs split on line when the key has a comment attached within a hash.
|
84
|
+
- AlanFoster, kddeisz - Fix for `for` loops that have multiple index variables.
|
85
|
+
- AlanFoster, kddeisz - Fix parsing very large files by reducing the size of the JSON output from the parser.
|
86
|
+
- AlanFoster, kddeisz - Ensure you don't skip parentheses if you're returning a value with the `not` unary operator.
|
38
87
|
|
39
88
|
## [1.2.2] - 2021-01-01
|
40
89
|
|
41
90
|
### Changed
|
42
91
|
|
43
|
-
-
|
44
|
-
-
|
45
|
-
-
|
46
|
-
-
|
47
|
-
-
|
92
|
+
- nathan-beam - Gem does not work with CMD/Powershell.
|
93
|
+
- blampe, kddeisz - Comments inside keyword parameters in method declarations are not printed.
|
94
|
+
- blampe, kddeisz - `command_call` nodes with unary operators incorrectly parse their operator.
|
95
|
+
- blampe, kddeisz - Returning multiple values where the first has parentheses was incorrectly removing the remaining values.
|
96
|
+
- johncsnyder, kddeisz - Call chains whose left-most receiver is a no-indent expression should not indent their entire chain.
|
48
97
|
|
49
98
|
## [1.2.1] - 2020-12-27
|
50
99
|
|
51
100
|
### Changed
|
52
101
|
|
53
|
-
-
|
54
|
-
-
|
55
|
-
-
|
56
|
-
-
|
57
|
-
-
|
102
|
+
- kddeisz - Handle single-line method definitions with parameters.
|
103
|
+
- kddeisz - Handle hash and array patterns nested within find patterns.
|
104
|
+
- kddeisz - Handle rightward assignment.
|
105
|
+
- kddeisz - Handle find patterns with named boundaries.
|
106
|
+
- kddeisz - Handle rightward assignment in conditionals.
|
58
107
|
|
59
108
|
## [1.2.0] - 2020-12-26
|
60
109
|
|
61
110
|
### Added
|
62
111
|
|
63
|
-
-
|
64
|
-
-
|
112
|
+
- kddeisz - Support for the `fndptn` node for Ruby 3.0 pattern matching.
|
113
|
+
- kddeisz - Support for Ruby 3.0+ single-line method definitions.
|
65
114
|
|
66
115
|
## [1.1.0] - 2020-12-20
|
67
116
|
|
68
117
|
### Added
|
69
118
|
|
70
|
-
-
|
119
|
+
- kddeisz - Now that the comments are all fixed up, we can support `# prettier-ignore` comments.
|
71
120
|
|
72
121
|
### Changed
|
73
122
|
|
74
|
-
-
|
75
|
-
-
|
76
|
-
-
|
77
|
-
-
|
78
|
-
-
|
123
|
+
- rindek, kddeisz - Do not remove parentheses when receiver looks like a constant.
|
124
|
+
- rindek, kddeisz - Do not remove parentheses when using the special `call` syntax with no arguments.
|
125
|
+
- ykpythemind - Do not change regexp bounds if the body has certain content.
|
126
|
+
- karanmandal, kddeisz - Correctly print for loops.
|
127
|
+
- rafbm, kddeisz - If there are method chains with arguments only at the end, we should group the method chain and the method args.
|
79
128
|
|
80
129
|
## [1.0.1] - 2020-12-12
|
81
130
|
|
82
131
|
### Changed
|
83
132
|
|
84
|
-
-
|
133
|
+
- steobrien, kddeisz - Ensure leading comments in empty array and hash literals do not duplicate.
|
85
134
|
|
86
135
|
## [1.0.0] - 2020-12-11
|
87
136
|
|
88
137
|
### Changed
|
89
138
|
|
90
|
-
-
|
91
|
-
-
|
92
|
-
-
|
93
|
-
-
|
94
|
-
-
|
139
|
+
- kddeisz - Do not unescape double quotes in a single quote string.
|
140
|
+
- kddeisz - Only force braces on regexp for spaces and equals if it's inside a command or command_call.
|
141
|
+
- kddeisz - Leave Sorbet type annotations in place.
|
142
|
+
- kddeisz - Don't group hash contents, just allow them to break with their parent node.
|
143
|
+
- kddeisz - Honor the UTF-8 lang passed in through ENV vars.
|
95
144
|
|
96
145
|
## [1.0.0-rc2] - 2020-12-10
|
97
146
|
|
98
147
|
### Changed
|
99
148
|
|
100
|
-
-
|
101
|
-
-
|
102
|
-
-
|
103
|
-
-
|
104
|
-
-
|
105
|
-
-
|
106
|
-
-
|
149
|
+
- kddeisz - Print hashes with consistent keys (e.g., if one key cannot be a hash label, use all hash rockets).
|
150
|
+
- kddeisz - Respect using `o` or not using `o` for octal numbers.
|
151
|
+
- kddeisz - Ensure `when` clauses with multiple predicates that can be split into multiple lines are split correctly.
|
152
|
+
- kddeisz - Ensure hash literal is split correctly when only its contents would fit on one line.
|
153
|
+
- kddeisz - Simplify `toProc` checks by not calling if the option is disabled.
|
154
|
+
- johncsnyder, kddeisz - Add `method_add_block` to the potential like of method calls that can be chained.
|
155
|
+
- kddeisz - Add the `rubyArrayLiteral` option for disabling automatically turning into array literals.
|
107
156
|
|
108
157
|
## [1.0.0-rc1] - 2020-12-09
|
109
158
|
|
110
159
|
### Changed
|
111
160
|
|
112
|
-
-
|
161
|
+
- kddeisz - Rename options to prep for v1.0 release.
|
113
162
|
- `addTrailingCommas` -> `trailingComma`, `"es5"` means `true`
|
114
163
|
- `inlineConditionals` and `inlineLoops` -> `rubyModifier`
|
115
164
|
- `preferHashLabels` -> `rubyHashLabel`
|
116
165
|
- `preferSingleQuotes` -> `rubySingleQuote`
|
117
166
|
- `toProcTransform` -> `rubyToProc`
|
118
|
-
-
|
119
|
-
-
|
120
|
-
-
|
167
|
+
- andyw8, kddeisz - Fix for Ruby `2.5.1` dyna_symbols. Turns out they were previously incorrectly reported as `xstring` nodes.
|
168
|
+
- andyw8, kddeisz - Fix for plain `rescue` nodes with only comments in the body.
|
169
|
+
- andyw8, kddeisz - Move declaration-type comments up to the line in the original source, as in:
|
121
170
|
|
122
171
|
```ruby
|
123
172
|
def foo # :nodoc:
|
@@ -127,12 +176,12 @@ end
|
|
127
176
|
|
128
177
|
The comment in the above example should stay in place.
|
129
178
|
|
130
|
-
-
|
131
|
-
-
|
132
|
-
-
|
133
|
-
-
|
134
|
-
-
|
135
|
-
-
|
179
|
+
- janklimo - Respect special call syntax, e.g., `a.(1, 2, 3)` should remain the same.
|
180
|
+
- kddeisz - Fix up a bug with `ensure` being used in a `bodystmt` and not a `begin`.
|
181
|
+
- kddeisz - Fix up a bug with negative ranges, e.g., `-4..-3`.
|
182
|
+
- kddeisz - Fix up a bug with operator aliases, e.g., `alias << push`.
|
183
|
+
- kddeisz - Fix up a bug with calls and unary nodes, e.g., `!!foo&.bar`.
|
184
|
+
- kddeisz - Fix up a bug with multiple rescue clauses and comments, e.g.,
|
136
185
|
|
137
186
|
```ruby
|
138
187
|
begin
|
@@ -142,64 +191,64 @@ rescue Foo, Bar
|
|
142
191
|
end
|
143
192
|
```
|
144
193
|
|
145
|
-
-
|
146
|
-
-
|
147
|
-
-
|
148
|
-
-
|
149
|
-
-
|
150
|
-
-
|
151
|
-
-
|
152
|
-
-
|
153
|
-
-
|
154
|
-
-
|
155
|
-
-
|
156
|
-
-
|
157
|
-
-
|
158
|
-
|
159
|
-
|
194
|
+
- kddeisz - Handle string literals that start with `%Q`.
|
195
|
+
- kddeisz - Handle question method methods in the predicate of an if with a comment in the body.
|
196
|
+
- kddeisz - Fix bare `break` with comments immediately after.
|
197
|
+
- kddeisz - Fix for heredocs with comments immediately after the declaration.
|
198
|
+
- kddeisz - Fix for comments when you're defining a method whose name overlaps with a keyword.
|
199
|
+
- kddeisz - Don't automatically indent inside interpolated expressions from within a heredoc.
|
200
|
+
- kddeisz - Don't convert into string literal arrays if the elements have brackets.
|
201
|
+
- kddeisz - Ensure you break the parent when there is an assignment in the predicate of a loop.
|
202
|
+
- kddeisz - Fix up a bug with keyword aliases, e.g., `alias in within`.
|
203
|
+
- kddeisz - Force using braces for regex if a regex starts with a blank space.
|
204
|
+
- kddeisz - Force using braces for regex if a regex starts with an equals sign.
|
205
|
+
- kddeisz - Fix up a bug with constant aliases, e.g., `alias in IN`.
|
206
|
+
- andyw8, kddeisz - Ensure `rescue` comments stay on the same line as their declaration.
|
207
|
+
|
208
|
+
## [0.22.0] - 2020-12-08
|
160
209
|
|
161
210
|
### Changed
|
162
211
|
|
163
|
-
-
|
164
|
-
-
|
165
|
-
-
|
166
|
-
-
|
167
|
-
-
|
168
|
-
-
|
169
|
-
-
|
170
|
-
-
|
171
|
-
-
|
172
|
-
-
|
212
|
+
- flyerhzm - Print method chains by one indentation.
|
213
|
+
- mmcnl, kddeisz - Handle heredocs and blocks being passed to the same method.
|
214
|
+
- johncsnyder, kddeisz - Ensure correct formatting when breaking up conditionals with `inlineConditionals: false`.
|
215
|
+
- Rsullivan00 - Ensure that when ternaries as command arguments get broken into multiple lines we add the necessary parentheses.
|
216
|
+
- jbielick - Maintain parse order during if/unless modifier expressions
|
217
|
+
- flyerhzm - Slight prettifying of wrapped args if doc length is under a certain value.
|
218
|
+
- github0013, kddeisz - Ensure `not` keeps parentheses if they are being used.
|
219
|
+
- jbielick - Print heredocs consistently.
|
220
|
+
- kddeisz - Completely revamp the way we handle comments.
|
221
|
+
- kddeisz - Support `hshptn` and the remaining missing pattern matching syntax.
|
173
222
|
|
174
223
|
## [0.21.0] - 2020-12-02
|
175
224
|
|
176
225
|
### Changed
|
177
226
|
|
178
|
-
-
|
179
|
-
-
|
180
|
-
-
|
181
|
-
-
|
182
|
-
-
|
183
|
-
-
|
184
|
-
-
|
185
|
-
-
|
186
|
-
-
|
227
|
+
- kddeisz, ryan-hunter-pc - Explicitly handle `break` and `next` keyword parentheses.
|
228
|
+
- jbielick, kddeisz - Don't convert between `lambda {}` and `-> {}`. Technically it's breaking the semantics of the program. Also because lambda method call arguments can't handle everything that stabby lambda can.
|
229
|
+
- kddeisz - Turn off the `Symbol#to_proc` transform by default.
|
230
|
+
- janklimo, kddeisz - Properly handle trailing commas on hash arguments.
|
231
|
+
- coiti, kddeisz - Properly handle parentheses when necessary on if/unless statements and while/until loops.
|
232
|
+
- Rsullivan00 - Prevent `command` and `command_call` nodes from being turned into ternaries.
|
233
|
+
- kddeisz - Better handling of the `alias` node with and without comments.
|
234
|
+
- kddeisz - Better handling of the `BEGIN` and `END` nodes with and without comments.
|
235
|
+
- kddeisz - Much better handling of heredocs where now there is a consistent `heredoc` node instead of multiple.
|
187
236
|
|
188
237
|
## [0.20.1] - 2020-09-04
|
189
238
|
|
190
239
|
### Changed
|
191
240
|
|
192
|
-
-
|
241
|
+
- ftes, kddeisz - Properly escape HAML plain text statements that start with special HAML characters.
|
193
242
|
|
194
243
|
### Removed
|
195
244
|
|
196
|
-
-
|
245
|
+
- kddeisz - I'm stripping out the HAML plugin and putting it into its own package (`@prettier/plugin-haml`). It's become too difficult to maintain within this repo, and it's confusing for contributors because there are some things that work with Ruby and some things that don't. This is going to simplify maintenance. This should probably be a major version bump but since we're still pre `1.0` I'm going to leave it as a patch.
|
197
246
|
|
198
247
|
## [0.20.0] - 2020-08-28
|
199
248
|
|
200
249
|
### Added
|
201
250
|
|
202
|
-
-
|
251
|
+
- kddeisz - Allow embedded formatting on heredocs by the name placed at the start. For example,
|
203
252
|
|
204
253
|
<!-- prettier-ignore -->
|
205
254
|
```ruby
|
@@ -212,37 +261,37 @@ JAVASCRIPT
|
|
212
261
|
|
213
262
|
### Changed
|
214
263
|
|
215
|
-
-
|
264
|
+
- mmainz - Fix the encoding setting such that we're not overwriting the entire set of environment variables.
|
216
265
|
|
217
266
|
## [0.19.1] - 2020-08-21
|
218
267
|
|
219
268
|
### Changed
|
220
269
|
|
221
|
-
-
|
222
|
-
-
|
223
|
-
-
|
224
|
-
-
|
270
|
+
- Rsullivan00 - Do not tranform word-literal arrays when there is an escape sequence.
|
271
|
+
- steobrien, kddeisz - Do not indent heredocs with calls more than they should be.
|
272
|
+
- jpickwell - Include .simplecov in filenames
|
273
|
+
- github0013, kddeisz - Ensure we're parsing ruby files using UTF-8 regardless of the system encoding.
|
225
274
|
|
226
275
|
## [0.19.0] - 2020-07-03
|
227
276
|
|
228
277
|
### Added
|
229
278
|
|
230
|
-
-
|
231
|
-
-
|
279
|
+
- ryan-hunter-pc - Add the option to disable the `Symbol#to_proc` transform.
|
280
|
+
- ryan-hunter-pc], [@SViccari, kddeisz - Disable `Symbol#to_proc` transform when used as a key inside of a hash where the key is either `:if` or `:unless`.
|
232
281
|
|
233
282
|
## [0.18.2] - 2020-05-01
|
234
283
|
|
235
284
|
### Changed
|
236
285
|
|
237
|
-
-
|
238
|
-
-
|
239
|
-
-
|
286
|
+
- alse - Support `vscodeLanguageIds` for HAML.
|
287
|
+
- ShayDavidson, kddeisz - Don't allow replacing if/else with ternary if there's an assignment in the predicate.
|
288
|
+
- janklimo - Do not add an empty line after `rescue` when the block is empty.
|
240
289
|
|
241
290
|
## [0.18.1] - 2020-04-05
|
242
291
|
|
243
292
|
### Changed
|
244
293
|
|
245
|
-
-
|
294
|
+
- petevk, kddeisz - Use braces for block format iff it was originally a brace block, otherwise you could be changing precedence. For example:
|
246
295
|
|
247
296
|
<!-- prettier-ignore -->
|
248
297
|
```ruby
|
@@ -255,7 +304,7 @@ end.to raise_error
|
|
255
304
|
|
256
305
|
should maintain its `do...end` and not switch to inline braces otherwise the brace might get associated with the `1`.
|
257
306
|
|
258
|
-
-
|
307
|
+
- flyerhzm - Rewrite operators binary parser, as in:
|
259
308
|
|
260
309
|
<!-- prettier-ignore -->
|
261
310
|
```ruby
|
@@ -266,10 +315,10 @@ should maintain its `do...end` and not switch to inline braces otherwise the bra
|
|
266
315
|
[1]
|
267
316
|
```
|
268
317
|
|
269
|
-
-
|
270
|
-
-
|
271
|
-
-
|
272
|
-
-
|
318
|
+
- ftes, kddeisz - When old-form dynamic attributes are added to a `div` tag in HAML, it was previously skipping printing the `%div`, which led to it being incorrectly displayed.
|
319
|
+
- ftes, kddeisz - Previously if you had a long tag declaration with attributes that made it hit the line limit, then the content of the tag would be pushed to the next line but indented one character too many.
|
320
|
+
- ftes, kddeisz - Don't explicitly require JSON if it has already been loaded, as this can lead to rubygems activation errors.
|
321
|
+
- mmainz, kddeisz - Handle heredocs as the receivers of call nodes, as in:
|
273
322
|
|
274
323
|
<!-- prettier-ignore -->
|
275
324
|
```ruby
|
@@ -278,7 +327,7 @@ foo = <<~TEXT.strip
|
|
278
327
|
TEXT
|
279
328
|
```
|
280
329
|
|
281
|
-
-
|
330
|
+
- github0013, kddeisz - Leave parentheses in place if the value of a return node contains a binary with low operator precedence, as in:
|
282
331
|
|
283
332
|
<!-- prettier-ignore -->
|
284
333
|
```ruby
|
@@ -289,13 +338,13 @@ return (a or b) if c?
|
|
289
338
|
|
290
339
|
### Added
|
291
340
|
|
292
|
-
-
|
341
|
+
- kddeisz - Support for the `nokw_param` node for specifying when methods should no accept keywords, as in:
|
293
342
|
|
294
343
|
```ruby
|
295
344
|
def foo(**nil); end
|
296
345
|
```
|
297
346
|
|
298
|
-
-
|
347
|
+
- kddeisz - Support for the `args_forward` node for forwarding all types of arguments, as in:
|
299
348
|
|
300
349
|
```ruby
|
301
350
|
def foo(...)
|
@@ -305,13 +354,13 @@ end
|
|
305
354
|
|
306
355
|
### Changed
|
307
356
|
|
308
|
-
-
|
357
|
+
- ftes, kddeisz - Handled 3 or more classes on a node in HAML, as in:
|
309
358
|
|
310
359
|
```haml
|
311
360
|
%table.table.is-striped.is-hoverable
|
312
361
|
```
|
313
362
|
|
314
|
-
-
|
363
|
+
- ftes, kddeisz - Better handling of indentation of `if/elsif/else`, `unless/elsif/else`, and `case/when` branches, as in:
|
315
364
|
|
316
365
|
```haml
|
317
366
|
.column.is-12
|
@@ -321,9 +370,9 @@ end
|
|
321
370
|
FALSE
|
322
371
|
```
|
323
372
|
|
324
|
-
-
|
325
|
-
-
|
326
|
-
-
|
373
|
+
- tobyndockerill - Format numbers with underscores after 4 digits, as opposed to 3.
|
374
|
+
- ianks - Improve performance by using `--disable-gems`.
|
375
|
+
- flyerhzm - Calls are grouped such that after an end parenthesis the following call will not be indented, as in:
|
327
376
|
|
328
377
|
<!-- prettier-ignore -->
|
329
378
|
```ruby
|
@@ -344,7 +393,7 @@ Config::Download.new(
|
|
344
393
|
).perform
|
345
394
|
```
|
346
395
|
|
347
|
-
-
|
396
|
+
- pje, kddeisz - Method definition bodies (on `defs` nodes) should dedent if a helper method is called. As in:
|
348
397
|
|
349
398
|
<!-- prettier-ignore -->
|
350
399
|
```ruby
|
@@ -362,7 +411,7 @@ private def self.foo
|
|
362
411
|
end
|
363
412
|
```
|
364
413
|
|
365
|
-
-
|
414
|
+
- masqita, kddeisz - Inline variable assignment within a predicate should force the conditional to break, as in:
|
366
415
|
|
367
416
|
```ruby
|
368
417
|
array.each do |element|
|
@@ -372,26 +421,26 @@ array.each do |element|
|
|
372
421
|
end
|
373
422
|
```
|
374
423
|
|
375
|
-
-
|
376
|
-
-
|
377
|
-
-
|
424
|
+
- hafley66, kddeisz - Handle empty `while` and `until` blocks.
|
425
|
+
- Fruetel, kddeisz - Simplify string escape pattern by locking on any escape sequence.
|
426
|
+
- flyerhzm, kddeisz - Properly handle string quotes on symbols in hash keys.
|
378
427
|
|
379
428
|
## [0.17.0] - 2019-12-12
|
380
429
|
|
381
430
|
### Added
|
382
431
|
|
383
|
-
-
|
384
|
-
-
|
432
|
+
- matt-wratt - Better support for explicit `return` nodes with empty arrays or arrays with a single element.
|
433
|
+
- jrdioko, kddeisz - Alignment of `not_to` is explicitly allowed to not indent to better support rspec.
|
385
434
|
|
386
435
|
### Changed
|
387
436
|
|
388
|
-
-
|
437
|
+
- gin0606 - The max buffer being passed into the Ruby process is now up to 10MB.
|
389
438
|
|
390
439
|
## [0.16.0] - 2019-11-14
|
391
440
|
|
392
441
|
### Added
|
393
442
|
|
394
|
-
-
|
443
|
+
- mmainz, kddeisz - Support for extra commas in multiple assignment, as it changes the meaning. For example,
|
395
444
|
|
396
445
|
<!-- prettier-ignore -->
|
397
446
|
```ruby
|
@@ -400,12 +449,12 @@ a, = [1, 2, 3]
|
|
400
449
|
|
401
450
|
would previously get printed as `a = [1, 2, 3]`, which changes the value of `a` from `1` to the value of the entire array.
|
402
451
|
|
403
|
-
-
|
452
|
+
- kddeisz - Experimental support for the HAMtemplate language.
|
404
453
|
|
405
454
|
### Changed
|
406
455
|
|
407
|
-
-
|
408
|
-
-
|
456
|
+
- github0013, kddeisz - Support proper string escaping when the original string in the source is wrapped in `%q|...|`. For example, `%q|\'|` should get printed as `"\'"`, where previously it was dropping the backslash.
|
457
|
+
- jamescostian, kddeisz - Force ternary breaking when using the lower-precendence operators `and` and `or`. For example,
|
409
458
|
|
410
459
|
<!-- prettier-ignore -->
|
411
460
|
```ruby
|
@@ -418,7 +467,7 @@ end
|
|
418
467
|
|
419
468
|
the previous expression was being transformed into a ternary which was invalid ruby. Instead it now stays broken out into an if/else block.
|
420
469
|
|
421
|
-
-
|
470
|
+
- localhostdotdev], [@joeyjoejoejr], [@eins78, kddeisz - Better support for embedded expressions inside heredocs. For example,
|
422
471
|
|
423
472
|
<!-- prettier-ignore -->
|
424
473
|
```ruby
|
@@ -431,14 +480,14 @@ HERE
|
|
431
480
|
|
432
481
|
should remain formatted as it is. Whereas previously due to the way the lines were split, you would sometimes end up with it breaking after `#{`.
|
433
482
|
|
434
|
-
-
|
483
|
+
- jamescostian, kddeisz - Fix up `return` node printing. When returning multiple values, you need to return an array literal as opposed to using parentheses.
|
435
484
|
|
436
485
|
## [0.15.1] - 2019-11-05
|
437
486
|
|
438
487
|
### Changed
|
439
488
|
|
440
|
-
-
|
441
|
-
-
|
489
|
+
- AlanFoster - Add `bin/lex` for viewing the tokenized result of Ripper on Ruby code.
|
490
|
+
- jakeprime, kddeisz - When predicates from within an `if`, `unless`, `while`, or `until` loop break the line, they should be aligned together. For example,
|
442
491
|
|
443
492
|
<!-- prettier-ignore -->
|
444
493
|
```ruby
|
@@ -457,7 +506,7 @@ if foooooo ||
|
|
457
506
|
end
|
458
507
|
```
|
459
508
|
|
460
|
-
-
|
509
|
+
- jamescostian], [@AlanFoster - Empty `if`, and `unless` conditionals are now handled gracefully:
|
461
510
|
|
462
511
|
<!-- prettier-ignore -->
|
463
512
|
```ruby
|
@@ -465,7 +514,7 @@ if foo?
|
|
465
514
|
end
|
466
515
|
```
|
467
516
|
|
468
|
-
-
|
517
|
+
- mmainz, kddeisz - Hash keys are not converted to keyword syntax if they would make invalid symbols. For example,
|
469
518
|
|
470
519
|
<!-- prettier-ignore -->
|
471
520
|
```ruby
|
@@ -474,9 +523,9 @@ end
|
|
474
523
|
|
475
524
|
cannot be translated into `[]:` as that is an invalid symbol. Instead, it stays with the hash rocket syntax.
|
476
525
|
|
477
|
-
-
|
478
|
-
-
|
479
|
-
-
|
526
|
+
- cldevs, kddeisz - Do not attempt to format the insides of xstring literals (string that get sent to the command line surrounded by backticks or `%x`).
|
527
|
+
- cldevs, kddeisz - When predicates for `if`, `unless`, `while`, or `until` nodes contain an assignment, we can't know for sure that it doesn't modify the body. In this case we need to always break and form a multi-line block.
|
528
|
+
- MarcManiez, kddeisz - When the return value of `if`, `unless`, `while`, or `until` nodes are assigned to anything other than a local variable, we need to wrap them in parentheses if we're changing to the modifier form. This is because the following expressions have different semantic meaning:
|
480
529
|
|
481
530
|
<!-- prettier-ignore -->
|
482
531
|
```ruby
|
@@ -493,14 +542,14 @@ hash[:key] = (break :value while false)
|
|
493
542
|
|
494
543
|
That will guarantee that the expressions are equivalent.
|
495
544
|
|
496
|
-
-
|
545
|
+
- AlanFoster - Fix crashes that were happening with `ignored_nl` nodes.
|
497
546
|
|
498
547
|
## [0.15.0] - 2019-08-06
|
499
548
|
|
500
549
|
### Changed
|
501
550
|
|
502
|
-
-
|
503
|
-
-
|
551
|
+
- dudeofawesome, kddeisz - If xstring literals (command line calls surrounded by backticks) break, then we indent and place the command on a new line. Previously, this was resulting in new lines getting added each time the code was formatted. Now this happens correctly.
|
552
|
+
- krachtstefan, kddeisz - When a `while` or `until` loop modifies a `begin...end` statement, it must remain in the modifier form or else it changes sematic meaning. For example,
|
504
553
|
|
505
554
|
<!-- prettier-ignore -->
|
506
555
|
```ruby
|
@@ -520,8 +569,8 @@ end
|
|
520
569
|
|
521
570
|
because that would never execute `foo` if `bar` is falsy, whereas in the initial example it would have.
|
522
571
|
|
523
|
-
-
|
524
|
-
-
|
572
|
+
- jviney], kddeisz - When transforming a block into the `Symbol#to_proc` syntax from within a list of arguments inside of an `aref` node (i.e., `foo[:bar.each`), we can't put the block syntax inside the brackets.
|
573
|
+
- jakeprime, kddeisz - Values for the `return` keyword that broke the line were previously just printed as they were, which breaks if you have a block expression like an `if` or `while`. For example,
|
525
574
|
|
526
575
|
<!-- prettier-ignore -->
|
527
576
|
```ruby
|
@@ -552,7 +601,7 @@ return(
|
|
552
601
|
)
|
553
602
|
```
|
554
603
|
|
555
|
-
-
|
604
|
+
- jakeprime, kddeisz - When switching from a double-quoted string to a single-quoted string that contained escaped double quotes, the backslashes would stay in the string. As in:
|
556
605
|
|
557
606
|
<!-- prettier-ignore -->
|
558
607
|
```ruby
|
@@ -577,11 +626,11 @@ but now gets formatted as:
|
|
577
626
|
|
578
627
|
### Added
|
579
628
|
|
580
|
-
-
|
629
|
+
- kddeisz - Support for pattern matching for variables and array patterns. Currently waiting on Ripper support for hash patterns. For examples, check out the [test/js/patterns.test.js](test/js/patterns.test.js) file.
|
581
630
|
|
582
631
|
### Changed
|
583
632
|
|
584
|
-
-
|
633
|
+
- jviney, kddeisz - if/else blocks that had method calls on the end of them that were also transformed into ternaries need to have parens added to them. For example,
|
585
634
|
|
586
635
|
<!-- prettier-ignore -->
|
587
636
|
```ruby
|
@@ -599,8 +648,8 @@ now correctly gets transformed into:
|
|
599
648
|
(foo ? 1 : 2).to_s
|
600
649
|
```
|
601
650
|
|
602
|
-
-
|
603
|
-
-
|
651
|
+
- acrewdson, kddeisz - Fixed a bug where multiple newlines at the end of the file would cause a crash.
|
652
|
+
- jviney, kddeisz - If a variable is assigned inside of the predicate of a conditional, then we can't change it into the single-line version as this breaks. For example,
|
604
653
|
|
605
654
|
<!-- prettier-ignore -->
|
606
655
|
```ruby
|
@@ -615,11 +664,11 @@ must stay the same.
|
|
615
664
|
|
616
665
|
### Added
|
617
666
|
|
618
|
-
-
|
667
|
+
- kddeisz - Added `locStart` and `locEnd` functions to support `--cursor-offset`.
|
619
668
|
|
620
669
|
### Changed
|
621
670
|
|
622
|
-
-
|
671
|
+
- xipgroc, kddeisz - Comments inside of `do...end` blocks that preceeded `call` nodes were associating the comment with the `var_ref` instead of the `call` itself. For example,
|
623
672
|
|
624
673
|
<!-- prettier-ignore -->
|
625
674
|
```ruby
|
@@ -644,7 +693,7 @@ end
|
|
644
693
|
|
645
694
|
but now gets printed correctly.
|
646
695
|
|
647
|
-
-
|
696
|
+
- petevk, kddeisz - Double splats inside a hash were previously failing to print. For example,
|
648
697
|
|
649
698
|
<!-- prettier-ignore -->
|
650
699
|
```ruby
|
@@ -657,12 +706,12 @@ would fail to print, but now works.
|
|
657
706
|
|
658
707
|
### Changed
|
659
708
|
|
660
|
-
-
|
661
|
-
-
|
662
|
-
-
|
663
|
-
-
|
664
|
-
-
|
665
|
-
-
|
709
|
+
- kddeisz - Move arg, assign, constant, flow, massign, operator, scope, and statement nodes into their own files.
|
710
|
+
- kddeisz - Move `@int`, `access_ctrl`, `assocsplat`, `block_var`, `else`, `number_arg`, `super`, `undef`, `var_ref`, and `var_ref` as well as various call and symbol nodes into appropriate files.
|
711
|
+
- kddeisz - Better support for excessed commas in block args. Previously `proc { |x,| }` would add an extra space, but now it does not.
|
712
|
+
- kddeisz - Add a lot more documentation to the parser.
|
713
|
+
- glejeune, kddeisz - Previously, the unary `not` operator inside a ternary (e.g., `a ? not(b) : c`) would break because it wouldn't add parentheses, but now it adds them.
|
714
|
+
- kddeisz - `if` and `unless` nodes used to not be able to handle if a comment was the only statement in the body. For example,
|
666
715
|
|
667
716
|
<!-- prettier-ignore -->
|
668
717
|
```ruby
|
@@ -680,7 +729,7 @@ would get printed as
|
|
680
729
|
|
681
730
|
Now the `if` and `unless` printers check for the presence of single comments.
|
682
731
|
|
683
|
-
-
|
732
|
+
- JoshuaKGoldberg, kddeisz - Fixes an error where `command` nodes within `def` nodes would fail to format if it was only a single block argument. For example,
|
684
733
|
|
685
734
|
<!-- prettier-ignore -->
|
686
735
|
```ruby
|
@@ -691,7 +740,7 @@ end
|
|
691
740
|
|
692
741
|
would fail, but now works.
|
693
742
|
|
694
|
-
-
|
743
|
+
- xipgroc, kddeisz - Comments on lines with array references were previously deleting the array references entirely. For example,
|
695
744
|
|
696
745
|
<!-- prettier-ignore -->
|
697
746
|
```ruby
|
@@ -704,323 +753,323 @@ would previously result in `array[]`, but now prints properly.
|
|
704
753
|
|
705
754
|
### Changed
|
706
755
|
|
707
|
-
-
|
708
|
-
-
|
756
|
+
- kddeisz - When symbol literal hash keys end with `=`, they cannot be transformed into hash labels.
|
757
|
+
- xipgroc, kddeisz - Fixed when blocks on methods with no arguments are transformed into `to_proc` syntax.
|
709
758
|
|
710
759
|
## [0.12.1] - 2019-04-22
|
711
760
|
|
712
761
|
### Changed
|
713
762
|
|
714
|
-
-
|
715
|
-
-
|
716
|
-
-
|
763
|
+
- kddeisz - If a lambda literal is nested under a `command` or `command_call` node anywhere in the heirarchy, then it needs to use the higher-precedence `{ ... }` braces as opposed to the `do ... end` delimiters.
|
764
|
+
- jpickwell, kddeisz - Calling `super` with a block and no args was causing the parser to fail when attempting to inspect lambda nodes.
|
765
|
+
- kddeisz - Support better breaking within interpolation by grouping the interpolated content.
|
717
766
|
|
718
767
|
## [0.12.0] - 2019-04-18
|
719
768
|
|
720
769
|
### Added
|
721
770
|
|
722
|
-
-
|
771
|
+
- kddeisz - Automatically convert `lambda { ... }` method calls into `-> { ... }` literals.
|
723
772
|
|
724
773
|
## [0.11.0] - 2019-04-18
|
725
774
|
|
726
775
|
### Added
|
727
776
|
|
728
|
-
-
|
729
|
-
-
|
730
|
-
-
|
731
|
-
-
|
732
|
-
-
|
733
|
-
-
|
734
|
-
-
|
735
|
-
-
|
777
|
+
- kddeisz - Support for parsing things with a ruby shebang (e.g., `#!/usr/bin/env ruby` or `#!/usr/bin/ruby`).
|
778
|
+
- kddeisz - Big tests refactor.
|
779
|
+
- kddeisz - Make multiple `when` predicates break at 80 chars and then wrap to be inline with the other predicates.
|
780
|
+
- kddeisz - Automatically add underscores in large numbers that aren't already formatted.
|
781
|
+
- AlanFoster - Better support for inline access control modifiers.
|
782
|
+
- jpickwell, kddeisz - Better support for heredocs in hash literals.
|
783
|
+
- kddeisz - Better support for heredocs in array literals.
|
784
|
+
- kddeisz - Support automatically transforming `def/begin/rescue/end/end` into `def/rescue/end`.
|
736
785
|
|
737
786
|
### Changed
|
738
787
|
|
739
|
-
-
|
740
|
-
-
|
741
|
-
-
|
742
|
-
-
|
743
|
-
-
|
744
|
-
-
|
745
|
-
-
|
746
|
-
-
|
747
|
-
-
|
748
|
-
-
|
788
|
+
- deecewan - Fixed support for dynamic string hash keys.
|
789
|
+
- kddeisz - Moved `case/when` into its own file and added better documentation.
|
790
|
+
- kddeisz - Moved `begin/rescue` into its own file.
|
791
|
+
- AlanFoster - Automatically add newlines around access modifiers.
|
792
|
+
- kddeisz - Alignment of command calls with arguments is fixed.
|
793
|
+
- aaronjensen, kddeisz - Alignment of `to` is explicitly allowed to not indent to better support rspec.
|
794
|
+
- kddeisz - Fix up the `to_proc` transform so that it works with other argument handling appropriately.
|
795
|
+
- kddeisz - Fixed regression on regexp comments.
|
796
|
+
- CodingItWrong, kddeisz - Fix up block delimiters when nested inside a `command` or `command_call` node.
|
797
|
+
- kddeisz - Moved hashes into its own file.
|
749
798
|
|
750
799
|
## [0.10.0] - 2019-03-25
|
751
800
|
|
752
801
|
### Added
|
753
802
|
|
754
|
-
-
|
755
|
-
-
|
803
|
+
- kddeisz - Support for block-local variables.
|
804
|
+
- kddeisz - Support for dyna-symbols that are using single quotes.
|
756
805
|
|
757
806
|
### Changed
|
758
807
|
|
759
|
-
-
|
760
|
-
-
|
808
|
+
- kddeisz - Force method calls after arrays, blocks, hashes, and xstrings to hang onto the end of the previous nodes.
|
809
|
+
- kddeisz - Check before anything else for an invalid ruby version.
|
761
810
|
|
762
811
|
## [0.9.1] - 2019-03-24
|
763
812
|
|
764
813
|
### Changed
|
765
814
|
|
766
|
-
-
|
767
|
-
-
|
815
|
+
- kddeisz - Better support string quotes by favoring what the user chose if the string contains escape patterns.
|
816
|
+
- kddeisz - Better support heredocs within method calls.
|
768
817
|
|
769
818
|
## [0.9.0] - 2019-03-18
|
770
819
|
|
771
820
|
### Added
|
772
821
|
|
773
|
-
-
|
774
|
-
-
|
822
|
+
- kddeisz - Support the `hasPragma` function.
|
823
|
+
- kddeisz - Support the new `number_arg` node type in Ruby 2.7.
|
775
824
|
|
776
825
|
### Changed
|
777
826
|
|
778
|
-
-
|
827
|
+
- kddeisz - Limit the number of nodes that are allowed to turn into ternary expressions.
|
779
828
|
|
780
829
|
## [0.8.0] - 2019-03-08
|
781
830
|
|
782
831
|
### Added
|
783
832
|
|
784
|
-
-
|
785
|
-
-
|
786
|
-
-
|
787
|
-
-
|
833
|
+
- kddeisz - Add `eslint` and fix up existing violations.
|
834
|
+
- AlanFoster - Add the infra for the `prettier` ruby gem.
|
835
|
+
- kddeisz - Add a `rake` task for easier process integration for the ruby gem.
|
836
|
+
- kddeisz - Handle direct interpolation of strings with %w array literals (i.e., `["#{foo}"]` should not be transformed into a %w array).
|
788
837
|
|
789
838
|
### Changed
|
790
839
|
|
791
|
-
-
|
792
|
-
-
|
793
|
-
-
|
794
|
-
-
|
795
|
-
-
|
796
|
-
-
|
797
|
-
-
|
798
|
-
-
|
840
|
+
- kddeisz - Fix string escaping for hex digit bit patterns when there's only one character after the "x".
|
841
|
+
- AlanFoster - Don't allow line breaks between brace block params.
|
842
|
+
- johnschoeman - Switch over the array.rb test case to minitest.
|
843
|
+
- AlanFoster - Test improvements to allow running in parallel.
|
844
|
+
- johnschoeman - Switch over assign.rb test case to minitest.
|
845
|
+
- AlanFoster - Add a contributing guide.
|
846
|
+
- AlanFoster - Handle longer command nodes.
|
847
|
+
- kddeisz - Changed the ruby executable within the `prettier` gem to `rbprettier` for easier autocomplete.
|
799
848
|
|
800
849
|
### Removed
|
801
850
|
|
802
|
-
-
|
851
|
+
- kddeisz - All instances of the spread (`...`) operator so that we can support older versions of node.
|
803
852
|
|
804
853
|
## [0.7.0] - 2019-02-24
|
805
854
|
|
806
855
|
### Changed
|
807
856
|
|
808
|
-
-
|
809
|
-
-
|
810
|
-
-
|
811
|
-
-
|
812
|
-
-
|
813
|
-
-
|
814
|
-
-
|
815
|
-
-
|
816
|
-
-
|
817
|
-
-
|
818
|
-
-
|
819
|
-
-
|
820
|
-
-
|
821
|
-
-
|
822
|
-
-
|
823
|
-
-
|
857
|
+
- kddeisz - Support checking for escaping within strings to force double quotes (e.g., "\n").
|
858
|
+
- RossKinsella, kddeisz - Handle cases with empty class and module declarations that need to break.
|
859
|
+
- AlanFoster - Align the `bin/print` and `bin/sexp` APto support `bin/print` taking a filepath.
|
860
|
+
- AndrewRayCode, kddeisz - Support lambdas that don't break and are inline.
|
861
|
+
- AlanFoster - Switch over the numbers.rb test to minitest.
|
862
|
+
- AlanFoster - Switch over the kwargs.rb test to minitest.
|
863
|
+
- AlanFoster - Bail out early if the Ruby input is invalid.
|
864
|
+
- kddeisz - Support `__END__` content.
|
865
|
+
- AlanFoster - Fix up issue with whitespace being added within regexp that are multiline.
|
866
|
+
- AlanFoster - Better support for destructuring within multi assignment.
|
867
|
+
- kddeisz - Switch `next` test over to minitest.
|
868
|
+
- kddeisz - Handle multiple arguments to `next` with a space between.
|
869
|
+
- AndrewRayCode, kddeisz - Handle multi-line conditional predicate (should align with keyword).
|
870
|
+
- aaronjensen, kddeisz - Properly support adding trailing commas with and without blocks.
|
871
|
+
- AlanFoster, kddeisz - Fix regression of handling comments within arrays on array literals.
|
872
|
+
- AlanFoster - Support multiple arguments to `undef`.
|
824
873
|
|
825
874
|
## [0.6.3] - 2019-02-18
|
826
875
|
|
827
876
|
### Changed
|
828
877
|
|
829
|
-
-
|
830
|
-
-
|
831
|
-
-
|
832
|
-
-
|
878
|
+
- kddeisz - Switch over `binary` fixture to minitest.
|
879
|
+
- kddeisz - Reconfigure parser into multiple layer modules so that it's easier to understand and manage.
|
880
|
+
- kddeisz - Handle comments from within `begin`, `rescue`, `ensure`, `while`, and `until` nodes.
|
881
|
+
- kddeisz - Properly indent heredocs without taking into account current indentation level.
|
833
882
|
|
834
883
|
## [0.6.2] - 2019-02-17
|
835
884
|
|
836
885
|
### Changed
|
837
886
|
|
838
|
-
-
|
839
|
-
-
|
840
|
-
-
|
841
|
-
-
|
842
|
-
-
|
887
|
+
- AlanFoster - Handle regexp suffixes.
|
888
|
+
- kddeisz - Add support for testing the test fixtures with minitest.
|
889
|
+
- kddeisz - Switch over `alias` and `regexp` tests to minitest.
|
890
|
+
- aaronjensen, kddeisz - Break up method args to split into multiple lines.
|
891
|
+
- christoomey, kddeisz - Handle blocks args when trailing commas are on.
|
843
892
|
|
844
893
|
## [0.6.1] - 2019-02-15
|
845
894
|
|
846
895
|
### Changed
|
847
896
|
|
848
|
-
-
|
849
|
-
-
|
897
|
+
- meleyal, kddeisz - Fix Ruby 2.5 inline comments on `args_add_block` nodes.
|
898
|
+
- meleyal, kddeisz - Support passing `super()` explicitly with no arguments.
|
850
899
|
|
851
900
|
## [0.6.0] - 2019-02-14
|
852
901
|
|
853
902
|
### Added
|
854
903
|
|
855
|
-
-
|
856
|
-
-
|
857
|
-
-
|
858
|
-
-
|
859
|
-
-
|
904
|
+
- kddeisz - Handle non UTF-8 comments.
|
905
|
+
- kddeisz - Handle non UTF-8 identifiers.
|
906
|
+
- kddeisz - Handle non UTF-8 strings.
|
907
|
+
- kddeisz - Handle empty parens.
|
908
|
+
- kddeisz - Handle rescue with splats preceeding the exception names.
|
860
909
|
|
861
910
|
### Changed
|
862
911
|
|
863
|
-
-
|
864
|
-
-
|
912
|
+
- kddeisz - Use `JSON::fast_generate` to get the s-expressions back from the parser.
|
913
|
+
- NoahTheDuke, kddeisz - Handle broken lambdas from within `command` and `command_call` nodes.
|
865
914
|
|
866
915
|
## [0.5.2] - 2019-02-13
|
867
916
|
|
868
917
|
### Changed
|
869
918
|
|
870
|
-
-
|
919
|
+
- kddeisz - Support embedded expressions within strings that contain only keywords, as in `"#{super}"`.
|
871
920
|
|
872
921
|
## [0.5.1] - 2019-02-13
|
873
922
|
|
874
923
|
### Changed
|
875
924
|
|
876
|
-
-
|
877
|
-
-
|
878
|
-
-
|
925
|
+
- yuki24, kddeisz - Force `do` blocks that we know have to be `do` blocks to break.
|
926
|
+
- kmcq, kddeisz - Handle `command` and `command_call` nodes `do` blocks by forcing them to break.
|
927
|
+
- ashfurrow, kddeisz - Attach comments to full hash association nodes, not just the value.
|
879
928
|
|
880
929
|
## [0.5.0] - 2019-02-13
|
881
930
|
|
882
931
|
### Added
|
883
932
|
|
884
|
-
-
|
885
|
-
-
|
933
|
+
- kddeisz - Automatically convert arrays of all string literals to %w arrays.
|
934
|
+
- kddeisz - Automatically convert arrays of all symbol literals to %i arrays.
|
886
935
|
|
887
936
|
### Changed
|
888
937
|
|
889
|
-
-
|
890
|
-
-
|
891
|
-
-
|
938
|
+
- kddeisz - Move the `args_add` and `args_new` handling into the parser.
|
939
|
+
- uri, kddeisz - Change `command_call` nodes to properly indent when broken and to not add a trailing comma.
|
940
|
+
- kddeisz - Rename the `trailingComma` option to `addTrailingCommas` to not conflict with the JS option.
|
892
941
|
|
893
942
|
## [0.4.1] - 2019-02-12
|
894
943
|
|
895
944
|
### Changed
|
896
945
|
|
897
|
-
-
|
898
|
-
-
|
899
|
-
-
|
946
|
+
- kddeisz - Provide the `makeList` utility for the nodes that are lists from within ripper.
|
947
|
+
- awinograd, kddeisz - Again, this time for real, properly escape strings.
|
948
|
+
- kddeisz - Fix up trailing commas on command calls.
|
900
949
|
|
901
950
|
## [0.4.0] - 2019-02-12
|
902
951
|
|
903
952
|
### Added
|
904
953
|
|
905
|
-
-
|
954
|
+
- Overload119, kddeisz - Support the `trailingComma` configuration option (defaults to `false`).
|
906
955
|
|
907
956
|
### Changed
|
908
957
|
|
909
|
-
-
|
958
|
+
- NoahTheDuke, kddeisz - Pass the code to be formatted over `stdin`.
|
910
959
|
|
911
960
|
## [0.3.7] - 2019-02-11
|
912
961
|
|
913
962
|
### Changed
|
914
963
|
|
915
|
-
-
|
916
|
-
-
|
964
|
+
- kddeisz - Split up statements even if they started on the same line with `;`s unless they are within an embedded expression.
|
965
|
+
- kddeisz - Properly handle escaped quotes within strings.
|
917
966
|
|
918
967
|
## [0.3.6] - 2019-02-10
|
919
968
|
|
920
969
|
### Changed
|
921
970
|
|
922
|
-
-
|
923
|
-
-
|
971
|
+
- AlanFoster, kddeisz - Support the `not` operator properly.
|
972
|
+
- AlanFoster, kddeisz - Handle comments properly inside `if`, `unless`, and `when` nodes.
|
924
973
|
|
925
974
|
## [0.3.5] - 2019-02-09
|
926
975
|
|
927
976
|
### Changed
|
928
977
|
|
929
|
-
-
|
978
|
+
- kddeisz - Handle lonely operators in Ruby `2.5`.
|
930
979
|
|
931
980
|
## [0.3.4] - 2019-02-09
|
932
981
|
|
933
982
|
### Changed
|
934
983
|
|
935
|
-
-
|
936
|
-
-
|
937
|
-
-
|
938
|
-
-
|
939
|
-
-
|
940
|
-
-
|
984
|
+
- kddeisz - Comments are now properly attached inside `defs` nodes.
|
985
|
+
- kddeisz - Support multiple inline comments on nodes.
|
986
|
+
- kddeisz - Support inline comments from within the `EXPR_END|EXPR_LABEL` lexer state.
|
987
|
+
- cbothner - Stop transforming multistatement blocks with `to_proc`.
|
988
|
+
- kddeisz - `do` blocks necessarily need to break their parent nodes.
|
989
|
+
- eins78, kddeisz - Handle `next` node edge case with `args_add` as the body.
|
941
990
|
|
942
991
|
## [0.3.3] - 2019-02-09
|
943
992
|
|
944
993
|
### Changed
|
945
994
|
|
946
|
-
-
|
947
|
-
-
|
995
|
+
- bugthing, kddeisz - Command nodes within conditionals now break parents to disallow them from being turned into ternary expressions.
|
996
|
+
- awinograd, kddeisz - Properly escape double quotes when using `preferSingleQuotes: false`.
|
948
997
|
|
949
998
|
## [0.3.2] - 2019-02-09
|
950
999
|
|
951
1000
|
### Changed
|
952
1001
|
|
953
|
-
-
|
954
|
-
-
|
955
|
-
-
|
1002
|
+
- kddeisz - Don't define duplicated methods in the parser.
|
1003
|
+
- kddeisz - Let prettier know about `.rb` and `.rake` files so you don't have to specify the parser when running.
|
1004
|
+
- kddeisz - Renamed the package to @prettier/plugin-ruby.
|
956
1005
|
|
957
1006
|
## [0.3.1] - 2019-02-07
|
958
1007
|
|
959
1008
|
### Changed
|
960
1009
|
|
961
|
-
-
|
962
|
-
-
|
963
|
-
-
|
964
|
-
-
|
1010
|
+
- kddeisz - Automatically add parens to method declarations.
|
1011
|
+
- kddeisz - Handle comments on bare hash assocs.
|
1012
|
+
- kddeisz - Handle `method_add_block` nodes where the statements may be nested one more level.
|
1013
|
+
- kddeisz - Handle heredocs nested no matter how many levels deep.
|
965
1014
|
|
966
1015
|
## [0.3.0] - 2019-02-07
|
967
1016
|
|
968
1017
|
### Added
|
969
1018
|
|
970
|
-
-
|
971
|
-
-
|
1019
|
+
- kddeisz - Support squiggly heredocs.
|
1020
|
+
- kddeisz - Support straight heredocs.
|
972
1021
|
|
973
1022
|
### Changed
|
974
1023
|
|
975
|
-
-
|
976
|
-
-
|
977
|
-
-
|
978
|
-
-
|
979
|
-
-
|
980
|
-
-
|
1024
|
+
- kddeisz - Ignore current indentation when creating embdocs so that `=begin` is always at the beginning of the line.
|
1025
|
+
- kddeisz - Move `regexp_add` and `regexp_new` handling into the parser.
|
1026
|
+
- kddeisz - Move `xstring_add` and `xstring_new` handling into the parser.
|
1027
|
+
- kddeisz - Move `string_add` and `string_content` handling into the parser.
|
1028
|
+
- kddeisz - Move `mrhs_add` and `mrhs_new` handling into the parser.
|
1029
|
+
- kddeisz - Move `mlhs_add` and `mlhs_new` handling into the parser.
|
981
1030
|
|
982
1031
|
## [0.2.1] - 2019-02-06
|
983
1032
|
|
984
1033
|
### Changed
|
985
1034
|
|
986
|
-
-
|
987
|
-
-
|
988
|
-
-
|
1035
|
+
- kddeisz - Handle brace blocks on commands properly.
|
1036
|
+
- kddeisz - Break parent and return `do` blocks when called from a `command` node.
|
1037
|
+
- kddeisz - Handle edge cases with `if` statements where there is no body of the if (so it can't be converted to a ternary).
|
989
1038
|
|
990
1039
|
## [0.2.0] - 2019-02-06
|
991
1040
|
|
992
1041
|
### Added
|
993
1042
|
|
994
|
-
-
|
995
|
-
-
|
1043
|
+
- kddeisz - Handle `methref` nodes from Ruby `2.7`.
|
1044
|
+
- kddeisz - Allow `module` nodes to shorten using `;` when the block is empty.
|
996
1045
|
|
997
1046
|
### Changed
|
998
1047
|
|
999
|
-
-
|
1000
|
-
-
|
1001
|
-
-
|
1002
|
-
-
|
1003
|
-
-
|
1004
|
-
-
|
1005
|
-
-
|
1006
|
-
-
|
1007
|
-
-
|
1048
|
+
- kddeisz - Handle splat within an array, as in `[1, 2, *foo]`.
|
1049
|
+
- kddeisz - Disallow comments from being attached to intermediary regex nodes.
|
1050
|
+
- kddeisz - Fix `to_proc` transforms to reference the method called as opposed to the parameter name.
|
1051
|
+
- kddeisz - Change statement lists to be generated within the parser instead of the printer, thereby allowing finer control over comments.
|
1052
|
+
- kddeisz - Completely revamp comment parsing by switching off the internal lexer state from `ripper`. This should drastically increase accuracy of comment parsing in general, and set us up for success in the future.
|
1053
|
+
- kddeisz - Allow comments to be attached to `CHAR` nodes.
|
1054
|
+
- kddeisz - Disallow comments from being attached to `args_new` nodes.
|
1055
|
+
- kddeisz - Track start and end lines so we can better insert block comments.
|
1056
|
+
- kddeisz - Handle intermediary array nodes in the parse for better comment handling.
|
1008
1057
|
|
1009
1058
|
## [0.1.2] - 2019-02-05
|
1010
1059
|
|
1011
1060
|
### Changed
|
1012
1061
|
|
1013
|
-
-
|
1062
|
+
- kddeisz - Handle guard clauses that return with no parens.
|
1014
1063
|
|
1015
1064
|
## [0.1.1] - 2019-02-05
|
1016
1065
|
|
1017
1066
|
### Changed
|
1018
1067
|
|
1019
|
-
-
|
1020
|
-
-
|
1021
|
-
-
|
1022
|
-
-
|
1023
|
-
-
|
1068
|
+
- kddeisz - Handle class method calls with the `::` operator.
|
1069
|
+
- kddeisz - Handle strings with apostrophes when using `preferSingleQuote`.
|
1070
|
+
- kddeisz - Have travis run multiple ruby versions.
|
1071
|
+
- kddeisz - Explicitly fail if ruby version is < `2.5`.
|
1072
|
+
- kddeisz - Disallow comments from being attached to intermediary string nodes.
|
1024
1073
|
|
1025
1074
|
## [0.1.0] - 2019-02-04
|
1026
1075
|
|
@@ -1028,7 +1077,12 @@ would previously result in `array[]`, but now prints properly.
|
|
1028
1077
|
|
1029
1078
|
- Initial release 🎉
|
1030
1079
|
|
1031
|
-
[unreleased]: https://github.com/prettier/plugin-ruby/compare/v1.2
|
1080
|
+
[unreleased]: https://github.com/prettier/plugin-ruby/compare/v1.5.2...HEAD
|
1081
|
+
[1.5.2]: https://github.com/prettier/plugin-ruby/compare/v1.5.1...v1.5.2
|
1082
|
+
[1.5.1]: https://github.com/prettier/plugin-ruby/compare/v1.5.0...v1.5.1
|
1083
|
+
[1.5.0]: https://github.com/prettier/plugin-ruby/compare/v1.4.0...v1.5.0
|
1084
|
+
[1.4.0]: https://github.com/prettier/plugin-ruby/compare/v1.3.0...v1.4.0
|
1085
|
+
[1.3.0]: https://github.com/prettier/plugin-ruby/compare/v1.2.5...v1.3.0
|
1032
1086
|
[1.2.5]: https://github.com/prettier/plugin-ruby/compare/v1.2.4...v1.2.5
|
1033
1087
|
[1.2.4]: https://github.com/prettier/plugin-ruby/compare/v1.2.3...v1.2.4
|
1034
1088
|
[1.2.3]: https://github.com/prettier/plugin-ruby/compare/v1.2.2...v1.2.3
|
@@ -1087,71 +1141,3 @@ would previously result in `array[]`, but now prints properly.
|
|
1087
1141
|
[0.1.2]: https://github.com/prettier/plugin-ruby/compare/v0.1.1...v0.1.2
|
1088
1142
|
[0.1.1]: https://github.com/prettier/plugin-ruby/compare/v0.1.0...v0.1.1
|
1089
1143
|
[0.1.0]: https://github.com/prettier/plugin-ruby/compare/61f675...v0.1.0
|
1090
|
-
[@aaronjensen]: https://github.com/aaronjensen
|
1091
|
-
[@acrewdson]: https://github.com/acrewdson
|
1092
|
-
[@alanfoster]: https://github.com/AlanFoster
|
1093
|
-
[@alse]: https://github.com/alse
|
1094
|
-
[@andrewraycode]: https://github.com/AndrewRayCode
|
1095
|
-
[@andyw8]: https://github.com/andyw8
|
1096
|
-
[@ashfurrow]: https://github.com/ashfurrow
|
1097
|
-
[@awinograd]: https://github.com/awinograd
|
1098
|
-
[@blampe]: https://github.com/blampe
|
1099
|
-
[@bugthing]: https://github.com/bugthing
|
1100
|
-
[@cbothner]: https://github.com/cbothner
|
1101
|
-
[@christoomey]: https://github.com/christoomey
|
1102
|
-
[@cldevs]: https://github.com/cldevs
|
1103
|
-
[@codingitwrong]: https://github.com/CodingItWrong
|
1104
|
-
[@coiti]: https://github.com/coiti
|
1105
|
-
[@deecewan]: https://github.com/deecewan
|
1106
|
-
[@dudeofawesome]: https://github.com/dudeofawesome
|
1107
|
-
[@eins78]: https://github.com/eins78
|
1108
|
-
[@flyerhzm]: https://github.com/flyerhzm
|
1109
|
-
[@fruetel]: https://github.com/Fruetel
|
1110
|
-
[@ftes]: https://github.com/ftes
|
1111
|
-
[@gin0606]: https://github.com/gin0606
|
1112
|
-
[@github0013]: https://github.com/github0013
|
1113
|
-
[@glejeune]: https://github.com/glejeune
|
1114
|
-
[@hafley66]: https://github.com/hafley66
|
1115
|
-
[@ianks]: https://github.com/ianks
|
1116
|
-
[@jakeprime]: https://github.com/jakeprime
|
1117
|
-
[@jamescostian]: https://github.com/jamescostian
|
1118
|
-
[@janklimo]: https://github.com/janklimo
|
1119
|
-
[@jbielick]: https://github.com/jbielick
|
1120
|
-
[@joeyjoejoejr]: https://github.com/joeyjoejoejr
|
1121
|
-
[@johncsnyder]: https://github.com/johncsnyder
|
1122
|
-
[@johnschoeman]: https://github.com/johnschoeman
|
1123
|
-
[@joshuakgoldberg]: https://github.com/JoshuaKGoldberg
|
1124
|
-
[@jpickwell]: https://github.com/jpickwell
|
1125
|
-
[@jrdioko]: https://github.com/jrdioko
|
1126
|
-
[@jviney]: https://github.com/jviney
|
1127
|
-
[@karanmandal]: https://github.com/karanmandal
|
1128
|
-
[@kddeisz]: https://github.com/kddeisz
|
1129
|
-
[@kmcq]: https://github.com/kmcq
|
1130
|
-
[@krachtstefan]: https://github.com/krachtstefan
|
1131
|
-
[@localhostdotdev]: https://github.com/localhostdotdev
|
1132
|
-
[@lukyth]: https://github.com/lukyth
|
1133
|
-
[@marcmaniez]: https://github.com/MarcManiez
|
1134
|
-
[@masqita]: https://github.com/masqita
|
1135
|
-
[@matt-wratt]: https://github.com/matt-wratt
|
1136
|
-
[@meleyal]: https://github.com/meleyal
|
1137
|
-
[@mmainz]: https://github.com/mmainz
|
1138
|
-
[@mmcnl]: https://github.com/mmcnl
|
1139
|
-
[@nathan-beam]: https://github.com/nathan-beam
|
1140
|
-
[@noahtheduke]: https://github.com/NoahTheDuke
|
1141
|
-
[@nruth]: https://github.com/nruth
|
1142
|
-
[@overload119]: https://github.com/Overload119
|
1143
|
-
[@petevk]: https://github.com/petevk
|
1144
|
-
[@pje]: https://github.com/pje
|
1145
|
-
[@rafbm]: https://github.com/rafbm
|
1146
|
-
[@rindek]: https://github.com/rindek
|
1147
|
-
[@rosskinsella]: https://github.com/RossKinsella
|
1148
|
-
[@rsullivan00]: https://github.com/Rsullivan00
|
1149
|
-
[@ryan-hunter-pc]: https://github.com/ryan-hunter-pc
|
1150
|
-
[@shaydavidson]: https://github.com/ShayDavidson
|
1151
|
-
[@steobrien]: https://github.com/steobrien
|
1152
|
-
[@sviccari]: https://github.com/SViccari
|
1153
|
-
[@tobyndockerill]: https://github.com/tobyndockerill
|
1154
|
-
[@uri]: https://github.com/uri
|
1155
|
-
[@xipgroc]: https://github.com/xipgroc
|
1156
|
-
[@ykpythemind]: https://github.com/ykpythemind
|
1157
|
-
[@yuki24]: https://github.com/yuki24
|