From 48698b43c7bba4a5a14c21d17bdd4e56df4ecfa0 Mon Sep 17 00:00:00 2001 From: "F.Tibor" Date: Mon, 24 Nov 2025 14:29:30 +0100 Subject: [PATCH 01/11] Extend config handling to yaml files in the monolithic rule --- src/codechecker.bzl | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/src/codechecker.bzl b/src/codechecker.bzl index a3ebd009..8cb1b24e 100644 --- a/src/codechecker.bzl +++ b/src/codechecker.bzl @@ -75,16 +75,16 @@ codechecker_config = rule( }, ) -def _copy_config_to_default(config_file, ctx): +def _copy_config_to_default(config_file, ctx_config_file, ctx): ctx.actions.run( inputs = [config_file], - outputs = [ctx.outputs.codechecker_config], + outputs = [ctx_config_file], mnemonic = "CopyFile", progress_message = "Copying CodeChecker config file", executable = "cp", arguments = [ config_file.path, - ctx.outputs.codechecker_config.path, + ctx_config_file.path, ], ) @@ -129,6 +129,20 @@ def _codechecker_impl(ctx): is_executable = False, ) + # Decide whether to use json or yaml for configuration + config_file_name = "config.json" + if ctx.attr.config: + if type(ctx.attr.config) == "list": + config_info = ctx.attr.config[0][CodeCheckerConfigInfo] + else: + config_info = ctx.attr.config[CodeCheckerConfigInfo] + if config_info.config_file: + # Create a copy of CodeChecker configuration file + # provided via codechecker_config(config_file) + config_file = config_info.config_file.files.to_list()[0] + config_file_name = "config." + config_file.extension + ctx_config_file = ctx.actions.declare_file(config_file_name) + # Create CodeChecker JSON config file and env vars if ctx.attr.config: if type(ctx.attr.config) == "list": @@ -139,7 +153,7 @@ def _codechecker_impl(ctx): # Create a copy of CodeChecker configuration file # provided via codechecker_config(config_file) config_file = config_info.config_file.files.to_list()[0] - _copy_config_to_default(config_file, ctx) + _copy_config_to_default(config_file, ctx_config_file, ctx) else: # Create CodeChecker configuration file in JSON format # from Bazel codechecker_config(analyze, parse) @@ -150,7 +164,7 @@ def _codechecker_impl(ctx): config_json["parse"] = config_info.parse config_content = json.encode_indent(config_json) ctx.actions.write( - output = ctx.outputs.codechecker_config, + output = ctx_config_file, content = config_content, is_executable = False, ) @@ -160,7 +174,7 @@ def _codechecker_impl(ctx): else: # Empty CodeChecker JSON config file ctx.actions.write( - output = ctx.outputs.codechecker_config, + output = ctx_config_file, content = "{}", is_executable = False, ) @@ -178,7 +192,7 @@ def _codechecker_impl(ctx): "{codechecker_bin}": CODECHECKER_BIN_PATH, "{compile_commands}": ctx.outputs.codechecker_commands.path, "{codechecker_skipfile}": ctx.outputs.codechecker_skipfile.path, - "{codechecker_config}": ctx.outputs.codechecker_config.path, + "{codechecker_config}": ctx_config_file.path, "{codechecker_analyze}": " ".join(ctx.attr.analyze), "{codechecker_files}": codechecker_files.path, "{codechecker_log}": ctx.outputs.codechecker_log.path, @@ -192,7 +206,7 @@ def _codechecker_impl(ctx): ctx.outputs.codechecker_script, ctx.outputs.codechecker_commands, ctx.outputs.codechecker_skipfile, - ctx.outputs.codechecker_config, + ctx_config_file, ] + source_files, ), outputs = [ @@ -211,7 +225,7 @@ def _codechecker_impl(ctx): ctx.outputs.compile_commands, ctx.outputs.codechecker_commands, ctx.outputs.codechecker_skipfile, - ctx.outputs.codechecker_config, + ctx_config_file, codechecker_files, ctx.outputs.codechecker_script, ctx.outputs.codechecker_log, @@ -273,7 +287,6 @@ codechecker = rule( "compile_commands": "%{name}/compile_commands.json", "codechecker_commands": "%{name}/codechecker_commands.json", "codechecker_skipfile": "%{name}/codechecker_skipfile.cfg", - "codechecker_config": "%{name}/codechecker_config.json", "codechecker_script": "%{name}/codechecker_script.py", "codechecker_log": "%{name}/codechecker.log", }, @@ -378,7 +391,6 @@ _codechecker_test = rule( "compile_commands": "%{name}/compile_commands.json", "codechecker_commands": "%{name}/codechecker_commands.json", "codechecker_skipfile": "%{name}/codechecker_skipfile.cfg", - "codechecker_config": "%{name}/codechecker_config.json", "codechecker_script": "%{name}/codechecker_script.py", "codechecker_log": "%{name}/codechecker.log", "codechecker_test_script": "%{name}/codechecker_test_script.py", @@ -406,6 +418,7 @@ def codechecker_test( name = name, targets = targets, options = analyze, + config = config, tags = tags, **kwargs ) From 3ea8d9c83d5d539da1bd4726c9d147bedc8ec58e Mon Sep 17 00:00:00 2001 From: "F.Tibor" Date: Mon, 24 Nov 2025 16:08:17 +0100 Subject: [PATCH 02/11] Create separate file and method for configs --- src/codechecker_config.bzl | 123 +++++++++++++++++++++++++++++++++++++ 1 file changed, 123 insertions(+) create mode 100644 src/codechecker_config.bzl diff --git a/src/codechecker_config.bzl b/src/codechecker_config.bzl new file mode 100644 index 00000000..b99185f8 --- /dev/null +++ b/src/codechecker_config.bzl @@ -0,0 +1,123 @@ +# Copyright 2023 Ericsson AB +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +def get_config_file(ctx): + """ + Returns (config_file, environment_variables) + config_file is a file object that is readable during Codechecker execution + """ + # Decide whether to use json or yaml for configuration + config_file_name = "config.json" + if ctx.attr.config: + if type(ctx.attr.config) == "list": + config_info = ctx.attr.config[0][CodeCheckerConfigInfo] + else: + config_info = ctx.attr.config[CodeCheckerConfigInfo] + if config_info.config_file: + # Create a copy of CodeChecker configuration file + # provided via codechecker_config(config_file) + config_file = config_info.config_file.files.to_list()[0] + config_file_name = "config." + config_file.extension + ctx_config_file = ctx.actions.declare_file(config_file_name) + + # Create CodeChecker JSON config file and env vars + if ctx.attr.config: + if type(ctx.attr.config) == "list": + config_info = ctx.attr.config[0][CodeCheckerConfigInfo] + else: + config_info = ctx.attr.config[CodeCheckerConfigInfo] + if config_info.config_file: + # Create a copy of CodeChecker configuration file + # provided via codechecker_config(config_file) + config_file = config_info.config_file.files.to_list()[0] + ctx.actions.run( + inputs = [config_file], + outputs = [ctx_config_file], + mnemonic = "CopyFile", + progress_message = "Copying CodeChecker config file", + executable = "cp", + arguments = [ + config_file.path, + ctx_config_file.path, + ], + ) + else: + # Create CodeChecker configuration file in JSON format + # from Bazel codechecker_config(analyze, parse) + config_json = {} + if config_info.analyze: + config_json["analyze"] = config_info.analyze + if config_info.parse: + config_json["parse"] = config_info.parse + config_content = json.encode_indent(config_json) + ctx.actions.write( + output = ctx_config_file, + content = config_content, + is_executable = False, + ) + + # Pack env vars for CodeChecker + codechecker_env = "; ".join(config_info.env) + else: + # Empty CodeChecker JSON config file + ctx.actions.write( + output = ctx_config_file, + content = "{}", + is_executable = False, + ) + codechecker_env = "" + return (ctx_config_file, codechecker_env) + +CodeCheckerConfigInfo = provider( + doc = "Defines CodeChecker configuration", + fields = { + "analyze": "List of arguments for CodeChecker analyze command", + "parse": "List of arguments for CodeChecker parse command", + "config_file": "CodeChecker configuration file in JSON format", + "env": "Environment variables for CodeChecker", + }, +) + +def _codechecker_config_impl(ctx): + return [ + CodeCheckerConfigInfo( + analyze = ctx.attr.analyze, + parse = ctx.attr.parse, + config_file = ctx.attr.config_file, + env = ctx.attr.env, + ), + ] + +codechecker_config = rule( + implementation = _codechecker_config_impl, + attrs = { + "analyze": attr.string_list( + default = [], + doc = "List of arguments for CodeChecker analyze command", + ), + "parse": attr.string_list( + default = [], + doc = "List of arguments for CodeChecker parse command", + ), + "config_file": attr.label( + default = None, + allow_single_file = True, + ), + "env": attr.string_list( + default = [], + doc = "List of environment variables for CodeChecker", + ), + }, +) From 445908c58486cce0405e2ffd326dcced4215e531 Mon Sep 17 00:00:00 2001 From: "F.Tibor" Date: Mon, 24 Nov 2025 16:08:24 +0100 Subject: [PATCH 03/11] Use config module --- src/codechecker.bzl | 98 +++------------------------------------------ src/per_file.bzl | 24 +++++++++++ 2 files changed, 29 insertions(+), 93 deletions(-) diff --git a/src/codechecker.bzl b/src/codechecker.bzl index 8cb1b24e..f4be5cd0 100644 --- a/src/codechecker.bzl +++ b/src/codechecker.bzl @@ -18,6 +18,10 @@ load( "tools.bzl", "warning" ) +load( + "@bazel_codechecker//src:codechecker_config.bzl", + "get_config_file" +) def get_platform_alias(platform): """ @@ -33,48 +37,6 @@ def get_platform_alias(platform): platform = shortname return platform -CodeCheckerConfigInfo = provider( - doc = "Defines CodeChecker configuration", - fields = { - "analyze": "List of arguments for CodeChecker analyze command", - "parse": "List of arguments for CodeChecker parse command", - "config_file": "CodeChecker configuration file in JSON format", - "env": "Environment variables for CodeChecker", - }, -) - -def _codechecker_config_impl(ctx): - return [ - CodeCheckerConfigInfo( - analyze = ctx.attr.analyze, - parse = ctx.attr.parse, - config_file = ctx.attr.config_file, - env = ctx.attr.env, - ), - ] - -codechecker_config = rule( - implementation = _codechecker_config_impl, - attrs = { - "analyze": attr.string_list( - default = [], - doc = "List of arguments for CodeChecker analyze command", - ), - "parse": attr.string_list( - default = [], - doc = "List of arguments for CodeChecker parse command", - ), - "config_file": attr.label( - default = None, - allow_single_file = True, - ), - "env": attr.string_list( - default = [], - doc = "List of environment variables for CodeChecker", - ), - }, -) - def _copy_config_to_default(config_file, ctx_config_file, ctx): ctx.actions.run( inputs = [config_file], @@ -129,57 +91,7 @@ def _codechecker_impl(ctx): is_executable = False, ) - # Decide whether to use json or yaml for configuration - config_file_name = "config.json" - if ctx.attr.config: - if type(ctx.attr.config) == "list": - config_info = ctx.attr.config[0][CodeCheckerConfigInfo] - else: - config_info = ctx.attr.config[CodeCheckerConfigInfo] - if config_info.config_file: - # Create a copy of CodeChecker configuration file - # provided via codechecker_config(config_file) - config_file = config_info.config_file.files.to_list()[0] - config_file_name = "config." + config_file.extension - ctx_config_file = ctx.actions.declare_file(config_file_name) - - # Create CodeChecker JSON config file and env vars - if ctx.attr.config: - if type(ctx.attr.config) == "list": - config_info = ctx.attr.config[0][CodeCheckerConfigInfo] - else: - config_info = ctx.attr.config[CodeCheckerConfigInfo] - if config_info.config_file: - # Create a copy of CodeChecker configuration file - # provided via codechecker_config(config_file) - config_file = config_info.config_file.files.to_list()[0] - _copy_config_to_default(config_file, ctx_config_file, ctx) - else: - # Create CodeChecker configuration file in JSON format - # from Bazel codechecker_config(analyze, parse) - config_json = {} - if config_info.analyze: - config_json["analyze"] = config_info.analyze - if config_info.parse: - config_json["parse"] = config_info.parse - config_content = json.encode_indent(config_json) - ctx.actions.write( - output = ctx_config_file, - content = config_content, - is_executable = False, - ) - - # Pack env vars for CodeChecker - codechecker_env = "; ".join(config_info.env) - else: - # Empty CodeChecker JSON config file - ctx.actions.write( - output = ctx_config_file, - content = "{}", - is_executable = False, - ) - codechecker_env = "" - + ctx_config_file, codechecker_env = get_config_file(ctx) codechecker_files = ctx.actions.declare_directory(ctx.label.name + "/codechecker-files") ctx.actions.expand_template( template = ctx.file._codechecker_script_template, diff --git a/src/per_file.bzl b/src/per_file.bzl index 22d84884..14896103 100644 --- a/src/per_file.bzl +++ b/src/per_file.bzl @@ -4,6 +4,14 @@ load("@bazel_tools//tools/build_defs/cc:action_names.bzl", "ACTION_NAMES") load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain") load("@bazel_codechecker//src:tools.bzl", "warning") +load( + "compile_commands.bzl", + "platforms_transition", +) +load( + "@bazel_codechecker//src:codechecker_config.bzl", + "get_config_file" +) def _run_code_checker( ctx, @@ -281,6 +289,7 @@ def _per_file_impl(ctx): sources_and_headers = _collect_all_sources_and_headers(ctx) options = ctx.attr.default_options + ctx.attr.options all_files = [compile_commands_json] + config_file, env_vars = get_config_file(ctx) _create_wrapper_script(ctx, options, compile_commands_json) for target in ctx.attr.targets: if not CcInfo in target: @@ -347,6 +356,19 @@ per_file_test = rule( ], doc = "List of compilable targets which should be checked.", ), + "_whitelist_function_transition": attr.label( + default = "@bazel_tools//tools/whitelists/function_transition_whitelist", + doc = "needed for transitions", + ), + "config": attr.label( + default = None, + cfg = platforms_transition, + doc = "CodeChecker configuration", + ), + "platform": attr.string( + default = "", #"@platforms//os:linux", + doc = "Platform to build for", + ), "_per_file_script_template": attr.label( default = ":per_file_script.py", allow_single_file = True, @@ -366,12 +388,14 @@ per_file_test = rule( def code_checker_test( name, targets, + config = None, options = [], tags = [], ): per_file_test( name = name, options = options, + config = config, targets = targets, tags = tags, ) From 4ba373100350090feb61d56f8766410373c9af01 Mon Sep 17 00:00:00 2001 From: "F.Tibor" Date: Mon, 24 Nov 2025 16:08:47 +0100 Subject: [PATCH 04/11] Update BUILD file --- test/unit/legacy/BUILD | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/unit/legacy/BUILD b/test/unit/legacy/BUILD index 9488855d..924db3c3 100644 --- a/test/unit/legacy/BUILD +++ b/test/unit/legacy/BUILD @@ -15,11 +15,15 @@ load( load( "@bazel_codechecker//src:codechecker.bzl", "codechecker", - "codechecker_config", "codechecker_suite", "codechecker_test", ) +load( + "@bazel_codechecker//src:codechecker_config.bzl", + "codechecker_config", +) + # clang-tidy and clang -analyze rules load( "@bazel_codechecker//src:clang.bzl", From af089594a2b3c201f41787f045bc0dc29a8eb179 Mon Sep 17 00:00:00 2001 From: "F.Tibor" Date: Mon, 24 Nov 2025 17:07:25 +0100 Subject: [PATCH 05/11] Move config file to rule named folder to avoid collisions --- src/codechecker_config.bzl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/codechecker_config.bzl b/src/codechecker_config.bzl index b99185f8..d9c876de 100644 --- a/src/codechecker_config.bzl +++ b/src/codechecker_config.bzl @@ -12,14 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. - def get_config_file(ctx): """ Returns (config_file, environment_variables) config_file is a file object that is readable during Codechecker execution """ + # Decide whether to use json or yaml for configuration - config_file_name = "config.json" + config_file_name = ctx.attr.name + "/config.json" if ctx.attr.config: if type(ctx.attr.config) == "list": config_info = ctx.attr.config[0][CodeCheckerConfigInfo] @@ -29,7 +29,8 @@ def get_config_file(ctx): # Create a copy of CodeChecker configuration file # provided via codechecker_config(config_file) config_file = config_info.config_file.files.to_list()[0] - config_file_name = "config." + config_file.extension + config_file_name = ctx.attr.name + \ + "/config." + config_file.extension ctx_config_file = ctx.actions.declare_file(config_file_name) # Create CodeChecker JSON config file and env vars From 4b823dac9378ded504b497224891ed00779316d6 Mon Sep 17 00:00:00 2001 From: "F.Tibor" Date: Mon, 24 Nov 2025 17:11:00 +0100 Subject: [PATCH 06/11] Remove unused function --- src/codechecker.bzl | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/codechecker.bzl b/src/codechecker.bzl index f4be5cd0..af569c76 100644 --- a/src/codechecker.bzl +++ b/src/codechecker.bzl @@ -37,19 +37,6 @@ def get_platform_alias(platform): platform = shortname return platform -def _copy_config_to_default(config_file, ctx_config_file, ctx): - ctx.actions.run( - inputs = [config_file], - outputs = [ctx_config_file], - mnemonic = "CopyFile", - progress_message = "Copying CodeChecker config file", - executable = "cp", - arguments = [ - config_file.path, - ctx_config_file.path, - ], - ) - def _codechecker_impl(ctx): py_runtime_info = ctx.attr._python_runtime[PyRuntimeInfo] python_path = py_runtime_info.interpreter_path From d80ba91219f3a6f0374e8c9d968087ef5c0add6e Mon Sep 17 00:00:00 2001 From: "F.Tibor" Date: Mon, 24 Nov 2025 18:27:11 +0100 Subject: [PATCH 07/11] Actually use the config file --- src/per_file.bzl | 11 ++++++++--- src/per_file_script.py | 2 ++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/per_file.bzl b/src/per_file.bzl index 14896103..32725957 100644 --- a/src/per_file.bzl +++ b/src/per_file.bzl @@ -19,6 +19,8 @@ def _run_code_checker( arguments, label, options, + config_file, + env_vars, compile_commands_json, compilation_context, sources_and_headers): @@ -35,7 +37,7 @@ def _run_code_checker( codechecker_log = ctx.actions.declare_file(codechecker_log_file_name) if "--ctu" in options: - inputs = [compile_commands_json] + sources_and_headers + inputs = [compile_commands_json, config_file] + sources_and_headers else: # NOTE: we collect only headers, so CTU may not work! headers = depset([src], transitive = [compilation_context.headers]) @@ -269,7 +271,7 @@ def _collect_all_sources_and_headers(ctx): sources_and_headers = all_files + headers.to_list() return sources_and_headers -def _create_wrapper_script(ctx, options, compile_commands_json): +def _create_wrapper_script(ctx, options, compile_commands_json, config_file): options_str = "" for item in options: options_str += item + " " @@ -281,6 +283,7 @@ def _create_wrapper_script(ctx, options, compile_commands_json): "{PythonPath}": ctx.attr._python_runtime[PyRuntimeInfo].interpreter_path, "{compile_commands_json}": compile_commands_json.path, "{codechecker_args}": options_str, + "{config_file}": config_file.path, }, ) @@ -290,7 +293,7 @@ def _per_file_impl(ctx): options = ctx.attr.default_options + ctx.attr.options all_files = [compile_commands_json] config_file, env_vars = get_config_file(ctx) - _create_wrapper_script(ctx, options, compile_commands_json) + _create_wrapper_script(ctx, options, compile_commands_json, config_file) for target in ctx.attr.targets: if not CcInfo in target: continue @@ -307,6 +310,8 @@ def _per_file_impl(ctx): args, ctx.attr.name, options, + config_file, + env_vars, compile_commands_json, compilation_context, sources_and_headers, diff --git a/src/per_file_script.py b/src/per_file_script.py index 46bd13b4..c7a2c583 100644 --- a/src/per_file_script.py +++ b/src/per_file_script.py @@ -32,6 +32,7 @@ COMPILE_COMMANDS_JSON: str = "{compile_commands_json}" COMPILE_COMMANDS_ABSOLUTE: str = f"{COMPILE_COMMANDS_JSON}.abs" CODECHECKER_ARGS: str = "{codechecker_args}" +CONFIG_FILE: str = "{config_file}" def parse_args(): @@ -104,6 +105,7 @@ def _run_codechecker() -> None: + CODECHECKER_ARGS.split() + ["--output=" + DATA_DIR] # type: ignore + ["--file=*/" + FILE_PATH] # type: ignore + + ["--config " + CONFIG_FILE] + [COMPILE_COMMANDS_ABSOLUTE] ) From 515b63f8ff5a645da00a7870b76e6e2000caf0e2 Mon Sep 17 00:00:00 2001 From: "F.Tibor" Date: Mon, 24 Nov 2025 18:40:04 +0100 Subject: [PATCH 08/11] Fix not the actual command being shown in error logs --- src/per_file_script.py | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/src/per_file_script.py b/src/per_file_script.py index c7a2c583..6adc0456 100644 --- a/src/per_file_script.py +++ b/src/per_file_script.py @@ -83,10 +83,15 @@ def _run_codechecker() -> None: """ Runs CodeChecker analyze """ - log( - f"CodeChecker command: CodeChecker analyze {CODECHECKER_ARGS} \ -{COMPILE_COMMANDS_ABSOLUTE} --output={DATA_DIR} --file=*/{FILE_PATH}\n" + codechecker_cmd: list[str] = ( + ["CodeChecker", "analyze"] + + CODECHECKER_ARGS.split() + + ["--output=" + DATA_DIR] # type: ignore + + ["--file=*/" + FILE_PATH] # type: ignore + + ["--config " + CONFIG_FILE] + + [COMPILE_COMMANDS_ABSOLUTE] ) + log(f"CodeChecker command: {codechecker_cmd}\n") log("===-----------------------------------------------------===\n") log(" CodeChecker error log \n") log("===-----------------------------------------------------===\n") @@ -100,15 +105,6 @@ def _run_codechecker() -> None: ) log(result.stdout) - codechecker_cmd: list[str] = ( - ["CodeChecker", "analyze"] - + CODECHECKER_ARGS.split() - + ["--output=" + DATA_DIR] # type: ignore - + ["--file=*/" + FILE_PATH] # type: ignore - + ["--config " + CONFIG_FILE] - + [COMPILE_COMMANDS_ABSOLUTE] - ) - try: with open(LOG_FILE, "a") as log_file: # type: ignore subprocess.run( From 0076907aa504951754c61d8e3c45023cd94b6271 Mon Sep 17 00:00:00 2001 From: "F.Tibor" Date: Tue, 25 Nov 2025 10:43:43 +0100 Subject: [PATCH 09/11] Add to input even if ctu flag is not enabled --- src/per_file.bzl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/per_file.bzl b/src/per_file.bzl index 32725957..170cd709 100644 --- a/src/per_file.bzl +++ b/src/per_file.bzl @@ -41,7 +41,8 @@ def _run_code_checker( else: # NOTE: we collect only headers, so CTU may not work! headers = depset([src], transitive = [compilation_context.headers]) - inputs = depset([compile_commands_json, src], transitive = [headers]) + inputs = depset([compile_commands_json, config_file, src], + transitive = [headers]) outputs = [clang_tidy_plist, clangsa_plist, codechecker_log] From cc44a02fd4201d1acd2807ca42d77f277daa45f3 Mon Sep 17 00:00:00 2001 From: "F.Tibor" Date: Tue, 25 Nov 2025 10:47:27 +0100 Subject: [PATCH 10/11] pass cingif file to --config argument --- src/per_file_script.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/per_file_script.py b/src/per_file_script.py index 6adc0456..0ad9d7fc 100644 --- a/src/per_file_script.py +++ b/src/per_file_script.py @@ -88,7 +88,7 @@ def _run_codechecker() -> None: + CODECHECKER_ARGS.split() + ["--output=" + DATA_DIR] # type: ignore + ["--file=*/" + FILE_PATH] # type: ignore - + ["--config " + CONFIG_FILE] + + ["--config=" + CONFIG_FILE] + [COMPILE_COMMANDS_ABSOLUTE] ) log(f"CodeChecker command: {codechecker_cmd}\n") From 6848e3d5e92230854fdc695e2ed6f201f02a6f46 Mon Sep 17 00:00:00 2001 From: "F.Tibor" Date: Tue, 25 Nov 2025 11:01:09 +0100 Subject: [PATCH 11/11] Prettify command logging --- src/per_file_script.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/per_file_script.py b/src/per_file_script.py index 0ad9d7fc..75f7995f 100644 --- a/src/per_file_script.py +++ b/src/per_file_script.py @@ -91,7 +91,7 @@ def _run_codechecker() -> None: + ["--config=" + CONFIG_FILE] + [COMPILE_COMMANDS_ABSOLUTE] ) - log(f"CodeChecker command: {codechecker_cmd}\n") + log(f"CodeChecker command: {' '.join(codechecker_cmd)}\n") log("===-----------------------------------------------------===\n") log(" CodeChecker error log \n") log("===-----------------------------------------------------===\n")