mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-02-01 02:10:56 +00:00
fix(tools): changelog.py: stricter model list format
This commit is contained in:
parent
7f2473bb48
commit
76dcadd4fc
@ -1 +1 @@
|
||||
[T2B1, T3B1] Fix "PIN attempts exceeded" screen.
|
||||
[T2B1,T3B1] Fix "PIN attempts exceeded" screen.
|
||||
|
@ -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}")
|
||||
|
Loading…
Reference in New Issue
Block a user