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