summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Challis <git@zvecr.com>2020-12-10 19:02:41 +0000
committerDrashna Jael're <drashna@live.com>2021-01-12 22:46:07 -0800
commit63d0fe05bbbb1ad8b0a5af90bccba48d6f06f2bb (patch)
tree1f648450ebef4b3961587c9116eff0c5d1f1fd45
parent5a9849c70c5f0d088e12b0cd55ff7dfe915ed0d1 (diff)
Fix warning logic when running 'qmk format -a' (#11177)
-rw-r--r--lib/python/qmk/cli/cformat.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/python/qmk/cli/cformat.py b/lib/python/qmk/cli/cformat.py
index 6bcd15a110..5aab31843c 100644
--- a/lib/python/qmk/cli/cformat.py
+++ b/lib/python/qmk/cli/cformat.py
@@ -23,8 +23,6 @@ def cformat_run(files, all_files):
if not files:
cli.log.warn('No changes detected. Use "qmk cformat -a" to format all files')
return False
- if files and all_files:
- cli.log.warning('Filenames passed with -a, only formatting: %s', ','.join(files))
subprocess.run(clang_format + [file for file in files], check=True)
cli.log.info('Successfully formatted the C code.')
@@ -48,6 +46,8 @@ def cformat(cli):
# Find the list of files to format
if cli.args.files:
files.extend(normpath(file) for file in cli.args.files)
+ if cli.args.all_files:
+ cli.log.warning('Filenames passed with -a, only formatting: %s', ','.join(map(str, files)))
# If -a is specified
elif cli.args.all_files:
all_files = c_source_files(core_dirs)