aboutsummaryrefslogtreecommitdiffstats
path: root/lib/python/qmk/cli/pyformat.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/python/qmk/cli/pyformat.py')
-rwxr-xr-xlib/python/qmk/cli/pyformat.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/python/qmk/cli/pyformat.py b/lib/python/qmk/cli/pyformat.py
index b1f8c02b2..a53ba40c0 100755
--- a/lib/python/qmk/cli/pyformat.py
+++ b/lib/python/qmk/cli/pyformat.py
@@ -5,12 +5,13 @@ from milc import cli
import subprocess
-@cli.entrypoint("Format python code according to QMK's style.")
-def main(cli):
+@cli.subcommand("Format python code according to QMK's style.")
+def pyformat(cli):
"""Format python code according to QMK's style.
"""
try:
subprocess.run(['yapf', '-vv', '-ri', 'bin/qmk', 'lib/python'], check=True)
cli.log.info('Successfully formatted the python code in `bin/qmk` and `lib/python`.')
+
except subprocess.CalledProcessError:
cli.log.error('Error formatting python code!')