From 03eb253fadbdfd24088c84184268d68a3255d3a5 Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Tue, 25 Sep 2018 08:43:10 +0200 Subject: [PATCH 1/2] tools: fix cpplint --quiet option Currently, the --quiet option for cpplint will generate the following error: $ tools/cpplint.py --quiet src/node.cc Traceback (most recent call last): File "tools/cpplint.py", line 6529, in main() File "tools/cpplint.py", line 6497, in main filenames = ParseArguments(sys.argv[1:]) File "tools/cpplint.py", line 6437, in ParseArguments logger.addHandler(logging.FileHandler(val, mode='wb')) File "/python2.7/logging/__init__.py", line 911, in __init__ StreamHandler.__init__(self, self._open()) File "/python2.7/logging/__init__.py", line 941, in _open stream = open(self.baseFilename, self.mode) IOError: [Errno 21] Is a directory: '/Users/danielbevenius/work/nodejs/node This commit moves the FileHandler that currently exists in the quiet option to the logfile clause. It looks like this issue came about when merging in commit fee4d3ab90365aaff0d3469076c7ef8a3a91bc79 ("tools: merge custom cpplint with cpplint v1.3.0"). --- tools/cpplint.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/cpplint.py b/tools/cpplint.py index 8afcae72a3d833..f31ce284b52fe0 100755 --- a/tools/cpplint.py +++ b/tools/cpplint.py @@ -6429,11 +6429,10 @@ def ParseArguments(args): except ValueError: PrintUsage('Extensions must be comma seperated list.') elif opt == '--recursive': - PrintUsage('Extensions must be comma separated list.') - elif opt == '--logfile': recursive = True - elif opt == '--quiet': + elif opt == '--logfile': logger.addHandler(logging.FileHandler(val, mode='wb')) + elif opt == '--quiet': global _quiet _quiet = True From f9f9610372b1cadf5941a9075bf67441aff6ee71 Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Tue, 25 Sep 2018 08:51:20 +0200 Subject: [PATCH 2/2] build: add --quiet to lint-cpp This commit adds the --quiet flag to cpplint to avoid informational output like: Done processing src/node.cc ... --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 94f31afa58b80b..9d4e290842c4ec 100644 --- a/Makefile +++ b/Makefile @@ -1199,7 +1199,7 @@ lint-cpp: tools/.cpplintstamp tools/.cpplintstamp: $(LINT_CPP_FILES) @echo "Running C++ linter..." - @$(PYTHON) tools/cpplint.py $? + @$(PYTHON) tools/cpplint.py --quiet $? @$(PYTHON) tools/check-imports.py @touch $@