Play your own Switch games on iPhone/iPad — one-click macOS app, no terminal. | 把 Switch 游戏装进 iPhone:图形界面一键构建,不用命令行。Bring your own game.
Swift apple-siliconcustom-formathomebrewiosipaipadipadosiphonemetalnative-portnintendo-switchnxnativeromfsswitch-games
Release notes check: the English part comes first, the Chinese part second
v0lumehi40f42cce7192
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.ymlindex b22a0f0a..b991e380 100644--- a/.github/workflows/tests.yml+++ b/.github/workflows/tests.yml@@ -126,7 +126,7 @@ jobs:retention-days: 7# The notes of a final release live in release-notes/vX.Y.Z.md and are merged before the tag (RELEASING.md, "Release notes"). A pull request that changes- # one is linted here: no emojis or symbols, no semicolons or dashes, Chinese then English, no template leftovers. Nothing runs when no notes file changed.+ # one is linted here: no emojis or symbols, no semicolons or dashes, English then Chinese, no template leftovers. Nothing runs when no notes file changed.release-notes:name: Release notes lint (release-notes/*.md)runs-on: ubuntu-latestdiff --git a/RELEASING.md b/RELEASING.mdindex 1ff518b2..ce7ec44e 100644--- a/RELEASING.md+++ b/RELEASING.md@@ -57,7 +57,7 @@ A final tag on a commit without a candidate fails. In an emergency, a manual runCI writes a short body: the version and the tested candidate. The readable notes are written by a person or an agent from [.github/release_notes_template.md](.github/release_notes_template.md).-The notes of a final release are a file in the repository, `release-notes/vX.Y.Z.md`, in the form of the template (the Chinese part, then the English part, no generated block). Merge it in a normal pull request before the final tag is pushed. When the final tag is built, CI creates the release with that file, a `---` line and GitHub's generated notes appended (`python3 tools/release_notes.py build`, the previous tag is the newest final tag before this one). `python3 tools/release_notes.py check release-notes/vX.Y.Z.md` runs the rules below and also runs in the pull request CI. Without the file CI writes the short body (the version and the tested candidate) and appends the generated notes. If the tool fails, the release gets the short body and CI prints a warning: a notes problem never stops a release. CI creates the release only when it does not exist, so notes edited by hand are never overwritten, and `gh release edit <tag> --notes-file <file>` stays the way to fix them later.+The notes of a final release are a file in the repository, `release-notes/vX.Y.Z.md`, in the form of the template (the English part, then the Chinese part, no generated block). Merge it in a normal pull request before the final tag is pushed. When the final tag is built, CI creates the release with that file, a `---` line and GitHub's generated notes appended (`python3 tools/release_notes.py build`, the previous tag is the newest final tag before this one). `python3 tools/release_notes.py check release-notes/vX.Y.Z.md` runs the rules below and also runs in the pull request CI. Without the file CI writes the short body (the version and the tested candidate) and appends the generated notes. If the tool fails, the release gets the short body and CI prints a warning: a notes problem never stops a release. CI creates the release only when it does not exist, so notes edited by hand are never overwritten, and `gh release edit <tag> --notes-file <file>` stays the way to fix them later.- Chinese first, English second, under `## 中文` and `## English`, with the same content in both. Each part has one bullet per change, grouped in bold: a notice, Highlights, New, Fixed, Known issues, Requires.- No emojis, no pictograms and no symbols in the text. No semicolons (also not the full-width one) and no em-dashes. Plain English and plain Chinese.diff --git a/tools/release_notes.py b/tools/release_notes.pyindex 97e22f44..d45820ca 100644--- a/tools/release_notes.py+++ b/tools/release_notes.py@@ -2,13 +2,13 @@"""The notes of a final release: a reviewed file per version plus the notes GitHub generates (RELEASING.md, "Release notes").release-notes/vX.Y.Z.md is written by a person or an agent in a normal pull request before the final tag, in the form of-.github/release_notes_template.md (a Chinese part, then an English part, no generated block). When the final tag is built, CI runs `build`:+.github/release_notes_template.md (an English part, then a Chinese part, no generated block). When the final tag is built, CI runs `build`:the file, a `---` line, then the generated notes (merged pull requests with their authors, first-time contributors, the Full Changelog link)appended unchanged.Subcommands (Python 3.9+, no packages):check FILE... lint notes files: no emojis, pictograms or symbols, no semicolons (also the full-width one), no em-dashes or- en-dashes, a `## 中文` and then a `## English` section, no template comments or placeholders, no generated block.+ en-dashes, a `## English` and then a `## 中文` section, no template comments or placeholders, no generated block.Exit 1 when any file has a problem, and print every problem as file:line.previous TAG [--remote R] print the newest final tag (no `-rc`) before TAG, read from `git ls-remote --tags R` (default origin).Prints nothing when there is none.@@ -103,8 +103,8 @@ def check_text(text):problems.append((1, 'the section "%s" is missing' % HEADING_ZH))if en is None:problems.append((1, 'the section "%s" is missing' % HEADING_EN))- if zh is not None and en is not None and zh > en:- problems.append((zh, 'the Chinese part comes first: "%s" before "%s"' % (HEADING_ZH, HEADING_EN)))+ if zh is not None and en is not None and en > zh:+ problems.append((en, 'the English part comes first: "%s" before "%s"' % (HEADING_EN, HEADING_ZH)))if zh is not None and en is not None:lines = text.splitlines()first, second = sorted((zh, en))diff --git a/tools/tests/test_release_notes.py b/tools/tests/test_release_notes.pyindex 3a668dce..1af23e1e 100644--- a/tools/tests/test_release_notes.py+++ b/tools/tests/test_release_notes.py@@ -15,17 +15,6 @@ N = importlib.import_module('release_notes')GOOD = """**v1.2.3: the iPhone app.**-## 中文--**重点**--**iPhone 应用**-- 现在可以在 iPhone 上运行游戏-- 支持手柄--**修复**-- **修复崩溃**:启动时崩溃,现在不会了(#12)-## English**Highlights**@@ -37,6 +26,17 @@ GOOD = """**v1.2.3: the iPhone app.****Fixed**- **Crash fixed**: it crashed at launch, now it does not (#12)+## 中文++**重点**++**iPhone 应用**+- 现在可以在 iPhone 上运行游戏+- 支持手柄++**修复**+- **修复崩溃**:启动时崩溃,现在不会了(#12)+---**Install:** download `NX2Apple-macOS-arm64.zip`, unzip, drag it to Applications. 中文:下载后解压,拖进「应用程序」。@@ -85,10 +85,11 @@ class Check(unittest.TestCase):def test_sections(self):self.assertTrue(any('中文' in m and 'missing' in m for m in problems(GOOD.replace('## 中文', '## Chinese'))))self.assertTrue(any('English' in m and 'missing' in m for m in problems(GOOD.replace('## English', '## Englisch'))))- zh, en = GOOD.split('## English')- swapped = '## English' + en.split('---')[0] + '\n' + zh.replace('## 中文', '## 中文', 1)- self.assertTrue(any('comes first' in m for m in problems(swapped)))- self.assertTrue(any('empty' in m for m in problems(GOOD.split('**重点**')[0] + '## English\n\ntext\n')))+ head, rest = GOOD.split('## English')+ en, zh = rest.split('## 中文')+ swapped = head + '## 中文' + zh.split('---')[0] + '\n## English' + en+ self.assertTrue(any('English part comes first' in m for m in problems(swapped)))+ self.assertTrue(any('empty' in m for m in problems(GOOD.split('**Highlights**')[0] + '## 中文\n\ntext\n')))def test_leftovers(self):for bad in ('<!-- a comment -->', 'vX.Y.Z', 'X.Y.Z', 'see #N', 'TODO', 'One point', '一个要点'):