Skip to content

Commit

Permalink
fixup! style: add make changelog_style for automatic changelog form…
Browse files Browse the repository at this point in the history
…atting
  • Loading branch information
romanz committed Jan 27, 2025
1 parent 0132526 commit ec93781
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions tools/changelog.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@

ROOT = Path(__file__).parent.parent

ALLOWED_PROJECTS = (
# Source of truth for all managed changelogs in this repository.
# Please extend it when adding a new project with a managed changelog.
KNOWN_PROJECTS = (
ROOT / "core",
ROOT / "core/embed/projects/boardloader",
ROOT / "core/embed/projects/bootloader",
Expand All @@ -33,7 +35,7 @@
ROOT / "python",
)

for project in ALLOWED_PROJECTS:
for project in KNOWN_PROJECTS:
assert project.is_dir(), f"Project {project} does not exist"

IGNORED_FILES = ('.gitignore', '.keep')
Expand Down Expand Up @@ -185,15 +187,15 @@ def cli():
@cli.command()
def check():
"""Check the style of all changelog fragments."""
for project in ALLOWED_PROJECTS:
check_fragments_style(Path(project))
for project in KNOWN_PROJECTS:
check_fragments_style(project)


@cli.command()
def style():
"""Fix the style of all changelog fragments."""
for project in ALLOWED_PROJECTS:
fix_fragments_style(Path(project))
for project in KNOWN_PROJECTS:
fix_fragments_style(project)


@cli.command()
Expand Down Expand Up @@ -223,8 +225,8 @@ def generate(project, version, date, check, only_models):
- Tell git to stage changed files.
"""
project = Path(project)
if project not in ALLOWED_PROJECTS:
raise click.ClickException(f"Project '{project}' is not part of `ALLOWED_PROJECTS`")
if project not in KNOWN_PROJECTS:
raise click.ClickException(f"Please add '{project}' to `KNOWN_PROJECTS` to be part of our managed changelogs.")

changelog = project / "CHANGELOG.md"

Expand Down

0 comments on commit ec93781

Please sign in to comment.