Skip to content

Commit

Permalink
Fix warning logic when running 'qmk format -a' (qmk#11177)
Browse files Browse the repository at this point in the history
  • Loading branch information
zvecr authored Dec 10, 2020
1 parent 6c4b653 commit 5b5d74a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/python/qmk/cli/cformat.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.')

Expand All @@ -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)
Expand Down

0 comments on commit 5b5d74a

Please sign in to comment.