Skip to content

Commit

Permalink
Added support for 'linelength' setting in CPPLINT.cfg
Browse files Browse the repository at this point in the history
It is now possible to override the line length per project
by usign 'linelength' setting in CPPLINT.cfg.

[email protected]

Review URL: https://codereview.appspot.com/132050043
  • Loading branch information
[email protected] committed Aug 22, 2014
1 parent a8ee7ea commit 310681b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions cpplint/cpplint.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@
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
Expand All @@ -154,6 +155,8 @@
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.
Expand Down Expand Up @@ -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' %
Expand Down

0 comments on commit 310681b

Please sign in to comment.