Skip to content

Commit

Permalink
fix(git-changelog): missing trim for fields (#212)
Browse files Browse the repository at this point in the history
* fix(git-changelog): missing trim for fields
* fix: tests

---------

Signed-off-by: Neko Ayaka <[email protected]>
Co-authored-by: Northword <[email protected]>
  • Loading branch information
nekomeowww and northword authored May 15, 2024
1 parent 81c02f2 commit d557690
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
1 change: 0 additions & 1 deletion docs/.vitepress/theme/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ export default defineThemeUnconfig({
{
name: 'Northword',
username: 'northword',
mapByNameAliases: ['northword'],
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ export async function extractAuthorsWithMultiple(
while (result = multipleAuthorsRegex.exec(c.body)) {
const [, name, email] = result
await mapCommitAuthors(mapContributors, map, {
author_name: name,
author_email: email,
author_avatar: await digestStringAsSHA256(email),
author_name: name.trim(),
author_email: email.trim(),
author_avatar: await digestStringAsSHA256(email.trim()),
})
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ describe('parseCommits', () => {
date: 'Mon Mar 25 20:05:53 2024 +0800',
date_timestamp: 1711368353000,
message: 'release: v1.24.3',
body: 'Signed-off-by: First Last <[email protected]>\n',
body: 'Signed-off-by: First Last <[email protected]>',
author_name: 'First Last',
author_email: '[email protected]',
author_avatar: 'b4c9a289323b21a01c3e940f150eb9b8c542587f1abfd8f0e1cc1ffc5e475514',
Expand All @@ -133,7 +133,7 @@ describe('parseCommits', () => {
date: 'Wed Apr 24 14:24:44 2024 +0800',
date_timestamp: 1713939884000,
message: 'docs: fix english integrations list',
body: 'Signed-off-by: First Last <[email protected]>\n',
body: 'Signed-off-by: First Last <[email protected]>',
author_name: 'First Last',
author_email: '[email protected]',
author_avatar: 'b4c9a289323b21a01c3e940f150eb9b8c542587f1abfd8f0e1cc1ffc5e475514',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ export async function parseCommits(
optsRewritePathsBy?: RewritePathsBy,
): Promise<Commit[]> {
const commits = await Promise.all(rawLogs.map(async (raw) => {
const [hash, author_name, author_email, date, message, refs, body] = raw.split('|')
const [hash, author_name, author_email, date, message, refs, body] = raw.split('|').map(v => v.trim())
const commit: Commit = {
path,
hash,
Expand Down

0 comments on commit d557690

Please sign in to comment.