fix: suppress marker warnings for uninitialized summary files

- Only show marker missing warnings if file has OTHER markers
- If file has no markers at all, it's uninitialized and warnings are noise
- Prevents confusing warnings on first commit for new discussions
- All 41 tests passing
This commit is contained in:
rob 2025-11-04 22:37:08 -04:00
parent 304400cc85
commit 15b03e83d4
1 changed files with 9 additions and 5 deletions

View File

@ -42,12 +42,16 @@ def update_marker_block(
updated = re.sub(pattern, replacer, content, flags=re.DOTALL) updated = re.sub(pattern, replacer, content, flags=re.DOTALL)
# If no replacement happened, the markers might not exist # If no replacement happened, the markers might not exist.
# Only warn if the file has OTHER markers (indicating it's initialized but missing this one).
# If there are NO markers at all, the file is uninitialized and warnings are noise.
if updated == content: if updated == content:
sys.stderr.write( has_any_markers = "<!-- SUMMARY:" in content
f"[summary] note: markers for {marker_name} not found " if has_any_markers:
"(summary file likely not initialized yet)\n" sys.stderr.write(
) f"[summary] note: markers for {marker_name} not found "
"(summary file likely not initialized yet)\n"
)
return updated return updated