1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-02-01 10:20:59 +00:00

fix(tools): changelog.py: stricter model list format

This commit is contained in:
Martin Milata 2025-01-29 18:05:06 +01:00
parent 7f2473bb48
commit 76dcadd4fc
2 changed files with 7 additions and 4 deletions

View File

@ -1 +1 @@
[T2B1, T3B1] Fix "PIN attempts exceeded" screen.
[T2B1,T3B1] Fix "PIN attempts exceeded" screen.

View File

@ -140,8 +140,8 @@ def filter_changelog(changelog_file: Path, internal_name: str):
def _iter_fragments(project: Path) -> Iterator[Path]:
fragements_dir = project / ".changelog.d"
for fragment in fragements_dir.iterdir():
fragments_dir = project / ".changelog.d"
for fragment in fragments_dir.iterdir():
if fragment.name in IGNORED_FILES:
continue
yield fragment
@ -150,10 +150,13 @@ def _iter_fragments(project: Path) -> Iterator[Path]:
def check_fragments_style(project: Path):
success = True
for fragment in _iter_fragments(project):
fragment_text = fragment.read_text().rstrip()
fragment_text = fragment.read_text().strip()
if not fragment_text.endswith("."):
click.echo(f"Changelog '{fragment}' must end with a period.")
success = False
if fragment_text.startswith("[") and not MODELS_RE.search(fragment_text):
click.echo(f"Wrong model specifier in '{fragment}'")
success = False
if not success:
raise click.ClickException(f"Changelog style error: {project}")