Kill the mutant that strips more than blank lines off a changelog with no section
This commit is contained in:
@@ -137,7 +137,7 @@ def headed(changelog: str, entries: list[str], named: str) -> str:
|
||||
added = f"## {named}\n\n" + "\n".join(entries) + "\n"
|
||||
first = re.search(r"^## ", changelog, flags=re.M)
|
||||
if first is None:
|
||||
return changelog.rstrip("\n") + "\n\n" + added
|
||||
return changelog.rstrip() + "\n\n" + added
|
||||
return changelog[:first.start()] + added + "\n" + changelog[first.start():]
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user