Skip to content

Commit

Permalink
Prepare release 1.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Ephenodrom committed Feb 6, 2024
1 parent 5487684 commit 0575916
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 1.3.0

- Remove %b in format.

## 1.2.0

- Add new parameter "noMerges"
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ The allowed values:
- **%cd**: Committer date (default format).
- **%cr**: Committer date, relative.
- **%s**: Subject (commit message).
- **%b**: Body (commit message).

> [!NOTE]
> The allowed values are basically the same as you can use in **git log** except the new line %N.
Expand Down
5 changes: 1 addition & 4 deletions bin/src/format_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,6 @@ class FormatCommand extends Command {
case "cr":
formattedLine = formattedLine.replaceAll("%cr", m["cr"] ?? "NULL");
break;
case "b":
formattedLine = formattedLine.replaceAll("%b", m["b"] ?? "NULL");
break;
}
}
sb!.writeln(formattedLine);
Expand Down Expand Up @@ -308,7 +305,7 @@ class FormatCommand extends Command {
}

parameters.add(
'--format=H=%H;h=%h;T=%T;t=%t;P=%P;p=%p;an=%an;ae=%ae;ad=%ad;ar=%ar;cn=%cn;ce=%ce;cd=%cd;cr=%cr;s=%s;b=%b');
'--format="H=%H;h=%h;T=%T;t=%t;P=%P;p=%p;an=%an;ae=%ae;ad=%ad;ar=%ar;cn=%cn;ce=%ce;cd=%cd;cr=%cr;s=%s"');
ProcessResult result = await Process.run(
'git',
parameters,
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: git_log_markdown_formatter
description: A sample command-line application with basic argument parsing.
version: 1.2.0
version: 1.3.0

environment:
sdk: ^3.2.2
Expand Down
23 changes: 23 additions & 0 deletions test/format_command_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,18 @@ s=Prepare release 5.7.0;H=6a5034927857a08f3bdf5a177529e361179f6dab;an=Ephenodrom
var expected4 = '''
- Prepare release 5.7.0 [Commit](https://github.com/Ephenodrom/Dart-Basic-Utils/commit/6a5034927857a08f3bdf5a177529e361179f6dab) by Ephenodrom''';

var log5 = '''
H=f8a1e620360ca63bc0394bf4ad1da048202414b0;h=f8a1e620;T=de9b19f895ce53c3937e4af6466402732f1db798;t=de9b19f8;P=381199afb48e88d4d910ae1ac696b6a3dd1b6c88 bb52d4b4b08e3d8b1e4b9874b002e194ec9fb2fe;p=381199af bb52d4b4;an=group_103_bot_b3bc1c614c59f2a273ddb49272a686f0;ae=group_103_bot_b3bc1c614c59f2a273ddb49272a686f0@gitlab.muc.internetx.com;ad=Tue Feb 6 10:12:27 2024 +0000;ar=32 minutes ago;cn=group_103_bot_b3bc1c614c59f2a273ddb49272a686f0;ce=group_103_bot_b3bc1c614c59f2a273ddb49272a686f0@gitlab.muc.internetx.com;cd=Tue Feb 6 10:12:27 2024 +0000;cr=32 minutes ago;s=Merge branch 'develop';b=
H=bb52d4b4b08e3d8b1e4b9874b002e194ec9fb2fe;h=bb52d4b4;T=de9b19f895ce53c3937e4af6466402732f1db798;t=de9b19f8;P=fed4dbc2de6f96fa6fb8614aca18d173e77efdea;p=fed4dbc2;an=group_103_bot_b3bc1c614c59f2a273ddb49272a686f0;ae=group_103_bot_b3bc1c614c59f2a273ddb49272a686f0@gitlab.muc.internetx.com;ad=Tue Feb 6 10:12:27 2024 +0000;ar=32 minutes ago;cn=group_103_bot_b3bc1c614c59f2a273ddb49272a686f0;ce=group_103_bot_b3bc1c614c59f2a273ddb49272a686f0@gitlab.muc.internetx.com;cd=Tue Feb 6 10:12:27 2024 +0000;cr=32 minutes ago;s=Update versions for release;b=
H=8dc94f9c56f4459e6be99b44e61831690d55b17f;h=8dc94f9c;T=08d5a5d01ad5ee96335952b78e97e8776fd2d700;t=08d5a5d0;P=6c10904dffddf1db78711bf2aa91a448ece939ee;p=6c10904d;an=surattanabopp;[email protected];ad=Mon Jan 29 19:18:55 2024 +0100;ar=8 days ago;cn=surattanabopp;[email protected];cd=Mon Jan 29 19:18:55 2024 +0100;cr=8 days ago;s=SSLM-1369 Fix Null Pointer Exception;b=
H=6c10904dffddf1db78711bf2aa91a448ece939ee;h=6c10904d;T=c8c44a9e36cf5c10d142fe481add1c79599e7773;t=c8c44a9e;P=aacd6f9925ad245f9fd07d0cf764253d517ba752;p=aacd6f99;an=group_103_bot_b3bc1c614c59f2a273ddb49272a686f0;ae=group_103_bot_b3bc1c614c59f2a273ddb49272a686f0@gitlab.muc.internetx.com;ad=Tue Jan 23 14:52:27 2024 +0000;ar=2 weeks ago;cn=group_103_bot_b3bc1c614c59f2a273ddb49272a686f0;ce=group_103_bot_b3bc1c614c59f2a273ddb49272a686f0@gitlab.muc.internetx.com;cd=Tue Jan 23 14:52:27 2024 +0000;cr=2 weeks ago;s=Update for next development version;b=
H=aacd6f9925ad245f9fd07d0cf764253d517ba752;h=aacd6f99;T=3a0dc6937a412026b645ed43476c27f7a9f0d4ad;t=3a0dc693;P=d67d1af73ecb49b16dc557dcd2732a56c104c8cd 381199afb48e88d4d910ae1ac696b6a3dd1b6c88;p=d67d1af7 381199af;an=group_103_bot_b3bc1c614c59f2a273ddb49272a686f0;ae=group_103_bot_b3bc1c614c59f2a273ddb49272a686f0@gitlab.muc.internetx.com;ad=Tue Jan 23 14:52:24 2024 +0000;ar=2 weeks ago;cn=group_103_bot_b3bc1c614c59f2a273ddb49272a686f0;ce=group_103_bot_b3bc1c614c59f2a273ddb49272a686f0@gitlab.muc.internetx.com;cd=Tue Jan 23 14:52:24 2024 +0000;cr=2 weeks ago;s=Merge tag '4.15.0' into develop;b=Tag release
''';

var expected5 = '''
- Merge branch 'JIRA-2' into 'develop' [Commit](https://github.com/Ephenodrom/Dart-Basic-Utils/commit/aa1114f4d27a049ac4e01fa78402eee965a1528a) by Ephenodrom
- Update .gitlab-ci.yml [Commit](https://github.com/Ephenodrom/Dart-Basic-Utils/commit/c491eb38b129b85a21e6482c8e7e7a8cdd02e03a) by Ephenodrom''';

test('test formatLines()', () {
var cmd = FormatCommand();
cmd.cbu = "https://github.com/Ephenodrom/Dart-Basic-Utils/commit/";
Expand Down Expand Up @@ -126,4 +138,15 @@ s=Prepare release 5.7.0;H=6a5034927857a08f3bdf5a177529e361179f6dab;an=Ephenodrom
"- Prepare release 5.7.0 [Commit](https://github.com/Ephenodrom/Dart-Basic-Utils/commit/6a5034927857a08f3bdf5a177529e361179f6dab) by NULL",
);
});

test('test formatLines() 6', () {
var cmd = FormatCommand();
cmd.cbu = "https://github.com/Ephenodrom/Dart-Basic-Utils/commit/";
cmd.ibu = "https://github.com/Ephenodrom/Dart-Basic-Utils/issues/";
cmd.template = "- %s %H by %an";
cmd.addIssueLink = "APPEND";
cmd.authorRegex = ".*bot.*";
var markdown = cmd.formatLines(log5.split("\n"));
expect(markdown, expected5);
});
}

0 comments on commit 0575916

Please sign in to comment.