File tree 5 files changed +25
-5
lines changed 5 files changed +25
-5
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
6
6
7
7
## [ Unreleased]
8
8
9
+ ## [ 1.2.1] - 2023-03-09
10
+
11
+ ### Changed
12
+
13
+ - Fixed a bug where having line suffixes on the final line without a breakable could cause an infinite loop.
14
+
9
15
## [ 1.2.0] - 2022-12-23
10
16
11
17
### Added
@@ -55,7 +61,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
55
61
56
62
- 🎉 Initial release! 🎉
57
63
58
- [ unreleased ] : https://github.com/ruby-syntax-tree/prettier_print/compare/v1.2.0...HEAD
64
+ [ unreleased ] : https://github.com/ruby-syntax-tree/prettier_print/compare/v1.2.1...HEAD
65
+ [ 1.2.1 ] : https://github.com/ruby-syntax-tree/prettier_print/compare/v1.2.0...v1.2.1
59
66
[ 1.2.0 ] : https://github.com/ruby-syntax-tree/prettier_print/compare/v1.1.0...v1.2.0
60
67
[ 1.1.0 ] : https://github.com/ruby-syntax-tree/prettier_print/compare/v1.0.2...v1.1.0
61
68
[ 1.0.2 ] : https://github.com/ruby-syntax-tree/prettier_print/compare/v1.0.1...v1.0.2
Original file line number Diff line number Diff line change 1
1
PATH
2
2
remote: .
3
3
specs:
4
- prettier_print (1.2.0 )
4
+ prettier_print (1.2.1 )
5
5
6
6
GEM
7
7
remote: https://rubygems.org/
20
20
21
21
PLATFORMS
22
22
arm64-darwin-21
23
+ arm64-darwin-22
23
24
x86_64-darwin-21
24
25
x86_64-linux
25
26
Original file line number Diff line number Diff line change @@ -616,8 +616,11 @@ def flush(base_indentation = DEFAULT_INDENTATION)
616
616
end
617
617
618
618
if commands . empty? && line_suffixes . any?
619
- commands += line_suffixes . sort_by ( &line_suffix_sort )
620
- line_suffixes = [ ]
619
+ line_suffixes . sort_by ( &line_suffix_sort ) . each do |( indent , mode , doc ) |
620
+ commands += doc . contents . reverse . map { |part | [ indent , mode , part ] }
621
+ end
622
+
623
+ line_suffixes . clear
621
624
end
622
625
end
623
626
Original file line number Diff line number Diff line change 1
1
# frozen_string_literal: true
2
2
3
3
class PrettierPrint
4
- VERSION = "1.2.0 "
4
+ VERSION = "1.2.1 "
5
5
end
Original file line number Diff line number Diff line change @@ -152,6 +152,15 @@ class PrettierPrintTest < Test::Unit::TestCase
152
152
assert_equal "content # suffix\n " , result
153
153
end
154
154
155
+ test "PrettierPrint#line_suffix without a break" do
156
+ result =
157
+ PrettierPrint . format do |q |
158
+ q . line_suffix { q . text ( "# suffix" ) }
159
+ end
160
+
161
+ assert_equal "# suffix" , result
162
+ end
163
+
155
164
test "PrettierPrint#trim" do
156
165
result =
157
166
PrettierPrint . format do |q |
You can’t perform that action at this time.
0 commit comments