Refix "No C files in filelist: None" (#15728)
This commit is contained in:
parent
aea7155423
commit
550c9a315f
1 changed files with 4 additions and 5 deletions
|
@ -74,17 +74,16 @@ def filter_files(files, core_only=False):
|
||||||
"""Yield only files to be formatted and skip the rest
|
"""Yield only files to be formatted and skip the rest
|
||||||
"""
|
"""
|
||||||
files = list(map(normpath, filter(None, files)))
|
files = list(map(normpath, filter(None, files)))
|
||||||
|
|
||||||
|
for file in files:
|
||||||
if core_only:
|
if core_only:
|
||||||
# Filter non-core files
|
|
||||||
for index, file in enumerate(files):
|
|
||||||
# The following statement checks each file to see if the file path is
|
# The following statement checks each file to see if the file path is
|
||||||
# - in the core directories
|
# - in the core directories
|
||||||
# - not in the ignored directories
|
# - not in the ignored directories
|
||||||
if not any(is_relative_to(file, i) for i in core_dirs) or any(is_relative_to(file, i) for i in ignored):
|
if not any(is_relative_to(file, i) for i in core_dirs) or any(is_relative_to(file, i) for i in ignored):
|
||||||
del files[index]
|
|
||||||
cli.log.debug("Skipping non-core file %s, as '--core-only' is used.", file)
|
cli.log.debug("Skipping non-core file %s, as '--core-only' is used.", file)
|
||||||
|
continue
|
||||||
|
|
||||||
for file in files:
|
|
||||||
if file.suffix[1:] in c_file_suffixes:
|
if file.suffix[1:] in c_file_suffixes:
|
||||||
yield file
|
yield file
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue