Repository navigation
ci: refuse committed merge-conflict markers - #3962
Conversation
A resolution that stopped halfway left <<<<<<<, ||||||| and >>>>>>> lines in a manual-test register and was committed: markdown and shell still parse with them, so no gate noticed. scripts/check-conflict-markers.ts refuses such lines in tracked text files; lint-staged runs it on the staged files, CI's Format job and bun run check on the whole tree. A lone ======= stays allowed, since it is also a markdown heading underline.
|
Independent review accepted the tracked-text conflict guard after 13 controlled cases, including real diff3 conflict output, unusual filenames, normal concurrent lint-staged/oxfmt, both partially staged directions, and preserved index/worktree bytes. Normally reconciled current main into this PR at This is review/reconciliation evidence, not a merge claim. Normal new-head CI and expected-head squash remain required. The immutable v0.5.64 candidate/tag is unchanged. |
Why
In round 3, a conflict resolution that stopped halfway was committed with its
<<<<<<<,|||||||and>>>>>>>lines still inservices/platform/tests/manual/reference/automation.md. Markdown and shell still parse with markers in them, so neitherlint:manual, the format check nor the hook noticed. The squash merge happened to keep main clean.What changes
scripts/check-conflict-markers.tsrefuses a line that starts with<<<<<<<,|||||||or>>>>>>>, followed by a space or the end of the line, in tracked text files (git grep -I).=======stays allowed, because it is also a markdown heading underline and a real conflict always has its start and end lines."*"runs it on staged files;bun run lint:conflictsruns it on the whole tree;bun run checkand CI's Format job run it too..agents/repo.mdstates the rule.Verified
=======.oxfmt.oxfmtleaves marker lines unchanged in markdown. Even if it rewrote the end markers, the<<<<<<<start line is plain text that a formatter keeps, so the concurrent task cannot hide a conflict.