Browse Source

build: add conflict marker check during CI lint

PR-URL: https://github.com/nodejs/node/pull/7625
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
v7.x
Brian White 9 years ago
parent
commit
68b966b2de
No known key found for this signature in database GPG Key ID: 606D7358F94DA209
  1. 9
      Makefile

9
Makefile

@ -706,7 +706,16 @@ cpplint:
ifneq ("","$(wildcard tools/eslint/bin/eslint.js)") ifneq ("","$(wildcard tools/eslint/bin/eslint.js)")
lint: jslint cpplint lint: jslint cpplint
CONFLICT_RE=^>>>>>>> [0-9A-Fa-f]+|^<<<<<<< [A-Za-z]+
lint-ci: jslint-ci cpplint 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 else
lint: lint:
@echo "Linting is not available through the source tarball." @echo "Linting is not available through the source tarball."

Loading…
Cancel
Save