Skip to content

Commit ef00e5c

Browse files
danbevtargos
authored andcommitted
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 fee4d3a ("tools: merge custom cpplint with cpplint v1.3.0"). PR-URL: #23075 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
1 parent 1cbc2ee commit ef00e5c

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

tools/cpplint.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -6429,11 +6429,10 @@ def ParseArguments(args):
64296429
except ValueError:
64306430
PrintUsage('Extensions must be comma seperated list.')
64316431
elif opt == '--recursive':
6432-
PrintUsage('Extensions must be comma separated list.')
6433-
elif opt == '--logfile':
64346432
recursive = True
6435-
elif opt == '--quiet':
6433+
elif opt == '--logfile':
64366434
logger.addHandler(logging.FileHandler(val, mode='wb'))
6435+
elif opt == '--quiet':
64376436
global _quiet
64386437
_quiet = True
64396438

0 commit comments

Comments
 (0)