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