diff options
author | Joel Challis <git@zvecr.com> | 2022-01-03 22:42:15 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-03 22:42:15 +0000 |
commit | 550c9a315f146bc30fc828726d977f3f41477d52 (patch) | |
tree | b90df49435ac4e6841d4a5c937ab15e05c3deba7 /lib/python/qmk/cli | |
parent | aea71554234cce71f9f9d4087253e53d2729f9a7 (diff) | |
download | qmk_firmware-550c9a315f146bc30fc828726d977f3f41477d52.tar.gz qmk_firmware-550c9a315f146bc30fc828726d977f3f41477d52.zip |
Refix "No C files in filelist: None" (#15728)
Diffstat (limited to 'lib/python/qmk/cli')
-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: |