mirror of
https://github.com/google/styleguide.git
synced 2024-03-22 13:11:43 +08:00
Make "root" flag configurable via CPPLINT.CFG
This commit is contained in:
parent
175866f6c4
commit
2322e4ffaa
7
cpplint/cpplint.py
vendored
7
cpplint/cpplint.py
vendored
|
@ -142,6 +142,7 @@ Syntax: cpplint.py [--verbose=#] [--output=vs7] [--filter=-x,+y,...]
|
|||
filter=+filter1,-filter2,...
|
||||
exclude_files=regex
|
||||
linelength=80
|
||||
root=subdir
|
||||
|
||||
"set noparent" option prevents cpplint from traversing directory tree
|
||||
upwards looking for more .cfg files in parent directories. This option
|
||||
|
@ -157,6 +158,9 @@ Syntax: cpplint.py [--verbose=#] [--output=vs7] [--filter=-x,+y,...]
|
|||
|
||||
"linelength" allows to specify the allowed line length for the project.
|
||||
|
||||
The "root" option is similar in function to the --root flag (see example
|
||||
above).
|
||||
|
||||
CPPLINT.cfg has an effect on files in the same directory and all
|
||||
sub-directories, unless overridden by a nested configuration file.
|
||||
|
||||
|
@ -6103,6 +6107,9 @@ def ProcessConfigOverrides(filename):
|
|||
_line_length = int(val)
|
||||
except ValueError:
|
||||
sys.stderr.write('Line length must be numeric.')
|
||||
elif name == 'root':
|
||||
global _root
|
||||
_root = val
|
||||
else:
|
||||
sys.stderr.write(
|
||||
'Invalid configuration option (%s) in file %s\n' %
|
||||
|
|
Loading…
Reference in New Issue
Block a user