fix(rules): conflict-marker check false-positived on decorative banners [#769]

Tightened to exact git markers: 7-char = alone, <<<<<<< / >>>>>>> with ref.

https://projects.knownelement.com/issues/769#note-4152
This commit is contained in:
2026-09-03 21:23:57 -05:00
parent 041d311d1c
commit ebd876b085
+1 -1
View File
@@ -234,7 +234,7 @@ $RULE_VERBOSE && log_step "File hygiene"
if git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
# archive/ excluded: legacy files are preserved verbatim and may contain
# decorative `====` banners that false-positive as conflict markers.
CONFLICT="$(git diff --cached --name-only --diff-filter=ACM 2>/dev/null | grep -v '^archive/' | xargs -r grep -lE '^(<<<<<<<|=======|>>>>>>>)' 2>/dev/null || true)"
CONFLICT="$(git diff --cached --name-only --diff-filter=ACM 2>/dev/null | grep -v '^archive/' | xargs -r grep -lE '^(<{7}( \S+)?|=======|>{7}( \S+)?)$' 2>/dev/null || true)"
if [ -z "$CONFLICT" ]; then check "No merge-conflict markers staged" "pass"; else check "Merge-conflict markers staged: $CONFLICT" "fail"; fi
fi