Преглед на файлове

Fix warning logic when running 'qmk format -a' (#11177)

Joel Challis преди 4 години
родител
ревизия
5b5d74a267
променени са 1 файла, в които са добавени 2 реда и са изтрити 2 реда
  1. 2 2
      lib/python/qmk/cli/cformat.py

+ 2 - 2
lib/python/qmk/cli/cformat.py

@@ -23,8 +23,6 @@ def cformat_run(files, all_files):
         if not files:
         if not files:
             cli.log.warn('No changes detected. Use "qmk cformat -a" to format all files')
             cli.log.warn('No changes detected. Use "qmk cformat -a" to format all files')
             return False
             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)
         subprocess.run(clang_format + [file for file in files], check=True)
         cli.log.info('Successfully formatted the C code.')
         cli.log.info('Successfully formatted the C code.')
 
 
@@ -48,6 +46,8 @@ def cformat(cli):
     # Find the list of files to format
     # Find the list of files to format
     if cli.args.files:
     if cli.args.files:
         files.extend(normpath(file) for file in 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
     # If -a is specified
     elif cli.args.all_files:
     elif cli.args.all_files:
         all_files = c_source_files(core_dirs)
         all_files = c_source_files(core_dirs)