From 71f84b5e6cb331bda6672bfc13aca7b63a95215f Mon Sep 17 00:00:00 2001 From: Brian White Date: Fri, 8 Jul 2016 19:22:46 -0400 Subject: [PATCH] build: add conflict marker check during CI lint PR-URL: https://github.com/nodejs/node/pull/7625 Reviewed-By: Rod Vagg Reviewed-By: Jeremiah Senkpiel Reviewed-By: Ben Noordhuis --- Makefile | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Makefile b/Makefile index fe058a5b7ec890..1bf61ddded100d 100644 --- a/Makefile +++ b/Makefile @@ -706,7 +706,16 @@ cpplint: ifneq ("","$(wildcard tools/eslint/bin/eslint.js)") lint: jslint cpplint +CONFLICT_RE=^>>>>>>> [0-9A-Fa-f]+|^<<<<<<< [A-Za-z]+ lint-ci: jslint-ci cpplint + @if ! ( grep -IEqrs "$(CONFLICT_RE)" benchmark deps doc lib src test tools ) \ + && ! ( find . -maxdepth 1 -type f | xargs grep -IEqs "$(CONFLICT_RE)" ); then \ + exit 0 ; \ + else \ + echo "" >&2 ; \ + echo "Conflict marker detected in one or more files. Please fix them first." >&2 ; \ + exit 1 ; \ + fi else lint: @echo "Linting is not available through the source tarball."