Skip to content

Play your own Switch games on iPhone/iPad — one-click macOS app, no terminal. | 把 Switch 游戏装进 iPhone:图形界面一键构建,不用命令行。Bring your own game.

PR template asks fix or feature as a question, ideas skip the problem form, triage reads fenced fields

v0lumehib5167603a562
diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md
index de1f6860..2f70bc48 100644
--- a/.github/pull_request_template.md
+++ b/.github/pull_request_template.md
@@ -1,6 +1,10 @@
<!-- One change per PR. CONTRIBUTING.md says where a change may go. Read it before touching dm/, scripts/, docs/, ref/ or AGENTS.md. -->
-Fix or feature? A fix merges once CI is green, a feature after 48 hours. Maintainers label it `bug` or `enhancement`.
+## Fix or feature
+
+<!-- Tick one. A fix merges once CI is green, a feature after 48 hours. Maintainers label it `bug` or `enhancement`. -->
+- [ ] Fix
+- [ ] Feature
## What and why
diff --git a/.github/scripts/tests/test_triage_prepare.py b/.github/scripts/tests/test_triage_prepare.py
index 8cb95033..03de2a23 100644
--- a/.github/scripts/tests/test_triage_prepare.py
+++ b/.github/scripts/tests/test_triage_prepare.py
@@ -33,6 +33,16 @@ class Form(unittest.TestCase):
f = dict(GAME, **{'NX2Apple version': '_No response_', 'Copy diagnostics': '_No response_'})
self.assertEqual(self.missing(form(**f)), ['NX2Apple version', 'Copy diagnostics'])
+ def test_empty_fenced_field_is_missing(self):
+ f = dict(GAME, **{'Copy diagnostics': '```markdown\n\n```'})
+ self.assertEqual(self.missing(form(**f)), ['Copy diagnostics'])
+
+ def test_heading_inside_a_fenced_field_stays_in_it(self):
+ diag = '```markdown\n### NX2Apple diagnostics\n\n- App: NX2Apple v0.7.3\n```'
+ sec = tp.sections(form(**dict(GAME, **{'Copy diagnostics': diag})))
+ self.assertEqual(sec['Copy diagnostics'], diag)
+ self.assertNotIn('NX2Apple diagnostics', sec)
+
def test_idea_is_not_asked_for_diagnostics(self):
idea = form(**{'This is': 'An idea', 'What happens, or what you would like': 'x', 'NX2Apple version': 'v0.4.9',
'Computer and OS': 'Mac, macOS 26', 'Copy diagnostics': '_No response_'})
diff --git a/.github/scripts/triage_prepare.py b/.github/scripts/triage_prepare.py
index 1f845375..6ccb7b65 100644
--- a/.github/scripts/triage_prepare.py
+++ b/.github/scripts/triage_prepare.py
@@ -45,11 +45,18 @@ def gh(*args, check=True):
return r.stdout
+FENCE = re.compile(r'^\s*(```|~~~)')
+EMPTY_FENCE = re.compile(r'^(```|~~~)[^\n]*\s*(```|~~~)$')
+
+
def sections(body):
- """The `### heading` sections of an issue-form body: {heading: text}."""
- out, cur = {}, None
+ """The `### heading` sections of an issue-form body: {heading: text}. A heading inside a fenced block (the Copy diagnostics
+ report starts with one) belongs to the field around it."""
+ out, cur, fenced = {}, None, False
for line in (body or '').splitlines():
- m = re.match(r'^### (.+?)\s*$', line)
+ if FENCE.match(line):
+ fenced = not fenced
+ m = None if fenced else re.match(r'^### (.+?)\s*$', line)
if m:
cur = m[1]
out[cur] = []
@@ -80,7 +87,7 @@ def analyse_form(body, readable_attachments):
if sec.get('This is', '').startswith('An idea'):
kind = 'idea'
for h, name in REQUIRED.items():
- if h not in sec or sec[h] not in NO_ANSWER:
+ if h not in sec or (sec[h] not in NO_ANSWER and not EMPTY_FENCE.match(sec[h])):
continue
if h == 'Copy diagnostics' and kind == 'idea':
continue
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 3c505298..c5b64ec1 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -44,6 +44,7 @@ missing piece.
Issue forms and the PR template apply in the browser only. `gh issue create`, the API and MCP tools skip the forms, so follow them yourself:
-- **Issues.** Write the body as `###` headings with the same names as the form's fields (for example `### Game, title ID and versions`, `### Copy diagnostics`, `### The game's log`) and fill every required field from [.github/ISSUE_TEMPLATE](.github/ISSUE_TEMPLATE). Ask the user for what you cannot read yourself: the Copy diagnostics output, the log, the versions. If a required field is missing, do not open the issue.
-- **Pull requests.** Use the sections of [.github/pull_request_template.md](.github/pull_request_template.md): `gh pr create --template .github/pull_request_template.md`, or the same headings in `--body`. A change to a vendored path follows the rule above.
+- **Problem reports.** Write the body as `###` headings with the same names as the form's fields (for example `### Game, title ID and versions`, `### Copy diagnostics`, `### The game's log`) and fill every required field from [.github/ISSUE_TEMPLATE](.github/ISSUE_TEMPLATE). Ask the user for what you cannot read yourself: the Copy diagnostics output, the log, the versions. If a required field is missing, do not open the issue.
+- **Ideas and plans.** These have no form. Write plain sections that fit the content, for example `### Idea`, `### Plan` and `### Done when`. Leave out the problem fields (`This is`, `NX2Apple version`, `Computer and OS`, `Copy diagnostics`). Open it with the labels `idea` and `no-triage`.
+- **Pull requests.** Use the sections of [.github/pull_request_template.md](.github/pull_request_template.md): `gh pr create --template .github/pull_request_template.md`, or the same headings in `--body`. Answer each section and remove the `<!-- -->` hints. Under Fix or feature, tick one box. A change to a vendored path follows the rule above.
- Never attach or commit keys, game files or data extracted from a game, and do not paste key values into a log or a diagnostics report.