diff options
Diffstat (limited to 'lib/python')
-rw-r--r-- | lib/python/qmk/cli/format/c.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/python/qmk/cli/format/c.py b/lib/python/qmk/cli/format/c.py index fe2f97da9..8eb7fa1ed 100644 --- a/lib/python/qmk/cli/format/c.py +++ b/lib/python/qmk/cli/format/c.py | |||
@@ -74,17 +74,16 @@ def filter_files(files, core_only=False): | |||
74 | """Yield only files to be formatted and skip the rest | 74 | """Yield only files to be formatted and skip the rest |
75 | """ | 75 | """ |
76 | files = list(map(normpath, filter(None, files))) | 76 | files = list(map(normpath, filter(None, files))) |
77 | if core_only: | 77 | |
78 | # Filter non-core files | 78 | for file in files: |
79 | for index, file in enumerate(files): | 79 | if core_only: |
80 | # The following statement checks each file to see if the file path is | 80 | # The following statement checks each file to see if the file path is |
81 | # - in the core directories | 81 | # - in the core directories |
82 | # - not in the ignored directories | 82 | # - not in the ignored directories |
83 | if not any(is_relative_to(file, i) for i in core_dirs) or any(is_relative_to(file, i) for i in ignored): | 83 | if not any(is_relative_to(file, i) for i in core_dirs) or any(is_relative_to(file, i) for i in ignored): |
84 | del files[index] | ||
85 | cli.log.debug("Skipping non-core file %s, as '--core-only' is used.", file) | 84 | cli.log.debug("Skipping non-core file %s, as '--core-only' is used.", file) |
85 | continue | ||
86 | 86 | ||
87 | for file in files: | ||
88 | if file.suffix[1:] in c_file_suffixes: | 87 | if file.suffix[1:] in c_file_suffixes: |
89 | yield file | 88 | yield file |
90 | else: | 89 | else: |