From f8dd3e80ac78a38146ce0c5ff76612d529233e94 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 +++++++++ vcbuild.bat | 1 - 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 7be62c7825f5dd..93f51a6ae7e5e6 100644 --- a/Makefile +++ b/Makefile @@ -677,7 +677,16 @@ cpplint: lint: jslint cpplint +CONFLICT_RE=^>>>>>>> [0-9A-Fa-f]+|^<<<<<<< [A-Za-z]+ lint-ci: lint + @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 .PHONY: lint cpplint jslint bench clean docopen docclean doc dist distclean \ check uninstall install install-includes install-bin all staticlib \ diff --git a/vcbuild.bat b/vcbuild.bat index 2f25e9a563125a..ee8468b300a4c6 100644 --- a/vcbuild.bat +++ b/vcbuild.bat @@ -342,7 +342,6 @@ goto jslint :jslint if not defined jslint goto exit echo running jslint -<<<<<<< d1e2db2a13ddc9fb2f8cd1400b52656910d7374f %config%\node tools\eslint\bin\eslint.js benchmark lib src test tools --rulesdir tools\eslint-rules goto exit