summaryrefslogtreecommitdiff
path: root/tools/cpplint.py
diff options
context:
space:
mode:
authorDaniel Bevenius <daniel.bevenius@gmail.com>2018-09-25 08:43:10 +0200
committerDaniel Bevenius <daniel.bevenius@gmail.com>2018-10-01 10:35:33 +0200
commitb8a98a807f32bf7c1a99e9a8c3f644c85b977523 (patch)
treec7d60f221b1ea008999a902ddd7726c3a85bb424 /tools/cpplint.py
parentbb00eda910b4f94959e01966b87a4d716e672dcf (diff)
downloadnode-new-b8a98a807f32bf7c1a99e9a8c3f644c85b977523.tar.gz
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 <module> 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"). PR-URL: https://github.com/nodejs/node/pull/23075 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Diffstat (limited to 'tools/cpplint.py')
-rwxr-xr-xtools/cpplint.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/tools/cpplint.py b/tools/cpplint.py
index 8afcae72a3..f31ce284b5 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