Merge pull request #5941 from blueyed/better-clint-note

src/clint.py: improve "Ignoring" message
This commit is contained in:
James McCoy 2017-01-13 20:47:41 -05:00 committed by GitHub
commit 947f1ebcb9

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)