aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorErovia <Erovia@users.noreply.github.com>2021-07-23 21:41:33 +0100
committerGitHub <noreply@github.com>2021-07-23 21:41:33 +0100
commitfdcea0633657fba4cebcef45eee2f103d162e28c (patch)
tree6d547e2154fa55aea125bc6fc08420c18c8f232a /lib
parent164a74a078722cc488526c0c8fcbc4e1b54a5780 (diff)
downloadqmk_firmware-fdcea0633657fba4cebcef45eee2f103d162e28c.tar.gz
qmk_firmware-fdcea0633657fba4cebcef45eee2f103d162e28c.zip
CLI/Docs: Fix the format commands' name (#13668)
PR #13296 changed the name of the `cformat` and `pyformat` commands to `format-c` and `format-py` respectively. This PR updates the documentation and some parts of the CLI to use the new names. Also add documentation for the new `format-text` subcommand, introduced in the same PR.
Diffstat (limited to 'lib')
-rw-r--r--lib/python/qmk/cli/format/c.py2
-rw-r--r--lib/python/qmk/tests/test_cli_commands.py12
2 files changed, 7 insertions, 7 deletions
diff --git a/lib/python/qmk/cli/format/c.py b/lib/python/qmk/cli/format/c.py
index 699de8d49..b7263e19f 100644
--- a/lib/python/qmk/cli/format/c.py
+++ b/lib/python/qmk/cli/format/c.py
@@ -127,7 +127,7 @@ def format_c(cli):
127 127
128 # Sanity check 128 # Sanity check
129 if not files: 129 if not files:
130 cli.log.error('No changed files detected. Use "qmk cformat -a" to format all core files') 130 cli.log.error('No changed files detected. Use "qmk format-c -a" to format all core files')
131 return False 131 return False
132 132
133 # Run clang-format on the files we've found 133 # Run clang-format on the files we've found
diff --git a/lib/python/qmk/tests/test_cli_commands.py b/lib/python/qmk/tests/test_cli_commands.py
index b341e1c91..022b24203 100644
--- a/lib/python/qmk/tests/test_cli_commands.py
+++ b/lib/python/qmk/tests/test_cli_commands.py
@@ -31,13 +31,13 @@ def check_returncode(result, expected=[0]):
31 assert result.returncode in expected 31 assert result.returncode in expected
32 32
33 33
34def test_cformat(): 34def test_format_c():
35 result = check_subcommand('cformat', '-n', 'quantum/matrix.c') 35 result = check_subcommand('format-c', '-n', 'quantum/matrix.c')
36 check_returncode(result) 36 check_returncode(result)
37 37
38 38
39def test_cformat_all(): 39def test_format_c_all():
40 result = check_subcommand('cformat', '-n', '-a') 40 result = check_subcommand('format-c', '-n', '-a')
41 check_returncode(result, [0, 1]) 41 check_returncode(result, [0, 1])
42 42
43 43
@@ -80,8 +80,8 @@ def test_hello():
80 assert 'Hello,' in result.stdout 80 assert 'Hello,' in result.stdout
81 81
82 82
83def test_pyformat(): 83def test_format_python():
84 result = check_subcommand('pyformat', '--dry-run') 84 result = check_subcommand('format-python', '--dry-run')
85 check_returncode(result) 85 check_returncode(result)
86 assert 'Python code in `bin/qmk` and `lib/python` is correctly formatted.' in result.stdout 86 assert 'Python code in `bin/qmk` and `lib/python` is correctly formatted.' in result.stdout
87 87