Skip to content

Commit 68b966b

Browse files
committed
build: add conflict marker check during CI lint
PR-URL: #7625 Reviewed-By: Rod Vagg <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
1 parent 814b8c3 commit 68b966b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

‎Makefile‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,16 @@ cpplint:
706706

707707
ifneq ("","$(wildcard tools/eslint/bin/eslint.js)")
708708
lint: jslint cpplint
709+
CONFLICT_RE=^>>>>>>> [0-9A-Fa-f]+|^<<<<<<< [A-Za-z]+
709710
lint-ci: jslint-ci cpplint
711+
@if ! ( grep -IEqrs "$(CONFLICT_RE)" benchmark deps doc lib src test tools ) \
712+
&&! ( find . -maxdepth 1 -type f | xargs grep -IEqs "$(CONFLICT_RE)" );then\
713+
exit 0 ;\
714+
else\
715+
echo"">&2;\
716+
echo"Conflict marker detected in one or more files. Please fix them first.">&2;\
717+
exit 1 ;\
718+
fi
710719
else
711720
lint:
712721
@echo "Linting is not available through the source tarball."

0 commit comments

Comments
(0)