Skip to content

Commit

Permalink
Improve changelog generator: capitalize output
Browse files Browse the repository at this point in the history
  • Loading branch information
emilk committed Nov 23, 2023
1 parent 24913ce commit b62676d
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions scripts/generate_changelog.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ def get_github_token() -> str:
except Exception:
pass

print("ERROR: expected a GitHub token in the environment variable GH_ACCESS_TOKEN or in ~/.githubtoken")
print(
"ERROR: expected a GitHub token in the environment variable GH_ACCESS_TOKEN or in ~/.githubtoken"
)
sys.exit(1)


Expand Down Expand Up @@ -99,7 +101,7 @@ def get_commit_info(commit: Any) -> CommitInfo:

def remove_prefix(text, prefix):
if text.startswith(prefix):
return text[len(prefix):]
return text[len(prefix) :]
return text # or whatever


Expand All @@ -110,6 +112,7 @@ def print_section(crate: str, items: List[str]) -> None:
line = remove_prefix(line, f"[{crate}] ")
line = remove_prefix(line, f"{crate}: ")
line = remove_prefix(line, f"`{crate}`: ")
line = line[0].upper() + line[1:] # Upper-case first letter
print(f"* {line}")
print()

Expand Down Expand Up @@ -160,9 +163,9 @@ def main() -> None:
title = pr_info.pr_title if pr_info else title
labels = pr_info.labels if pr_info else []

if 'exclude from changelog' in labels:
if "exclude from changelog" in labels:
continue
if 'typo' in labels:
if "typo" in labels:
# We get so many typo PRs. Let's not flood the changelog with them.
continue

Expand Down

0 comments on commit b62676d

Please sign in to comment.