Fix 'format-c --core-only' matching keyboard level folders (#15337)

This commit is contained in:
Joel Challis 2021-11-29 15:08:39 +00:00 committed by GitHub
parent db04899a4a
commit 285afa3a8a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -74,7 +74,7 @@ def filter_files(files, core_only=False):
# The following statement checks each file to see if the file path is
# - in the core directories
# - not in the ignored directories
if not any(i in str(file) for i in core_dirs) or any(i in str(file) for i in ignored):
if not any(str(file).startswith(i) for i in core_dirs) or any(str(file).startswith(i) for i in ignored):
files[index] = None
cli.log.debug("Skipping non-core file %s, as '--core-only' is used.", file)