Skip to content

Commit

Permalink
0.7.4 (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
f3ath authored Sep 24, 2024
1 parent dcdb64e commit c79d251
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 15 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Changelog
This project follows [Semantic Versioning 2.0.0](https://semver.org/spec/v2.0.0.html).

## [0.7.4] - 2024-09-23
### Changed
- Minor cleanup

## [0.7.3] - 2024-02-04
### Changed
- Bump depenencies
Expand Down Expand Up @@ -130,6 +134,7 @@ This project follows [Semantic Versioning 2.0.0](https://semver.org/spec/v2.0.0.
- Parsing from markdown
- Writing to markdown

[0.7.4]: https://github.com/f3ath/change/compare/0.7.3...0.7.4
[0.7.3]: https://github.com/f3ath/change/compare/0.7.2...0.7.3
[0.7.2]: https://github.com/f3ath/change/compare/0.7.1...0.7.2
[0.7.1]: https://github.com/f3ath/change/compare/0.7.0...0.7.1
Expand Down
11 changes: 3 additions & 8 deletions lib/src/changelog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@ class Changelog {
final unreleased = Section();

/// All releases in chronological order (oldest first)
Iterable<Release> history() {
final releases = _releases.values.toList();
releases.sort();
return releases;
}
Iterable<Release> history() => _releases.values.toList()..sort();

/// Returns the release by version or throws [StateError]
Release get(String version) =>
Expand All @@ -38,9 +34,8 @@ class Changelog {

/// Returns the release which immediately precedes the [version]
Release? preceding(Version version) {
final older = history().where((r) => r.version < version).toList();
if (older.isNotEmpty) return older.last;
return null;
final older = history().where((r) => r.version < version);
return older.isEmpty ? null : older.last;
}

String _normalize(String version) => version.trim().toLowerCase();
Expand Down
2 changes: 1 addition & 1 deletion lib/src/parser.dart
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ void _parseInto(Section section, Iterable<Node> nodes) {
} else if (node.tag == 'ul') {
node.children!
.whereType<Element>()
.map((node) => Change(type, node.children!))
.map((it) => Change(type, it.children!))
.forEach(section.add);
}
}
Expand Down
6 changes: 2 additions & 4 deletions lib/src/section.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@ class Section {
String link = '';

/// Changes in the change set, optionally filtered by [type]
Iterable<Change> changes({String? type}) {
if (type == null) return _changes;
return _changes.where((_) => _.type == type);
}
Iterable<Change> changes({String? type}) =>
type == null ? _changes : _changes.where((it) => it.type == type);

/// Adds a change to the change set
void add(Change change) {
Expand Down
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: change
version: 0.7.3
version: 0.7.4
description: A Changelog manipulation library. Read/modify/write your CHANGELOG.md. Inspired by keepachangelog.com.
homepage: "https://github.com/f3ath/change"

Expand All @@ -13,7 +13,7 @@ dependencies:
intl: ^0.19.0

dev_dependencies:
lints: ^3.0.0
lints: ^4.0.0
test: ^1.21.1
coverage: ^1.2.0
check_coverage: ^0.0.4
Expand Down

0 comments on commit c79d251

Please sign in to comment.