mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 23:05:53 +01:00
[PR #2265] regen_fixtures: guard flags/paths, strip UTF-8 BOM, and write atomically #2269
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#2269
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/2265
Author: @kirigayakazima
Created: 11/26/2026
Status: 🔄 Open
Base:
main← Head:fix/regen-fixtures-safety📝 Commits (1)
942872eregen_fixtures: guard flags/paths, strip UTF-8 BOM, and write atomically📊 Changes
2 files changed (+142 additions, -31 deletions)
View changed files
📝
tests/semantic/regen_fixtures.py(+92 -31)📝
tests/test_regen_fixtures.py(+50 -0)📄 Description
Claimed in the coordination issue as: REGEN-FIXTURES-UNKNOWN-FLAGS-BOM-TRAVERSAL-AND-ATOMIC-IO (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7191130679)
What and why
tests/semantic/regen_fixtures.pypreviously:-...CLI options and--help, treating unrecognized flags as ignored rather than usage errors.../escapeorsub/name) without checking single-segment basename safety..asmand.sfiles with"utf-8"instead of"utf-8-sig", leaving a UTF-8 BOM attached to line 1 inmarked_names(),generated_names(),render(),mark(), and--check..asmmarks and.sfixtures in place via directopen(..., "w").This rejects unknown flags (
-h/--helpreturn 0,--ends options), validates plain shader stems upfront, opens files withutf-8-sig, stages and publishes writes atomically viatempfile+file_mode.published_mode+replace_retry.replace, handlesOSError/UnicodeDecodeErrorcleanly, and adds unit coverage intests/test_regen_fixtures.py.Tested
python -I tests/test_regen_fixtures.py -v(11 passed)python -I tests/semantic/regen_fixtures.py --checkupstream/mainbaseline negative control: failed with the new tests before the fixpython -I tests/test_ci_registration.py,python -I tests/test_text_write_line_endings.py,python -I scripts/check_no_game_data.py,python -I -m compileall -q, andgit diff --cached --checkGPUs tested: n/a
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.