From 84966670d8335374db28d81a1ce9a502fd75ad97 Mon Sep 17 00:00:00 2001 From: Lars Erik Wik Date: Thu, 5 Jun 2025 09:10:08 +0200 Subject: [PATCH 1/3] Fixed string having 1 placeholder but 2 substitutions E.g., the following causes a traceback, due to operator precedence. ``` >>> "%s " + "%s" % ("Hello", "CFEngine") Traceback (most recent call last): File "", line 1, in ``` Signed-off-by: Lars Erik Wik --- cfbs/commands.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cfbs/commands.py b/cfbs/commands.py index 0e708e93..77b99da0 100644 --- a/cfbs/commands.py +++ b/cfbs/commands.py @@ -780,8 +780,8 @@ def update_command(to_update): input_data = read_json(input_path) if input_data == None: log.debug( - "Skipping input update for module '%s': " - + "No input found in '%s'" % (module["name"], input_path) + "Skipping input update for module '%s': " % module["name"] + + "No input found in '%s'" % input_path ) else: try: From 797512b46b2e4bf64691e2a6c9cede0c7d156877 Mon Sep 17 00:00:00 2001 From: Lars Erik Wik Date: Thu, 5 Jun 2025 09:16:27 +0200 Subject: [PATCH 2/3] Removed redefention of get_args from line 14 Signed-off-by: Lars Erik Wik --- cfbs/commands.py | 1 - 1 file changed, 1 deletion(-) diff --git a/cfbs/commands.py b/cfbs/commands.py index 77b99da0..dfcac261 100644 --- a/cfbs/commands.py +++ b/cfbs/commands.py @@ -30,7 +30,6 @@ is_a_commit_hash, ) -from cfbs.args import get_args from cfbs.pretty import ( pretty, pretty_check_file, From cb29aa4a1fec487832d414b9e45cd89eef8cd4ac Mon Sep 17 00:00:00 2001 From: Lars Erik Wik Date: Thu, 5 Jun 2025 09:21:11 +0200 Subject: [PATCH 3/3] commands.py: Removed unused imports - cfbs.pretty.MODULE_KEYS - cfbs.pretty.TOP_LEVEL_KEYS - cfbs.git.git_commit Signed-off-by: Lars Erik Wik --- cfbs/commands.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/cfbs/commands.py b/cfbs/commands.py index dfcac261..dd6909cf 100644 --- a/cfbs/commands.py +++ b/cfbs/commands.py @@ -35,8 +35,6 @@ pretty_check_file, pretty_file, CFBS_DEFAULT_SORTING_RULES, - TOP_LEVEL_KEYS, - MODULE_KEYS, ) from cfbs.build import ( init_out_folder, @@ -54,7 +52,6 @@ from cfbs.git import ( git_exists, is_git_repo, - git_commit, git_get_config, git_set_config, git_init,