Skip to content

On the per_file rule default arguments and user given arguments are not merged correctly #86

@furtib

Description

@furtib

Describe the bug
On the per_file rule, default arguments and user-given arguments are not merged. They both get passed along to CodeChecker. This could be confusing users looking at the codechecker.log. Also, in a future patch, I want to depend on this argument list, and it's easier to filter them out here.

Versions

  • CodeChecker 6.26.0
  • bazel 6.5.0
  • f496416

To Reproduce
Run in codechecker_bazel root:
(This will change the code_checker_pass rule!!!)

sed -i '262i\        "--analyzers clangsa clang-tidy",' test/unit/legacy/BUILD
bazel build //test/unit/legacy:code_checker_pass
cat bazel-bin/test/unit/legacy/code_checker_pass/data/test-unit-legacy-src-pass.cc_codechecker.log

See output:

CodeChecker command: CodeChecker analyze --analyzers clangsa clang-tidy --clean --ctu --analyzers clang-tidy clangsa cppcheck --output=code_checker_pass/data --file=*/test/unit/legacy/src/pass.cc bazel-out/k8-fastbuild/bin/test/unit/legacy/code_checker_pass/data/compile_commands.json.abs
...

Expected behaviour
I expected to see only one --analyzers in the CodeChecker command. There is 2.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions