1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-21 23:18:13 +00:00

all: improve changelog formatting

This commit is contained in:
matejcik 2020-07-02 11:59:37 +02:00 committed by matejcik
parent 476cf2ee8f
commit a19a9a318a
6 changed files with 112 additions and 64 deletions

View File

@ -9,15 +9,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
_Most likely to be released on July 1st._
### Added
- Soft lock. #958
- Auto lock. #1027
- Soft lock. [#958]
- Auto lock. [#1027]
- Dedicated `initialized` field in storage.
- Support EXTERNAL transaction inputs with a SLIP-0019 proof of ownership #1052
- Support pre-signed EXTERNAL transaction inputs
- Support EXTERNAL transaction inputs with a SLIP-0019 proof of ownership. [#1052]
- Support pre-signed EXTERNAL transaction inputs.
### Changed
- `Features.pin_cached` renamed to `unlocked`.
- Forbid all settings if the device is not yet initialized. #1056
- Forbid all settings if the device is not yet initialized. [#1056]
### Deprecated
- Deprecate `Overwintered` field in `SignTx` and `TxAck`.
@ -26,10 +26,10 @@ _Most likely to be released on July 1st._
- Generated protobuf classes now do not contain deprecated fields.
### Fixed
- Fix cancel icon in PIN dialog. #1042
- Fix repaint bug in QR code rendering. #1067
- Fix QR code overlapping in Monero address. monero-gui #2960
- Re-introduce ability to spend pre-Overwinter UTXO on Zcash-like coins. #1030
- Fix cancel icon in PIN dialog. [#1042]
- Fix repaint bug in QR code rendering. [#1067]
- Fix QR code overlapping in Monero address. monero-gui#2960, [#1074]
- Re-introduce ability to spend pre-Overwinter UTXO on Zcash-like coins. [#1030]
### Security
@ -159,3 +159,12 @@ Version 2.0.6 [Mar 2018]
Version 2.0.5 [Mar 2018]
* first public release
[#958]: https://github.com/trezor/trezor-firmware/issues/958
[#1027]: https://github.com/trezor/trezor-firmware/issues/1027
[#1030]: https://github.com/trezor/trezor-firmware/issues/1030
[#1042]: https://github.com/trezor/trezor-firmware/issues/1042
[#1052]: https://github.com/trezor/trezor-firmware/issues/1052
[#1056]: https://github.com/trezor/trezor-firmware/issues/1056
[#1067]: https://github.com/trezor/trezor-firmware/issues/1067
[#1074]: https://github.com/trezor/trezor-firmware/issues/1074

View File

@ -8,12 +8,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Added
### Changed
- Use Trezor instead of TREZOR
### Deprecated
### Removed
### Fixed
- Use Trezor instead of TREZOR
### Security

View File

@ -7,7 +7,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [Unreleased]
### Added
- Set initialized in storage to false if no mnemonic is present. #965
- Set initialized in storage to false if no mnemonic is present. [#965]
### Changed
- `Features.pin_cached` renamed to `unlocked`, and it is now `true` even if PIN is not set.
@ -17,7 +17,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Removed
### Fixed
- Re-introduce ability to spend pre-Overwinter UTXO on Zcash-like coins. #1030
- Re-introduce ability to spend pre-Overwinter UTXO on Zcash-like coins. [#1030]
### Security
@ -203,3 +203,6 @@ Version 1.1.0 [Jun 2014]
Version 1.0.0 [Apr 2014]
* Added support for streaming of transactions into the device
* Removed all current limits on size of signed transaction
[#965]: https://github.com/trezor/trezor-firmware/issues/965
[#1030]: https://github.com/trezor/trezor-firmware/issues/1030

View File

@ -369,6 +369,24 @@ _At the moment, the project does **not** adhere to [Semantic Versioning](https:/
- gradually dropping Python 2 compatibility (pypi package will now be marked as Python 3 only)
[f#41]: https://github.com/trezor/trezor-firmware/issues/41
[f#87]: https://github.com/trezor/trezor-firmware/issues/87
[f#116]: https://github.com/trezor/trezor-firmware/issues/116
[f#117]: https://github.com/trezor/trezor-firmware/issues/117
[f#224]: https://github.com/trezor/trezor-firmware/issues/224
[f#226]: https://github.com/trezor/trezor-firmware/issues/226
[f#363]: https://github.com/trezor/trezor-firmware/issues/363
[f#411]: https://github.com/trezor/trezor-firmware/issues/411
[f#420]: https://github.com/trezor/trezor-firmware/issues/420
[f#445]: https://github.com/trezor/trezor-firmware/issues/445
[f#510]: https://github.com/trezor/trezor-firmware/issues/510
[f#525]: https://github.com/trezor/trezor-firmware/issues/525
[f#666]: https://github.com/trezor/trezor-firmware/issues/666
[f#680]: https://github.com/trezor/trezor-firmware/issues/680
[f#681]: https://github.com/trezor/trezor-firmware/issues/681
[f#778]: https://github.com/trezor/trezor-firmware/issues/778
[f#823]: https://github.com/trezor/trezor-firmware/issues/823
[f#1082]: https://github.com/trezor/trezor-firmware/issues/1082
[#94]: https://github.com/trezor/python-trezor/issues/94
[#167]: https://github.com/trezor/python-trezor/issues/167
[#169]: https://github.com/trezor/python-trezor/issues/169
@ -412,21 +430,3 @@ _At the moment, the project does **not** adhere to [Semantic Versioning](https:/
[#349]: https://github.com/trezor/python-trezor/issues/349
[#351]: https://github.com/trezor/python-trezor/issues/351
[#352]: https://github.com/trezor/python-trezor/issues/352
[f#41]: https://github.com/trezor/trezor-firmware/issues/41
[f#87]: https://github.com/trezor/trezor-firmware/issues/87
[f#116]: https://github.com/trezor/trezor-firmware/issues/116
[f#117]: https://github.com/trezor/trezor-firmware/issues/117
[f#224]: https://github.com/trezor/trezor-firmware/issues/224
[f#226]: https://github.com/trezor/trezor-firmware/issues/226
[f#363]: https://github.com/trezor/trezor-firmware/issues/363
[f#411]: https://github.com/trezor/trezor-firmware/issues/411
[f#420]: https://github.com/trezor/trezor-firmware/issues/420
[f#445]: https://github.com/trezor/trezor-firmware/issues/445
[f#510]: https://github.com/trezor/trezor-firmware/issues/510
[f#525]: https://github.com/trezor/trezor-firmware/issues/525
[f#666]: https://github.com/trezor/trezor-firmware/issues/666
[f#680]: https://github.com/trezor/trezor-firmware/issues/680
[f#681]: https://github.com/trezor/trezor-firmware/issues/681
[f#778]: https://github.com/trezor/trezor-firmware/issues/778
[f#823]: https://github.com/trezor/trezor-firmware/issues/823
[f#1082]: https://github.com/trezor/trezor-firmware/issues/1082

View File

@ -1,34 +0,0 @@
#!/usr/bin/env python3
import os
import re
REPOS = {
"": "python-trezor",
"f": "trezor-firmware",
}
LINK_RE = re.compile(r"\[(f?)#(\d+)\]")
ISSUE_URL = "https://github.com/trezor/{repo}/issues/{issue}"
CHANGELOG = os.path.dirname(__file__) + "/../CHANGELOG.md"
changelog_entries = set()
links = set()
result_lines = []
with open(CHANGELOG, "r+") as changelog:
for line in changelog:
if LINK_RE.match(line): # line *starts with* issue identifier
break
for repo, issue in LINK_RE.findall(line):
changelog_entries.add((repo, int(issue)))
result_lines.append(line)
changelog.seek(0)
changelog.truncate(0)
for line in result_lines:
changelog.write(line)
for repo, issue in sorted(changelog_entries):
url = ISSUE_URL.format(repo=REPOS[repo], issue=issue)
changelog.write(f"[{repo}#{issue}]: {url}\n")

68
tools/linkify-changelogs.py Executable file
View File

@ -0,0 +1,68 @@
#!/usr/bin/env python3
import os
from pathlib import Path
import re
import click
LINK_RE = re.compile(r"\[#(\d+)\]")
ISSUE_URL = "https://github.com/trezor/trezor-firmware/issues/{issue}"
ROOT = Path(__file__).parent.resolve().parent
DEFAULT_CHANGELOGS = ( # TODO replace with a wildcard?
ROOT / "core" / "ChangeLog",
ROOT / "legacy" / "firmware" / "ChangeLog",
ROOT / "legacy" / "bootloader" / "ChangeLog",
ROOT / "python" / "CHANGELOG.md",
)
def process_changelog(changelog_file):
links = {}
result_lines = []
with open(changelog_file, "r+") as changelog:
for line in changelog:
m = LINK_RE.match(line)
if m: # line *starts with* issue identifier
# keep existing links as-is
links[int(m[1])] = line.replace(m[0] + ": ", "").strip()
else:
for issue in LINK_RE.findall(line):
links[int(issue)] = ISSUE_URL.format(issue=issue)
result_lines.append(line)
changelog.seek(0)
changelog.truncate(0)
for line in result_lines:
changelog.write(line)
for marker, url in sorted(links.items()):
changelog.write(f"[#{marker}]: {url}\n")
@click.command()
@click.argument(
"changelogs",
nargs=-1,
type=click.Path(exists=True, dir_okay=False, writable=True),
)
def cli(changelogs):
"""Linkify changelog.
Find all occurences of "[#123]" in text, and add a Markdown link to the referenced
issue.
If no arguments are provided, runs on all known changelogs.
"""
if not changelogs:
changelogs = DEFAULT_CHANGELOGS
for changelog in changelogs:
click.echo(f"Linkifying {changelog}...")
process_changelog(changelog)
if __name__ == "__main__":
cli()