Ignore commented GDK table rows #2671

Open
luckyteagirl wants to merge 2 commits from upstream-pr/2681 into main
luckyteagirl commented 2026-11-26 05:56:37 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by luckyteagirl on 2026-11-26T05:56:37Z.


gen_gdk_table.py picked up API rows inside // and /* ... */ comments. This made disabled rows appear in the generated Rust table.

What is in it

  • Read the Source field from the original input, then remove comments before matching API rows. Preserve quoted fields while stripping so // or /* inside a field does not swallow the active row.
  • Add a synthetic CLI fixture with a source URL, active rows, a quoted slash sequence, a commented-out line, and a commented-out block.

Tested

  • On main b49be183, the fixture emitted both commented-out rows. With the patch, it emitted only the active row and preserved the full source URL.
  • A follow-up fixture failed before the quote-aware fix because a quoted // swallowed the following active row; it passes on head 49973864.
  • python -B -m unittest discover -s scripts -p 'test_*.py': 26 passed, 0 failed, 0 skipped on Windows with Python 3.11.
  • A temporary composition of this PR with #2658 and #2724 passed all 28 Python script tests, including a commented malformed GUID and an active malformed GUID containing //.
  • git diff --check passed.

Regression run

  • Not applicable. This change only affects the generator and its test.

Not tested

  • Regeneration from a real GDK extraction, Rust or GPU tests, or a retail title run. The regression uses synthetic input.

AI use

  • Codex (GPT-6.2 Sol) implemented the original change and test, and a second GPT-6.2 Sol agent implemented the quote-aware follow-up. Codex (GPT-6.2 Astra) reviewed the diffs, tested the combined branches, and updated this description.
<!-- greyfinch-sync:ivall/xcl:issue:5504843516 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2681). Originally posted by [luckyteagirl](https://github.com/luckyteagirl) on 2026-11-26T05:56:37Z. --- `gen_gdk_table.py` picked up API rows inside `//` and `/* ... */` comments. This made disabled rows appear in the generated Rust table. **What is in it** - Read the `Source` field from the original input, then remove comments before matching API rows. Preserve quoted fields while stripping so `//` or `/*` inside a field does not swallow the active row. - Add a synthetic CLI fixture with a source URL, active rows, a quoted slash sequence, a commented-out line, and a commented-out block. **Tested** - On main `b49be183`, the fixture emitted both commented-out rows. With the patch, it emitted only the active row and preserved the full source URL. - A follow-up fixture failed before the quote-aware fix because a quoted `//` swallowed the following active row; it passes on head `49973864`. - `python -B -m unittest discover -s scripts -p 'test_*.py'`: 26 passed, 0 failed, 0 skipped on Windows with Python 3.11. - A temporary composition of this PR with #2658 and #2724 passed all **28 Python script tests**, including a commented malformed GUID and an active malformed GUID containing `//`. - `git diff --check` passed. **Regression run** - Not applicable. This change only affects the generator and its test. **Not tested** - Regeneration from a real GDK extraction, Rust or GPU tests, or a retail title run. The regression uses synthetic input. **AI use** - Codex (GPT-6.2 Sol) implemented the original change and test, and a second GPT-6.2 Sol agent implemented the quote-aware follow-up. Codex (GPT-6.2 Astra) reviewed the diffs, tested the combined branches, and updated this description.
github-actions[bot] commented 2026-12-01 02:33:18 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-12-01T02:33:18Z.


Nothing has happened on this PR for 3 days, so it is marked stale and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto main if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.

<!-- greyfinch-sync:ivall/xcl:comment:7298741409 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2681#issuecomment-7298741409). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-12-01T02:33:18Z. --- Nothing has happened on this PR for 3 days, so it is marked `stale` and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto `main` if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.
Foniass commented 2026-12-01 08:42:08 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T08:42:08Z.


Triage (#1607) – head 4997386

#2724 is stacked on this PR (it contains both of its commits and adds GUID validation), so it is not a duplicate. #2658 shares only test boilerplate; it validates the slot range, a different change. No problems found in the diff: comments are stripped after the Source: lookup and quoted fields are preserved.
Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

<!-- greyfinch-sync:ivall/xcl:comment:7305664752 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2681#issuecomment-7305664752). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T08:42:08Z. --- **Triage (#1607)** – head 4997386 #2724 is stacked on this PR (it contains both of its commits and adds GUID validation), so it is not a duplicate. #2658 shares only test boilerplate; it validates the slot range, a different change. No problems found in the diff: comments are stripped after the `Source:` lookup and quoted fields are preserved. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
Decodere commented 2026-12-02 09:05:40 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Decodere on 2026-12-02T09:05:40Z.


merge-check
base: 1c8b551475
head: 4997386407
merge: clean (git merge --no-edit onto 1c8b5514, git diff --check clean; scripts/gen_gdk_table.py and scripts/test_gdk_table_comments.py, +48/-0)
build: not run (Tier 0 Python generator diff; no Rust code changed)
tests: python -m unittest discover -s scripts -p "test_gdk_table_comments.py" -v -> 1 passed, 0 failed (new test file); python -m unittest discover -s scripts -p "test_*.py" -> 66 passed, 1 error (test_discord_mirror.py on Windows, same failure on base 1c8b5514). Rust workspace tests not run (Tier 0).
review: Read the full diff (+48/-0). Strips /* ... */ and // ... comments while preserving double-quoted string literals (scripts/gen_gdk_table.py:12-14) after extracting the Source: header comment, so commented-out rows cannot be emitted into gdk_table.rs while quoted // tokens do not prematurely start comments. The new test covers line comments, block comments, quoted slashes, and Source: preservation. No problems found.
performance: none (offline table generator in scripts/; zero runtime impact)
verdict: safe to merge
hardware / tool and model: NVIDIA GeForce RTX 4060 8 GB (driver 621.40), Intel Core i5-11400F, 32 GB RAM, Windows 11 Build 26200, Python 3.15.2, Rust 1.100.1 MSVC, DXC 1.9.2602.17 / Antigravity (Gemini 4 Neon)

<!-- greyfinch-sync:ivall/xcl:comment:7340366299 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2681#issuecomment-7340366299). Originally posted by [Decodere](https://github.com/Decodere) on 2026-12-02T09:05:40Z. --- merge-check base: 1c8b551475e1e7bfe48f94448492a4c3544a2e0f head: 499738640791d2c65e6822fe04d100271f8547b0 merge: clean (`git merge --no-edit` onto `1c8b5514`, `git diff --check` clean; `scripts/gen_gdk_table.py` and `scripts/test_gdk_table_comments.py`, +48/-0) build: not run (Tier 0 Python generator diff; no Rust code changed) tests: `python -m unittest discover -s scripts -p "test_gdk_table_comments.py" -v` -> 1 passed, 0 failed (new test file); `python -m unittest discover -s scripts -p "test_*.py"` -> 66 passed, 1 error (`test_discord_mirror.py` on Windows, same failure on base `1c8b5514`). Rust workspace tests not run (Tier 0). review: Read the full diff (+48/-0). Strips `/* ... */` and `// ...` comments while preserving double-quoted string literals (`scripts/gen_gdk_table.py:12-14`) after extracting the `Source:` header comment, so commented-out rows cannot be emitted into `gdk_table.rs` while quoted `//` tokens do not prematurely start comments. The new test covers line comments, block comments, quoted slashes, and `Source:` preservation. No problems found. performance: none (offline table generator in `scripts/`; zero runtime impact) verdict: safe to merge hardware / tool and model: NVIDIA GeForce RTX 4060 8 GB (driver 621.40), Intel Core i5-11400F, 32 GB RAM, Windows 11 Build 26200, Python 3.15.2, Rust 1.100.1 MSVC, DXC 1.9.2602.17 / Antigravity (Gemini 4 Neon)
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/2681:upstream-pr/2681'
git switch 'upstream-pr/2681'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/2681'
git switch 'upstream-pr/2681'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/2681'
git switch 'upstream-pr/2681'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/2681'
git switch 'main'
git merge --squash 'upstream-pr/2681'
git switch 'main'
git merge --ff-only 'upstream-pr/2681'
git switch 'main'
git merge 'upstream-pr/2681'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl!2671
No description provided.