blob: e95e8aaf7e15d6261e46f2f5a19816e0db64147b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
#!/usr/bin/env -S perl -wp
#
# This terrible perl script helps convert the easy-to-edit
#
# - Changelog item.
# !1234
# #6789
# TROVE-2024-001
#
# into our canonical CHANGELOG.md style
#
# - Changelog item.
# ([!1234], [#6789], [TROVE-2024-001])
#
# You pipe the new bit of the changelog through it manually.
# You'll probably need to edit it before and after.
use strict;
our @links;
s{[ \t]*$}{};
my $linky = qr{[!#]\d{3,}|TROVE-\d+-\d+};
if (m{^ ($linky)$}) {
push @links, "[$1]";
$_ = '';
} else {
if (@links) {
print " (";
print join ', ', @links;
print ")\n";
@links = ();
}
}
|