src/clint.py: improve "Ignoring" message

It was a bit confusing for me when seeing it myself the first time.

[ci skip]
This commit is contained in:
Daniel Hahler 2017-01-13 22:19:47 +01:00
parent f686635420
commit 0aa1cff604

View File

@ -3434,8 +3434,9 @@ def ProcessFile(filename, vlevel, extra_check_functions=[]):
# When reading from stdin, the extension is unknown, so no cpplint tests
# should rely on the extension.
if filename != '-' and file_extension not in _valid_extensions:
sys.stderr.write('Ignoring %s; not a valid file name '
'(%s)\n' % (filename, ', '.join(_valid_extensions)))
sys.stderr.write('Ignoring {}; only linting {} files\n'.format(
filename,
', '.join('.{}'.format(ext) for ext in _valid_extensions)))
else:
ProcessFileData(filename, file_extension, lines, Error,
extra_check_functions)