diff options
Diffstat (limited to 'lib/python')
-rw-r--r-- | lib/python/qmk/cli/cformat.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/python/qmk/cli/cformat.py b/lib/python/qmk/cli/cformat.py index 17ca91b3b..fe1edef60 100644 --- a/lib/python/qmk/cli/cformat.py +++ b/lib/python/qmk/cli/cformat.py | |||
@@ -24,13 +24,14 @@ def cformat(cli): | |||
24 | if cli.args.files: | 24 | if cli.args.files: |
25 | cli.args.files = [os.path.join(os.environ['ORIG_CWD'], file) for file in cli.args.files] | 25 | cli.args.files = [os.path.join(os.environ['ORIG_CWD'], file) for file in cli.args.files] |
26 | else: | 26 | else: |
27 | ignores = ['tmk_core/protocol/usb_hid', 'quantum/template'] | ||
27 | for dir in ['drivers', 'quantum', 'tests', 'tmk_core']: | 28 | for dir in ['drivers', 'quantum', 'tests', 'tmk_core']: |
28 | for dirpath, dirnames, filenames in os.walk(dir): | 29 | for dirpath, dirnames, filenames in os.walk(dir): |
29 | if 'tmk_core/protocol/usb_hid' in dirpath: | 30 | if any(i in dirpath for i in ignores): |
30 | continue | 31 | dirnames.clear() |
31 | 32 | ||
32 | for name in filenames: | 33 | for name in filenames: |
33 | if name.endswith('.c') or name.endswith('.h') or name.endswith('.cpp'): | 34 | if name.endswith(('.c', '.h', '.cpp')): |
34 | cli.args.files.append(os.path.join(dirpath, name)) | 35 | cli.args.files.append(os.path.join(dirpath, name)) |
35 | 36 | ||
36 | # Run clang-format on the files we've found | 37 | # Run clang-format on the files we've found |