Skip to content

no_merge_conflict_markers

Flag <<<<<<< , =======, >>>>>>> , ||||||| markers at the start of a line — almost always left over from an unresolved merge. The anchor markers carry a trailing ref (<<<<<<< HEAD), so they never collide with prose; a bare ======= is reported only when the file also contains one of those anchors, because on its own a seven-character ======= is indistinguishable from a reST/Markdown setext heading underline (so docs trees no longer need to be excluded).

This rule takes no kind-specific options.

Plus the common paths, level, id, and when fields. This table is generated from the JSON Schema; option types and defaults are authoritative.

A source file with unresolved merge conflict markers

Section titled “A source file with unresolved merge conflict markers”

The rule fires on this repository:

src/
src/clean.rs
src/half_merged.rs
src/clean.rs
pub fn ok() {}
src/half_merged.rs
<<<<<<< HEAD
ours
=======
theirs
>>>>>>> feature

With this .alint.yml:

version: 1
rules:
- id: no-conflict
kind: no_merge_conflict_markers
paths: "src/**/*"
level: error

alint check reports:

Terminal window
--- src/half_merged.rs ---------------------------------------------------------
x error no-conflict
1:1 unresolved merge conflict marker on line 1: "<<<<<<<"
Summary (1 violation):
x 1 error
0 passing * 1 failing

Source files with no leftover conflict markers

Section titled “Source files with no leftover conflict markers”

This repository is compliant:

src/
src/a.rs
src/docs.md
src/a.rs
pub fn a() {}
src/docs.md
Conflict discussion: we use <<<<<< for ... (inline, no col-1 marker)

With this .alint.yml:

version: 1
rules:
- id: no-conflict
kind: no_merge_conflict_markers
paths: "src/**/*"
level: error

alint check reports:

Terminal window
v All 1 rule(s) passed.