Skip to content

Commit

Permalink
Print notes to stdout after potential warnings
Browse files Browse the repository at this point in the history
Querying and formatting might generate warnings. Make sure that these
are printed before the generated notes.
  • Loading branch information
lagru committed Nov 13, 2023
1 parent 043d0ca commit 72e88ce
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/changelist/_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ def main(
pull_requests=lazy_tqdm(pull_requests, desc="Fetching reviewers"),
)

print("Formatting notes...", file=sys.stderr)
change_notes = ChangeNote.from_pull_requests(
pull_requests,
pr_summary_regex=re.compile(config["pr_summary_regex"], flags=re.MULTILINE),
Expand All @@ -178,7 +179,5 @@ def main(
io.writelines(formatter.iter_lines())
else:
print()
for line in formatter.iter_lines():
assert line.endswith("\n")
assert line.count("\n") == 1
print(line, end="", file=sys.stdout)
notes = str(formatter)
print(notes, file=sys.stdout)

0 comments on commit 72e88ce

Please sign in to comment.