ci: harden form_reference CLI with atomic writes and add CLI suite #2667
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2675"
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?
Imported from R0Y00/Xbox2Windows. Originally posted by Ammmae0x on 2026-11-26T01:45:23Z.
Change
Extract an
argparseCLI entrypointmain(argv=None) -> intwith upfront input/output validation and atomic writes intools/form_reference.py, and add a pure-Python synthetic.rstCLI test suite (tests/form_reference_cli_check.py), registered inCMakeLists.txtasci_form_reference_cli_check.llvm_docs_dirand optional--out-dir(defaulting todocs/coverage).llvm_docs_diris a directory containing all four requiredAMDGPUAsmGFX{10,1011,1013,1030}.rstregular files and that--out-dirand each target.tsvpath are not symlinks, directories, or under file parents before parsing inputs.write_text()inwrite()with sibling-temp_write_atomic()usingos.replace()and temp unlink on all errors; catch(OSError, ValueError)inmain()for clean stderr output and exit code1with zero raw tracebacks.Verification
Verified on commit
01cab8bf(based onupstream/main82c70807) on Windows usingout/pe-env/Scripts/python.exe -B:out\pe-env\Scripts\python.exe -B tests\form_reference_cli_check.py-> exit 0 (9/9 tests OK, 0 skips: syntheticAMDGPUAsmGFX*.rstgeneration into nested--out-dir, atomic overwrite with 0.tmp,argv=None/__main__, missing/file docs dir, missing/dir.rst, output dir/symlink/file-parent guards,os.replacefailure preserving existing TSVs, Python 3.14-safe argparse checks, and 4 fast temp mutations).out\pe-env\Scripts\python.exe -B tests\form_coverage_check.py-> exit 0.out\pe-env\Scripts\python.exe -B tests\docs_links_check.py-> exit 0.out\pe-env\Scripts\python.exe -B tests\bidi_controls_check.py-> exit 0.tests/form_reference_cli_check.py): disabling output symlink check, disabling required.rstregular-file check, and disabling.tmpcleanup on replace failure.Evidence and follow-up
AMDGPUAsmGFX*.rstfixtures are generated at runtime in temporary directories (MIT License; does not modifydocs/coverage/*.tsvortools/form_coverage.py).Checklist
AI-assisted.