prettier 0.12.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: e5c497d3b03fb7fff00e144eeb766f83e8f14908836d01246d9525582572c50e
4
+ data.tar.gz: f941eb2e4b5739e01dc082b6ba215950835b8208c73f86481dec3ea3f5f036cb
5
+ SHA512:
6
+ metadata.gz: 884ce77a4f9b37979701b1e0cd8c99f97b49905b469b4acc7929284a0c48cc378b3f900656c885955e99ab0475dfef673123d4f7dc6fd937461c6430de7a7753
7
+ data.tar.gz: 30fae9b3033f03f708be4d82508e6be78cfc25f48cb47b8a90e27f165b29ba21154cdcbf943811cc1801b08ef085fceccb28deea7d79d92f8ee026ff310e41d5
@@ -0,0 +1,368 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
6
+
7
+ ## [Unreleased]
8
+
9
+ ## [0.12.2] - 2019-04-30
10
+
11
+ ### Changed
12
+
13
+ - When symbol literal hash keys end with `=`, they cannot be transformed into hash labels.
14
+ - Fixed when blocks on methods with no arguments are transformed into `to_proc` syntax. (Thanks to @xipgroc for the report.)
15
+
16
+ ## [0.12.1] - 2019-04-22
17
+
18
+ ### Changed
19
+
20
+ - 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.
21
+ - Calling `super` with a block and no args was causing the parser to fail when attempting to inspect lambda nodes. (Thanks to @jpickwell for the report.)
22
+ - Support better breaking within interpolation by grouping the interpolated content.
23
+
24
+ ## [0.12.0] - 2019-04-18
25
+
26
+ ### Added
27
+
28
+ - Automatically convert `lambda { ... }` method calls into `-> { ... }` literals.
29
+
30
+ ## [0.11.0] - 2019-04-18
31
+
32
+ ### Added
33
+
34
+ - Support for parsing things with a ruby shebang (e.g., `#!/usr/bin/env ruby` or `#!/usr/bin/ruby`).
35
+ - [INTERNAL] Big tests refactor.
36
+ - Make multiple `when` predicates break at 80 chars and then wrap to be inline with the other predicates.
37
+ - Automatically add underscores in large numbers that aren't already formatted.
38
+ - Better support for inline access control modifiers. (Thanks for @AlanFoster.)
39
+ - Better support for heredocs in hash literals. (Thanks to @jpickwell for the report.)
40
+ - Better support for heredocs in array literals.
41
+ - Support automatically transforming `def/begin/rescue/end/end` into `def/rescue/end`.
42
+
43
+ ### Changed
44
+
45
+ - Fixed support for dynamic string hash keys. (Thanks to @deecewan.)
46
+ - [INTERNAL] Moved `case/when` into its own file and added better documentation.
47
+ - [INTERNAL] Moved `begin/rescue` into its own file.
48
+ - Automatically add newlines around access modifiers. (Thanks for @AlanFoster.)
49
+ - Alignment of command calls with arguments is fixed.
50
+ - Alignment of `to` is explicitly allowed to not indent to better support rspec. (Thanks to @aaronjensen for the report.)
51
+ - Fix up the `to_proc` transform so that it works with other argument handling appropriately.
52
+ - Fixed regression on regexp comments.
53
+ - Fix up block delimiters when nested inside a `command` or `command_call` node. (Thanks to @CodingItWrong for the report.)
54
+ - [INTERNAL] Moved hashes into its own file.
55
+
56
+ ## [0.10.0] - 2019-03-25
57
+
58
+ ### Added
59
+
60
+ - Support for block-local variables.
61
+ - Support for dyna-symbols that are using single quotes.
62
+
63
+ ### Changed
64
+
65
+ - Force method calls after arrays, blocks, hashes, and xstrings to hang onto the end of the previous nodes.
66
+ - Check before anything else for an invalid ruby version.
67
+
68
+ ## [0.9.1] - 2019-03-24
69
+
70
+ ### Changed
71
+
72
+ - Better support string quotes by favoring what the user chose if the string contains escape patterns.
73
+ - Better support heredocs within method calls.
74
+
75
+ ## [0.9.0] - 2019-03-18
76
+
77
+ ### Added
78
+
79
+ - Support the `hasPragma` function.
80
+ - Support the new `number_arg` node type in Ruby 2.7.
81
+
82
+ ### Changed
83
+
84
+ - Limit the number of nodes that are allowed to turn into ternary expressions.
85
+
86
+ ## [0.8.0] - 2019-03-08
87
+
88
+ ### Added
89
+
90
+ - [INTERNAL] Add `eslint` and fix up existing violations.
91
+ - Add the infra for the `prettier` ruby gem. (Thanks to @AlanFoster.)
92
+ - Add a `rake` task for easier process integration for the ruby gem.
93
+ - Handle direct interpolation of strings with %w array literals (i.e., `["#{foo}"]` should not be transformed into a %w array).
94
+
95
+ ### Changed
96
+
97
+ - Fix string escaping for hex digit bit patterns when there's only one character after the "x".
98
+ - Don't allow line breaks between brace block params. (Thanks to @AlanFoster.)
99
+ - [INTERNAL] Switch over the array.rb test case to minitest. (Thanks to @johnschoeman.)
100
+ - [INTERNAL] Test improvements to allow running in parallel. (Thanks to @AlanFoster.)
101
+ - [INTERNAL] Switch over assign.rb test case to minitest. (Thanks to @johnschoeman.)
102
+ - [INTERNAL] Add a contributing guide. (Thanks to @AlanFoster.)
103
+ - Handle longer command nodes. (Thanks to @AlanFoster.)
104
+ - Changed the ruby executable within the `prettier` gem to `rbprettier` for easier autocomplete.
105
+
106
+ ### Removed
107
+
108
+ - All instances of the spread (`...`) operator so that we can support older versions of node.
109
+
110
+ ## [0.7.0] - 2019-02-24
111
+
112
+ ### Changed
113
+
114
+ - Support checking for escaping within strings to force double quotes (e.g., "\n").
115
+ - Handle cases with empty class and module declarations that need to break. (Thanks to @RossKinsella for the report.)
116
+ - [INTERNAL] Align the `bin/print` and `bin/sexp` API to support `bin/print` taking a filepath. (Thanks to @AlanFoster.)
117
+ - Support lambdas that don't break and are inline. (Thanks to @AndrewRayCode for the report.)
118
+ - [INTERNAL] Switch over the numbers.rb test to minitest. (Thanks to @AlanFoster.)
119
+ - [INTERNAL] Switch over the kwargs.rb test to minitest. (Thanks to @AlanFoster.)
120
+ - [INTERNAL] Bail out early if the Ruby input is invalid. (Thanks to @AlanFoster.)
121
+ - Support `__END__` content.
122
+ - Fix up issue with whitespace being added within regexp that are multiline. (Thanks to @AlanFoster.)
123
+ - Better support for destructuring within multi assignment. (Thanks to @AlanFoster.)
124
+ - [INTERNAL] Switch `next` test over to minitest.
125
+ - Handle multiple arguments to `next` with a space between.
126
+ - Handle multi-line conditional predicate (should align with keyword). (Thanks to @AndrewRayCode for the report.)
127
+ - Properly support adding trailing commas with and without blocks. (Thanks to @aaronjensen for the report.)
128
+ - Fix regression of handling comments within arrays on array literals. (Thanks to @AlanFoster for the report.)
129
+ - Support multiple arguments to `undef`. (Thanks to @AlanFoster.)
130
+
131
+ ## [0.6.3] - 2019-02-18
132
+
133
+ ### Changed
134
+
135
+ - [INTERNAL] Switch over `binary` fixture to minitest.
136
+ - [INTERNAL] Reconfigure parser into multiple layer modules so that it's easier to understand and manage.
137
+ - Handle comments from within `begin`, `rescue`, `ensure`, `while`, and `until` nodes.
138
+ - Properly indent heredocs without taking into account current indentation level.
139
+
140
+ ## [0.6.2] - 2019-02-17
141
+
142
+ ### Changed
143
+
144
+ - Handle regexp suffixes. (Thanks to @AlanFoster.)
145
+ - [INTERNAL] Add support for testing the test fixtures with minitest.
146
+ - [INTERNAL] Switch over `alias` and `regexp` tests to minitest.
147
+ - Break up method args to split into multiple lines. (Thanks to @aaronjensen for the report.)
148
+ - Handle blocks args when trailing commas are on. (Thanks to @christoomey for the report.)
149
+
150
+ ## [0.6.1] - 2019-02-15
151
+
152
+ ### Changed
153
+
154
+ - Fix Ruby 2.5 inline comments on `args_add_block` nodes. (Thanks to @meleyal for the report.)
155
+ - Support passing `super()` explicitly with no arguments. (Thanks to @meleyal for the report.)
156
+
157
+ ## [0.6.0] - 2019-02-14
158
+
159
+ ### Added
160
+
161
+ - Handle non UTF-8 comments.
162
+ - Handle non UTF-8 identifiers.
163
+ - Handle non UTF-8 strings.
164
+ - Handle empty parens.
165
+ - Handle rescue with splats preceeding the exception names.
166
+
167
+ ### Changed
168
+
169
+ - Use `JSON::fast_generate` to get the s-expressions back from the parser.
170
+ - Handle broken lambdas from within `command` and `command_call` nodes. (Thanks to @NoahTheDuke for the report.)
171
+
172
+ ## [0.5.2] - 2019-02-13
173
+
174
+ ### Changed
175
+
176
+ - Support embedded expressions within strings that contain only keywords, as in `"#{super}"`.
177
+
178
+ ## [0.5.1] - 2019-02-13
179
+
180
+ ### Changed
181
+
182
+ - Force `do` blocks that we know have to be `do` blocks to break. (Thanks to @yuki24 for the report.)
183
+ - Handle `command` and `command_call` nodes `do` blocks by forcing them to break. (Thanks to @kmcq for the report.)
184
+ - Attach comments to full hash association nodes, not just the value. (Thanks to @ashfurrow for the report.)
185
+
186
+ ## [0.5.0] - 2019-02-13
187
+
188
+ ### Added
189
+
190
+ - Automatically convert arrays of all string literals to %w arrays.
191
+ - Automatically convert arrays of all symbol literals to %i arrays.
192
+
193
+ ### Changed
194
+
195
+ - [INTERNAL] Move the `args_add` and `args_new` handling into the parser.
196
+ - Change `command_call` nodes to properly indent when broken and to not add a trailing comma. (Thanks to @uri for the report.)
197
+ - Rename the `trailingComma` option to `addTrailingCommas` to not conflict with the JS option.
198
+
199
+ ## [0.4.1] - 2019-02-12
200
+
201
+ ### Changed
202
+
203
+ - [INTERNAL] Provide the `makeList` utility for the nodes that are lists from within ripper.
204
+ - Again, this time for real, properly escape strings. (Thanks to @awinograd for the report.)
205
+ - Fix up trailing commas on command calls.
206
+
207
+ ## [0.4.0] - 2019-02-12
208
+
209
+ ### Added
210
+
211
+ - Support the `trailingComma` configuration option (defaults to `false`). (Thanks to @Overload119 for the request.)
212
+
213
+ ### Changed
214
+
215
+ - Pass the code to be formatted over `stdin`. (Thanks to @NoahTheDuke for the report.)
216
+
217
+ ## [0.3.7] - 2019-02-11
218
+
219
+ ### Changed
220
+
221
+ - Split up statements even if they started on the same line with `;`s unless they are within an embedded expression.
222
+ - Properly handle escaped quotes within strings.
223
+
224
+ ## [0.3.6] - 2019-02-10
225
+
226
+ ### Changed
227
+
228
+ - Support the `not` operator properly. (Thanks to @AlanFoster for the report.)
229
+ - Handle comments properly inside `if`, `unless`, and `when` nodes. (Thanks to @AlanFoster for the report.)
230
+
231
+ ## [0.3.5] - 2019-02-09
232
+
233
+ ### Changed
234
+
235
+ - Handle lonely operators in Ruby `2.5`.
236
+
237
+ ## [0.3.4] - 2019-02-09
238
+
239
+ ### Changed
240
+
241
+ - Comments are now properly attached inside `defs` nodes.
242
+ - Support multiple inline comments on nodes.
243
+ - Support inline comments from within the `EXPR_END|EXPR_LABEL` lexer state.
244
+ - Stop transforming multistatement blocks with `to_proc`. (Thanks to @cbothner.)
245
+ - `do` blocks necessarily need to break their parent nodes.
246
+ - Handle `next` node edge case with `args_add` as the body. (Thanks to @eins78 for the report.)
247
+
248
+ ## [0.3.3] - 2019-02-09
249
+
250
+ ### Changed
251
+
252
+ - Command nodes within conditionals now break parents to disallow them from being turned into ternary expressions. (Thanks to @bugthing for the report.)
253
+ - Properly escape double quotes when using `preferSingleQuotes: false`. (Thanks to @awinograd for the report.)
254
+
255
+ ## [0.3.2] - 2019-02-09
256
+
257
+ ### Changed
258
+
259
+ - [INTERNAL] Don't define duplicated methods in the parser.
260
+ - Let prettier know about `.rb` and `.rake` files so you don't have to specify the parser when running.
261
+ - Renamed the package to @prettier/plugin-ruby.
262
+
263
+ ## [0.3.1] - 2019-02-07
264
+
265
+ ### Changed
266
+
267
+ - Automatically add parens to method declarations.
268
+ - Handle comments on bare hash assocs.
269
+ - Handle `method_add_block` nodes where the statements may be nested one more level.
270
+ - Handle heredocs nested no matter how many levels deep.
271
+
272
+ ## [0.3.0] - 2019-02-07
273
+
274
+ ### Added
275
+
276
+ - Support squiggly heredocs.
277
+ - Support straight heredocs.
278
+
279
+ ### Changed
280
+
281
+ - Ignore current indentation when creating embdocs so that `=begin` is always at the beginning of the line.
282
+ - [INTERNAL] Move `regexp_add` and `regexp_new` handling into the parser.
283
+ - [INTERNAL] Move `xstring_add` and `xstring_new` handling into the parser.
284
+ - [INTERNAL] Move `string_add` and `string_content` handling into the parser.
285
+ - [INTERNAL] Move `mrhs_add` and `mrhs_new` handling into the parser.
286
+ - [INTERNAL] Move `mlhs_add` and `mlhs_new` handling into the parser.
287
+
288
+ ## [0.2.1] - 2019-02-06
289
+
290
+ ### Changed
291
+
292
+ - Handle brace blocks on commands properly.
293
+ - Break parent and return `do` blocks when called from a `command` node.
294
+ - Handle edge cases with `if` statements where there is no body of the if (so it can't be converted to a ternary).
295
+
296
+ ## [0.2.0] - 2019-02-06
297
+
298
+ ### Added
299
+
300
+ - Handle `methref` nodes from Ruby `2.7`.
301
+ - Allow `module` nodes to shorten using `;` when the block is empty.
302
+
303
+ ### Changed
304
+
305
+ - Handle splat within an array, as in `[1, 2, *foo]`.
306
+ - Disallow comments from being attached to intermediary regex nodes.
307
+ - Fix `to_proc` transforms to reference the method called as opposed to the parameter name.
308
+ - [INTERNAL] Change statement lists to be generated within the parser instead of the printer, thereby allowing finer control over comments.
309
+ - [INTERNAL] 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.
310
+ - Allow comments to be attached to `CHAR` nodes.
311
+ - [INTERNAL] Disallow comments from being attached to `args_new` nodes.
312
+ - [INTERNAL] Track start and end lines so we can better insert block comments.
313
+ - [INTERNAL] Handle intermediary array nodes in the parse for better comment handling.
314
+
315
+ ## [0.1.2] - 2019-02-05
316
+
317
+ ### Changed
318
+
319
+ - Handle guard clauses that return with no parens.
320
+
321
+ ## [0.1.1] - 2019-02-05
322
+
323
+ ### Changed
324
+
325
+ - Handle class method calls with the `::` operator.
326
+ - Handle strings with apostrophes when using `preferSingleQuote`.
327
+ - [INTERAL] Have travis run multiple ruby versions.
328
+ - Explicitly fail if ruby version is < `2.5`.
329
+ - Disallow comments from being attached to intermediary string nodes.
330
+
331
+ ## [0.1.0] - 2019-02-04
332
+
333
+ ### Added
334
+
335
+ - Initial release 🎉
336
+
337
+ [unreleased]: https://github.com/prettier/plugin-ruby/compare/v0.12.2...HEAD
338
+ [0.12.2]: https://github.com/prettier/plugin-ruby/compare/v0.12.1...v0.12.2
339
+ [0.12.1]: https://github.com/prettier/plugin-ruby/compare/v0.12.0...v0.12.1
340
+ [0.12.0]: https://github.com/prettier/plugin-ruby/compare/v0.11.0...v0.12.0
341
+ [0.11.0]: https://github.com/prettier/plugin-ruby/compare/v0.10.0...v0.11.0
342
+ [0.10.0]: https://github.com/prettier/plugin-ruby/compare/v0.9.1...v0.10.0
343
+ [0.9.1]: https://github.com/prettier/plugin-ruby/compare/v0.9.0...v0.9.1
344
+ [0.9.0]: https://github.com/prettier/plugin-ruby/compare/v0.8.0...v0.9.0
345
+ [0.8.0]: https://github.com/prettier/plugin-ruby/compare/v0.7.0...v0.8.0
346
+ [0.7.0]: https://github.com/prettier/plugin-ruby/compare/v0.6.3...v0.7.0
347
+ [0.6.3]: https://github.com/prettier/plugin-ruby/compare/v0.6.2...v0.6.3
348
+ [0.6.2]: https://github.com/prettier/plugin-ruby/compare/v0.6.1...v0.6.2
349
+ [0.6.1]: https://github.com/prettier/plugin-ruby/compare/v0.6.0...v0.6.1
350
+ [0.6.0]: https://github.com/prettier/plugin-ruby/compare/v0.5.2...v0.6.0
351
+ [0.5.2]: https://github.com/prettier/plugin-ruby/compare/v0.5.1...v0.5.2
352
+ [0.5.1]: https://github.com/prettier/plugin-ruby/compare/v0.5.0...v0.5.1
353
+ [0.5.0]: https://github.com/prettier/plugin-ruby/compare/v0.4.1...v0.5.0
354
+ [0.4.1]: https://github.com/prettier/plugin-ruby/compare/v0.4.0...v0.4.1
355
+ [0.4.0]: https://github.com/prettier/plugin-ruby/compare/v0.3.7...v0.4.0
356
+ [0.3.7]: https://github.com/prettier/plugin-ruby/compare/v0.3.6...v0.3.7
357
+ [0.3.6]: https://github.com/prettier/plugin-ruby/compare/v0.3.5...v0.3.6
358
+ [0.3.5]: https://github.com/prettier/plugin-ruby/compare/v0.3.4...v0.3.5
359
+ [0.3.4]: https://github.com/prettier/plugin-ruby/compare/v0.3.3...v0.3.4
360
+ [0.3.3]: https://github.com/prettier/plugin-ruby/compare/v0.3.2...v0.3.3
361
+ [0.3.2]: https://github.com/prettier/plugin-ruby/compare/v0.3.1...v0.3.2
362
+ [0.3.1]: https://github.com/prettier/plugin-ruby/compare/v0.3.0...v0.3.1
363
+ [0.3.0]: https://github.com/prettier/plugin-ruby/compare/v0.2.1...v0.3.0
364
+ [0.2.1]: https://github.com/prettier/plugin-ruby/compare/v0.2.0...v0.2.1
365
+ [0.2.0]: https://github.com/prettier/plugin-ruby/compare/v0.1.2...v0.2.0
366
+ [0.1.2]: https://github.com/prettier/plugin-ruby/compare/v0.1.1...v0.1.2
367
+ [0.1.1]: https://github.com/prettier/plugin-ruby/compare/v0.1.0...v0.1.1
368
+ [0.1.0]: https://github.com/prettier/plugin-ruby/compare/61f675...v0.1.0
@@ -0,0 +1,76 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, sex characteristics, gender identity and expression,
9
+ level of experience, education, socio-economic status, nationality, personal
10
+ appearance, race, religion, or sexual identity and orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ - Using welcoming and inclusive language
18
+ - Being respectful of differing viewpoints and experiences
19
+ - Gracefully accepting constructive criticism
20
+ - Focusing on what is best for the community
21
+ - Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ - The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ - Trolling, insulting/derogatory comments, and personal or political attacks
28
+ - Public or private harassment
29
+ - Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ - Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at prettier-contact@googlegroups.com. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72
+
73
+ [homepage]: https://www.contributor-covenant.org
74
+
75
+ For answers to common questions about this code of conduct, see
76
+ https://www.contributor-covenant.org/faq