Skip to content

Commit

Permalink
fix an issue rendering multi-line changelogs (#171)
Browse files Browse the repository at this point in the history
  • Loading branch information
devoncarew authored Sep 14, 2023
1 parent babf5d1 commit b3dc96f
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 3 deletions.
4 changes: 4 additions & 0 deletions pkgs/firehose/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.3.29

- Fix an issue rendering longer changelogs (#170).

## 0.3.28

- Fix [#156](https://github.com/dart-lang/ecosystem/issues/156).
Expand Down
2 changes: 1 addition & 1 deletion pkgs/firehose/lib/src/changelog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class Changelog {
return sections;
}

String get describeLatestChanges => latestChangeEntries.join();
String get describeLatestChanges => latestChangeEntries.join('\n');
}

class _Section {
Expand Down
4 changes: 2 additions & 2 deletions pkgs/firehose/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: firehose
description: A tool to automate publishing of Pub packages from GitHub actions.
version: 0.3.28
version: 0.3.29
repository: https://github.com/dart-lang/ecosystem/tree/main/pkgs/firehose

environment:
Expand All @@ -20,5 +20,5 @@ dependencies:
yaml: ^3.1.0

dev_dependencies:
dart_flutter_team_lints: ^1.0.0
dart_flutter_team_lints: ^2.0.0
test: ^1.21.0
21 changes: 21 additions & 0 deletions pkgs/firehose/test/changelog_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,16 @@ void main() {
});
});

test('describeLatestChanges', () {
withChangelog(_multiLineContents, (file) {
var changelog = Changelog(file);
var description = changelog.describeLatestChanges;
expect(description, '''
- Fix issue 1.
- Fix issue 2.''');
});
});

test('no recent entries', () {
withChangelog('''
## 0.2.0-dev
Expand Down Expand Up @@ -169,3 +179,14 @@ const _defaultContents = '''
- Provide feedback about publishing status as PR comments.
''';

const _multiLineContents = '''
## 0.3.6
- Fix issue 1.
- Fix issue 2.
## 0.3.5
- Provide feedback about publishing status as PR comments.
''';

0 comments on commit b3dc96f

Please sign in to comment.