From e7383d924051cc4b0eb0f4d7a61da32941d200d9 Mon Sep 17 00:00:00 2001 From: Kimoon Han Date: Fri, 16 Aug 2024 00:36:18 +0900 Subject: [PATCH] fix(scope): remove trailing whitespace in body --- src/cz_changeup/cz_changeup.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cz_changeup/cz_changeup.py b/src/cz_changeup/cz_changeup.py index c01d920..49ca1a1 100644 --- a/src/cz_changeup/cz_changeup.py +++ b/src/cz_changeup/cz_changeup.py @@ -23,7 +23,9 @@ def changelog_message_builder_hook( if self.show_body and commit.body: msg += f"\n\n{' ' * self.body_indent}" - body = commit.body.replace("\n", "\n" + (" " * self.body_indent)) + body = ("\n\n" + (" " * self.body_indent)).join( + [s.strip() for s in str(commit.body).split("\n") if s] + ) msg += f"{body}" parsed_message["message"] = msg