cpplint: make it possible to run outside git repo
authorBen Noordhuis <info@bnoordhuis.nl>
Sat, 5 Sep 2015 13:44:21 +0000 (15:44 +0200)
committerRod Vagg <rod@vagg.org>
Mon, 7 Sep 2015 02:01:37 +0000 (12:01 +1000)
commit371193409559d9742589520ee13bb27808dcee49
tree483b98767e4d6ab45ed6aa7f00e430472794529a
parentb2c3c6d727c5214aed6e09b638a9ab329c2f2a3b
cpplint: make it possible to run outside git repo

cpplint uses the top-level .git directory to determine what the root is
for #include guards.  If it doesn't find a .git directory, it walks up
all the way to the system root and subsequently complains that guards
must be written as HOME_USER_SRC_NODE_SRC_FILENAME_H_.

This commit replaces the .git-based path munging with a fixed root path
relative to the location of the cpplint script, making it possible to
successfully run `make test` from an extracted tarball.

Fixes: https://github.com/nodejs/node/issues/2693
PR-URL: https://github.com/nodejs/node/pull/2710
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
tools/cpplint.py