From 6f849e00a3d84c0f4adb34d41355c7af2c452957 Mon Sep 17 00:00:00 2001 From: Alex Verkhovsky Date: Tue, 21 Apr 2026 23:50:22 -0700 Subject: [PATCH] fix(quick-dev): preserve source line endings in render.py Python text-mode open() with the platform default performs universal- newline translation: on Windows, LF source files get written as CRLF, producing spurious diffs when rendered output is compared against source. Pass newline="" on both the source read and the rendered write so line endings pass through verbatim. Part of plan-quick-dev-python-config-hardening.md (F4). Co-Authored-By: Claude Opus 4.7 (1M context) --- src/bmm-skills/4-implementation/bmad-quick-dev/render.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bmm-skills/4-implementation/bmad-quick-dev/render.py b/src/bmm-skills/4-implementation/bmad-quick-dev/render.py index 4853b5852..58993b916 100644 --- a/src/bmm-skills/4-implementation/bmad-quick-dev/render.py +++ b/src/bmm-skills/4-implementation/bmad-quick-dev/render.py @@ -137,9 +137,9 @@ def main(): continue src = posixpath.join(script_dir, fname) dst = posixpath.join(out_dir, fname) - with open(src, "r", encoding="utf-8") as fh: + with open(src, "r", encoding="utf-8", newline="") as fh: content = fh.read() - with open(dst, "w", encoding="utf-8") as fh: + with open(dst, "w", encoding="utf-8", newline="") as fh: fh.write(render_template(content, vars_)) count += 1