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:
parent
304400cc85
commit
15b03e83d4
|
|
@ -42,12 +42,16 @@ def update_marker_block(
|
|||
|
||||
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:
|
||||
sys.stderr.write(
|
||||
f"[summary] note: markers for {marker_name} not found "
|
||||
"(summary file likely not initialized yet)\n"
|
||||
)
|
||||
has_any_markers = "<!-- SUMMARY:" in content
|
||||
if has_any_markers:
|
||||
sys.stderr.write(
|
||||
f"[summary] note: markers for {marker_name} not found "
|
||||
"(summary file likely not initialized yet)\n"
|
||||
)
|
||||
|
||||
return updated
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue