depot_tools: update cpplint.py to r137

Implements 'linelength' option in CPPLINT.cfg.
See:
https://code.google.com/p/google-styleguide/source/browse/trunk/cpplint/cpplint.py?r=137

BUG=None
TEST=None

Change-Id: I7b017078d997dfafc524a2f50a32289391d011f9

Review URL: https://codereview.chromium.org/495413002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@291601 0039d316-1c4b-4281-b951-d872f2087c98
changes/01/332501/1
avakulenko@google.com 11 years ago
parent 808bcfbad4
commit 68a4fa6a7d

9
cpplint.py vendored

@ -141,6 +141,7 @@ Syntax: cpplint.py [--verbose=#] [--output=vs7] [--filter=-x,+y,...]
set noparent
filter=+filter1,-filter2,...
exclude_files=regex
linelength=80
"set noparent" option prevents cpplint from traversing directory tree
upwards looking for more .cfg files in parent directories. This option
@ -154,6 +155,8 @@ Syntax: cpplint.py [--verbose=#] [--output=vs7] [--filter=-x,+y,...]
a file name. If the expression matches, the file is skipped and not run
through liner.
"linelength" allows to specify the allowed line length for the project.
CPPLINT.cfg has an effect on files in the same directory and all
sub-directories, unless overridden by a nested configuration file.
@ -5915,6 +5918,12 @@ def ProcessConfigOverrides(filename):
'pattern "%s"\n' %
(filename, cfg_file, base_name, val))
return False
elif name == 'linelength':
global _line_length
try:
_line_length = int(val)
except ValueError:
sys.stderr.write('Line length must be numeric.')
else:
sys.stderr.write(
'Invalid configuration option (%s) in file %s\n' %

Loading…
Cancel
Save