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