Added cpplint.py output format for eclipse

Patch by mcasas@chromium.org
CR: https://codereview.chromium.org/16140002/
This commit is contained in:
erg@google.com 2013-05-28 21:34:34 +00:00
parent 4d70a88efd
commit 02c27fd836

7
cpplint/cpplint.py vendored
View File

@ -875,6 +875,9 @@ def Error(filename, linenum, category, confidence, message):
if _cpplint_state.output_format == 'vs7':
sys.stderr.write('%s(%s): %s [%s] [%d]\n' % (
filename, linenum, message, category, confidence))
elif _cpplint_state.output_format == 'eclipse':
sys.stderr.write('%s:%s: warning: %s [%s] [%d]\n' % (
filename, linenum, message, category, confidence))
else:
sys.stderr.write('%s:%s: %s [%s] [%d]\n' % (
filename, linenum, message, category, confidence))
@ -3970,8 +3973,8 @@ def ParseArguments(args):
if opt == '--help':
PrintUsage(None)
elif opt == '--output':
if not val in ('emacs', 'vs7'):
PrintUsage('The only allowed output formats are emacs and vs7.')
if not val in ('emacs', 'vs7', 'eclipse'):
PrintUsage('The only allowed output formats are emacs, vs7 and eclipse.')
output_format = val
elif opt == '--verbose':
verbosity = int(val)