Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.clang-tidy file can not implement #3379

Open
basakerhz opened this issue Jul 13, 2021 · 7 comments
Open

.clang-tidy file can not implement #3379

basakerhz opened this issue Jul 13, 2021 · 7 comments
Labels
analyzer 📈 Related to the analyze commands (analysis driver) clang-tidy 🐉 clang-tidy is a clang-based C++ “linter” tool. config ⚙️

Comments

@basakerhz
Copy link

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
Copy link
Author

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
Copy link
Contributor

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

@basakerhz
Copy link
Author

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

@csordasmarton
Copy link
Contributor

@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
Copy link
Author

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

@whisperity whisperity added analyzer 📈 Related to the analyze commands (analysis driver) clang-tidy 🐉 clang-tidy is a clang-based C++ “linter” tool. config ⚙️ labels Jul 14, 2021
@basakerhz
Copy link
Author

@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
Copy link
Contributor

Under the hood in case of Clang Tidy first it will enable all the checkers in the default profile first:

# Turn default checkers on.
for checker in default_profile_checkers:
self.set_checker_enabled(checker)

After it will iterate over all the checkers enabled or disabled by the command line parameters:
for identifier, enabled in cmdline_enable:
if ':' in identifier:
for checker in checker_labels.checkers_by_labels([identifier]):
self.set_checker_enabled(checker, enabled)
elif identifier in profiles:
if identifier in reserved_names:
LOG.warning("Profile name '%s' conflicts with a "
"checker(-group) name.", identifier)
for checker in checker_labels.checkers_by_labels(
[f'profile:{identifier}']):
self.set_checker_enabled(checker, enabled)
elif identifier in guidelines:
if identifier in reserved_names:
LOG.warning("Guideline name '%s' conflicts with a "
"checker(-group) name.", identifier)
for checker in checker_labels.checkers_by_labels(
[f'guideline:{identifier}']):
self.set_checker_enabled(checker, enabled)
else:
self.set_checker_enabled(identifier, enabled)

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer 📈 Related to the analyze commands (analysis driver) clang-tidy 🐉 clang-tidy is a clang-based C++ “linter” tool. config ⚙️
Projects
None yet
Development

No branches or pull requests

3 participants