Skip to content

Commit 8c2afdb

Browse files
committed
Soft-wrap hard-wrapped comments in helper/release_notes_helper.rb
Use a longer line length and prefer semantic line breaks to hard-wraps. See #342 (comment)
1 parent cba2afd commit 8c2afdb

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/fastlane/plugin/wpmreleasetoolkit/helper/release_notes_helper.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@ module ReleaseNotesHelper
99
def self.add_new_section(path:, section_title:)
1010
lines = File.readlines(path)
1111

12-
# Find the index of the first non-empty line that is also NOT a comment. That way we keep commment headers as the very top of the file
12+
# Find the index of the first non-empty line that is also NOT a comment.
13+
# That way we keep commment headers as the very top of the file
1314
line_idx = lines.find_index { |l| !l.start_with?('***') && !l.start_with?('//') && !l.chomp.empty? }
14-
# Put back the header, then the new entry, then the rest (note: '...' excludes the higher bound of the range, unlike '..')
15+
# Put back the header, then the new entry, then the rest
16+
# (note: '...' excludes the higher bound of the range, unlike '..')
1517
new_lines = lines[0...line_idx] + ["#{section_title}\n", "-----\n", "\n", "\n"] + lines[line_idx..]
1618

1719
File.write(path, new_lines.join)

0 commit comments

Comments
 (0)