Ericsson / codechecker

CodeChecker is an analyzer tooling, defect database and viewer extension for the Clang Static Analyzer and Clang Tidy
https://codechecker.readthedocs.io
Apache License 2.0
2.15k stars 358 forks source link

`--file` has no effect #4187

Open tolikzinovyev opened 3 months ago

tolikzinovyev commented 3 months ago

Describe the bug --file flag has no effect when running analyze.

CodeChecker version 6.23.1

To Reproduce Steps to reproduce the behaviour:

  1. git clone https://github.com/tolikzinovyev/codechecker
  2. cd codechecker
  3. bazel build //...
  4. bazel run @hedron_compile_commands//:refresh_all to generate compile_commands.json
  5. ~/.local/bin/CodeChecker analyze compile_commands.json -o ./report --analyzers clang-tidy --clean --file a.cc

Expected behaviour Only a.cc is analyzed.

Desktop (please complete the following information)

Additional context

bruntib commented 3 months ago

The --file flag must match the absolute path of files. Could you try this command? ~/.local/bin/CodeChecker analyze compile_commands.json -o ./report --analyzers clang-tidy --clean --file '*/a.cc'

tolikzinovyev commented 3 months ago

It still analyzes both files.

[INFO 2024-03-11 20:46] - [1/2] clang-tidy analyzed a.cc successfully.
[INFO 2024-03-11 20:46] - [1/2] clang-tidy analyzed b.cc successfully.