Commit 91a32c5e authored by Jordan Bayles's avatar Jordan Bayles Committed by Commit Bot

CppLint changes for VSCode cpplint plugin

This patch makes some changes to the cpplint.py script for integration
with the VSCode cpplint plugin, available here:

https://marketplace.visualstudio.com/items?itemName=mine.cpplint

Specifically, the "--repository" and "--headers" options currently cause
our version of cpplint to crash, when we should at worst ignore them. A
minor messaging tweak outputting the contents of the GetoptError, to
make debugging input argument bugs easier, is included

Change-Id: Id78616f5e2fdecb7da650042f0658623477ef9cb
Reviewed-on: https://chromium-review.googlesource.com/c/1481938Reviewed-by: 's avatarEdward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Jordan Bayles <jophba@chromium.org>
parent ac0cb2c1
......@@ -6004,14 +6004,16 @@ def ParseArguments(args):
"""
try:
(opts, filenames) = getopt.getopt(args, '', ['help', 'output=', 'verbose=',
'headers=', # We understand but ignore headers.
'counting=',
'filter=',
'root=',
'linelength=',
'extensions=',
'project_root='])
except getopt.GetoptError:
PrintUsage('Invalid arguments.')
'project_root=',
'repository='])
except getopt.GetoptError as e:
PrintUsage('Invalid arguments: {}'.format(e))
verbosity = _VerboseLevel()
output_format = _OutputFormat()
......@@ -6038,7 +6040,7 @@ def ParseArguments(args):
elif opt == '--root':
global _root
_root = val
elif opt == '--project_root':
elif opt == '--project_root' or opt == "--repository":
global _project_root
_project_root = val
if not os.path.isabs(_project_root):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment