From fdcea0633657fba4cebcef45eee2f103d162e28c Mon Sep 17 00:00:00 2001 From: Erovia Date: Fri, 23 Jul 2021 21:41:33 +0100 Subject: 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. --- lib/python/qmk/cli/format/c.py | 2 +- lib/python/qmk/tests/test_cli_commands.py | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'lib') diff --git a/lib/python/qmk/cli/format/c.py b/lib/python/qmk/cli/format/c.py index 699de8d49c..b7263e19f3 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): # Sanity check if not files: - cli.log.error('No changed files detected. Use "qmk cformat -a" to format all core files') + cli.log.error('No changed files detected. Use "qmk format-c -a" to format all core files') return False # 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 b341e1c912..022b242034 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]): assert result.returncode in expected -def test_cformat(): - result = check_subcommand('cformat', '-n', 'quantum/matrix.c') +def test_format_c(): + result = check_subcommand('format-c', '-n', 'quantum/matrix.c') check_returncode(result) -def test_cformat_all(): - result = check_subcommand('cformat', '-n', '-a') +def test_format_c_all(): + result = check_subcommand('format-c', '-n', '-a') check_returncode(result, [0, 1]) @@ -80,8 +80,8 @@ def test_hello(): assert 'Hello,' in result.stdout -def test_pyformat(): - result = check_subcommand('pyformat', '--dry-run') +def test_format_python(): + result = check_subcommand('format-python', '--dry-run') check_returncode(result) assert 'Python code in `bin/qmk` and `lib/python` is correctly formatted.' in result.stdout -- cgit v1.2.3