Ericsson / codechecker

CodeChecker is an analyzer tooling, defect database and viewer extension for static and dynamic analyzer tools.
https://codechecker.readthedocs.io
Apache License 2.0
2.27k stars 383 forks source link

.clang-tidy file can not implement #3379

Open basakerhz opened 3 years ago

basakerhz commented 3 years ago

Describe the bug .clang-tidy file can not implement

CodeChecker version compile with newest code on branch master (6.17)

.clang-tidy file can not implement

I have added a .clang-tidy file to make my own config for clang-tidy, but it didn't work, did I lose some steps about clang-tidy settings or any other thing? image

basakerhz commented 3 years ago

If I delete a space in .clang-tidy on purpose, codechecker can recognize the syntax error: image

So I am so confused that did .clang-tidy file implemented or not?

csordasmarton commented 3 years ago

I think your problem is related to my PR: #3203

basakerhz commented 3 years ago

@csordasmarton Thanks too much, I saw it , it's the same problem. By the way, does it will be fixed in next version ?

csordasmarton commented 3 years ago

@basakerhz I hope so that it will be merged in the next release. It's still under review. I will try to ping my colleague to review it.

basakerhz commented 3 years ago

@csordasmarton Glad to hear that, thank you for your efforts🤗.

basakerhz commented 3 years ago

@csordasmarton Hi, I want to only enable the rules about performance-*, so I disabled sensitive, and --enbale performance rule one by one , it seems worked, but the truth is our code was still checked by default rules , is that also a known issue? image actually: image

csordasmarton commented 2 years ago

Under the hood in case of Clang Tidy first it will enable all the checkers in the default profile first: https://github.com/Ericsson/codechecker/blob/ed16b5d58f75002b465ea0944be0abf071f0b958/analyzer/codechecker_analyzer/analyzers/config_handler.py#L170-L172 After it will iterate over all the checkers enabled or disabled by the command line parameters: https://github.com/Ericsson/codechecker/blob/ed16b5d58f75002b465ea0944be0abf071f0b958/analyzer/codechecker_analyzer/analyzers/config_handler.py#L201-L220

The list of checkers which are in the sensitive profile can be found in this file: https://github.com/Ericsson/codechecker/blob/master/config/labels/analyzers/clang-tidy.json And can be listed with the following command: CodeChecker checkers --analyzers clang-tidy --profile sensitive