Skip to content

Commit

Permalink
Remove newlines before links
Browse files Browse the repository at this point in the history
  • Loading branch information
cpitclaudel committed Oct 6, 2022
1 parent c71ae40 commit 8242e2b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Scripts/prepare_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,12 @@ class NewsFragments:
>>> import tempfile
>>> with tempfile.TemporaryDirectory() as tmpdir:
... fpath = Path(tmpdir) / "1234.fix"
... _ = fpath.write_text("Improved toaster settings.\nDafny will not burn toast again.", encoding="utf-8")
... _ = fpath.write_text("Improved toaster settings.\nDafny will not burn toast again", encoding="utf-8")
... print(NewsFragments.from_directory(tmpdir).render())
## Bug fixes
<BLANKLINE>
- Improved toaster settings.
Dafny will not burn toast again.
(https://github.com/dafny-lang/dafny/pull/1234)
Dafny will not burn toast again. (https://github.com/dafny-lang/dafny/pull/1234)
"""

IGNORED = {".gitignore", "README.md"}
Expand Down Expand Up @@ -116,7 +115,8 @@ def render(self) -> str:
rendered.append(f"## {title}")
for fr in self.fragments[ext]:
link = f"(https://github.com/dafny-lang/dafny/pull/{fr.pr})"
entry = indent(f"- {fr.contents}\n{link}", " ").lstrip()
contents = fr.contents.strip() + ("" if fr.contents.endswith(".") else ".")
entry = indent(f"- {contents} {link}", " ").lstrip()
rendered.append(entry)
return "\n\n".join(rendered)

Expand Down

0 comments on commit 8242e2b

Please sign in to comment.