diff options
| author | Ewann <207907827+dev-ewann@users.noreply.github.com> | 2026-11-22 14:17:59 +0000 |
|---|---|---|
| committer | Ewann <207907827+dev-ewann@users.noreply.github.com> | 2026-11-22 14:20:30 +0000 |
| commit | ec9b6cf22b27545b99fedc8583c0a392d835ece0 (patch) | |
| tree | 1144bda93561eb5b7983554e7ea2f2c9da0ac221 /scripts | |
| parent | 003e78129303643a3fdc9e5f0e31a01b09759236 (diff) | |
tools: text reports are written with LF line ends on every platform (BUILD-468)
open(path, "w") without newline= turns each \n into \r\n on Windows, so the same JSON report, manifest or assembly
listing was CRLF there and LF elsewhere. 91 text-mode writes (open, os.fdopen, Path.write_text) under tools/, scripts/,
make_game.py and runtime/test/shaders/ now pass newline="\n". tests/test_text_write_line_endings.py reads the source
with ast and fails for a writer that forgets it; CONTRIBUTING.md names the convention.
AI-assisted (Claude), on behalf of dev-ewann.
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/audit_shader4_regs.py | 2 | ||||
| -rw-r--r-- | scripts/run_gpu_tests.py | 2 | ||||
| -rw-r--r-- | scripts/run_wine_tests.py | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/scripts/audit_shader4_regs.py b/scripts/audit_shader4_regs.py index ac22c856c..6a6c449de 100644 --- a/scripts/audit_shader4_regs.py +++ b/scripts/audit_shader4_regs.py | |||
| @@ -371,7 +371,7 @@ def main(argv=None): | |||
| 371 | if a.json_out: | 371 | if a.json_out: |
| 372 | try: | 372 | try: |
| 373 | os.makedirs(os.path.dirname(os.path.abspath(a.json_out)), exist_ok=True) | 373 | os.makedirs(os.path.dirname(os.path.abspath(a.json_out)), exist_ok=True) |
| 374 | with open(a.json_out, "w", encoding="utf-8") as f: | 374 | with open(a.json_out, "w", encoding="utf-8", newline="\n") as f: |
| 375 | json.dump(rep, f, indent=2) | 375 | json.dump(rep, f, indent=2) |
| 376 | f.write("\n") | 376 | f.write("\n") |
| 377 | except OSError as e: | 377 | except OSError as e: |
diff --git a/scripts/run_gpu_tests.py b/scripts/run_gpu_tests.py index 7209c364c..504f1ceb7 100644 --- a/scripts/run_gpu_tests.py +++ b/scripts/run_gpu_tests.py | |||
| @@ -115,7 +115,7 @@ def assemble_to_s(llvm_mc: str, asm_path: str, s_path: str, name: str) -> None: | |||
| 115 | continue | 115 | continue |
| 116 | if ln.startswith("\t"): | 116 | if ln.startswith("\t"): |
| 117 | lines.append(ln) | 117 | lines.append(ln) |
| 118 | with open(s_path, "w", encoding="utf-8") as f: | 118 | with open(s_path, "w", encoding="utf-8", newline="\n") as f: |
| 119 | f.write("\n".join(lines) + "\n") | 119 | f.write("\n".join(lines) + "\n") |
| 120 | 120 | ||
| 121 | 121 | ||
diff --git a/scripts/run_wine_tests.py b/scripts/run_wine_tests.py index b55ea9b91..0a02525e5 100644 --- a/scripts/run_wine_tests.py +++ b/scripts/run_wine_tests.py | |||
| @@ -251,7 +251,7 @@ def main() -> int: | |||
| 251 | if args.summary: | 251 | if args.summary: |
| 252 | try: | 252 | try: |
| 253 | _make_parent(args.summary) | 253 | _make_parent(args.summary) |
| 254 | with open(args.summary, "a", encoding="utf-8") as f: | 254 | with open(args.summary, "a", encoding="utf-8", newline="\n") as f: |
| 255 | f.write(f"### Windows tests under {args.label or 'Wine'}\n\n") | 255 | f.write(f"### Windows tests under {args.label or 'Wine'}\n\n") |
| 256 | f.write(f"{counts['pass']} passed, {counts['fail']} failed, {counts['skip']} skipped.\n\n") | 256 | f.write(f"{counts['pass']} passed, {counts['fail']} failed, {counts['skip']} skipped.\n\n") |
| 257 | f.write("| Test | Result | Required |\n|---|---|---|\n") | 257 | f.write("| Test | Result | Required |\n|---|---|---|\n") |