mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-02-08 05:32:39 +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]:
|
def _iter_fragments(project: Path) -> Iterator[Path]:
|
||||||
fragements_dir = project / ".changelog.d"
|
fragments_dir = project / ".changelog.d"
|
||||||
for fragment in fragements_dir.iterdir():
|
for fragment in fragments_dir.iterdir():
|
||||||
if fragment.name in IGNORED_FILES:
|
if fragment.name in IGNORED_FILES:
|
||||||
continue
|
continue
|
||||||
yield fragment
|
yield fragment
|
||||||
@ -150,10 +150,13 @@ def _iter_fragments(project: Path) -> Iterator[Path]:
|
|||||||
def check_fragments_style(project: Path):
|
def check_fragments_style(project: Path):
|
||||||
success = True
|
success = True
|
||||||
for fragment in _iter_fragments(project):
|
for fragment in _iter_fragments(project):
|
||||||
fragment_text = fragment.read_text().rstrip()
|
fragment_text = fragment.read_text().strip()
|
||||||
if not fragment_text.endswith("."):
|
if not fragment_text.endswith("."):
|
||||||
click.echo(f"Changelog '{fragment}' must end with a period.")
|
click.echo(f"Changelog '{fragment}' must end with a period.")
|
||||||
success = False
|
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:
|
if not success:
|
||||||
raise click.ClickException(f"Changelog style error: {project}")
|
raise click.ClickException(f"Changelog style error: {project}")
|
||||||
|
Loading…
Reference in New Issue
Block a user