-
Notifications
You must be signed in to change notification settings - Fork 86
Fix clang tidy on ci #1771
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
Fix clang tidy on ci #1771
Conversation
|
Ouch, that is indeed a major omission. Can we extend the CI check to a) get the version from CMAKE_CXX_COMPILER and b) check the availability of the run-script first? I'm surprised that didn't lead to a failure before. As for the current failures:
|
We have the following erros with clang-tidy 18The question is what we want to do with these ones. Disable all of it for the moment or some of it. Or do we want to fix it? Some of the errors can be fixed by clang tidy automatically. Summary: 10608 Errors [bugprone-assignment-in-if-condition] 19 |
|
Great work, thanks! I'd like to check them first and see which ones to fix. As they are new I can't tell off the top of my head which ones are "good". First we'd need to make sure /usr/include and external/kaguya|turtle get excluded as intended. That should squash a great deal of warnings already. A few can be disabled right away:
For Can you remove the last commit such that the new additions are clearly visible? And what is the command to auto-fix issues if you have it at hand? E.g. the const-correctness check looks pretty much made for that and I'm a big fan of it. |
|
To apply fixes if available you can use the following parameters to the clang tidy call |
I had a look into it. In general the exclude header regex is working. But there are some checks ignoring it like [misc-confusable-identifiers]. I think this is due to the nature of the checks. Even with a newer clang-tidy version 19, where a new parameter is introduced, the errors for these specific checks are reported, even if the according headers are excluded. I think the part
is important here. I made also a very simple example to check it. With the check misc-confusable-identifiers it is not working and with the check google-explicit-constructor all is working fine. So we have no other possibilty as to disable these checks, or write a bug/question issue at the clang-tidy git project, to get an answer why the warnings generated by the excluded headers for this checks are not excluded. |
I'd say both. They shouldn't disallow identifiers in a project due to identifiers in an unrelated project |
|
Opened a bug report at the clang-tidy project llvm/llvm-project#142112 |
55a022a to
fb8c415
Compare
We have to disable this test until the option for ignoring IgnoreSystemIdentifiers is implemented by clang-tidy. |
|
Agreed. I think we can also disable
That should bring the numbers down by a lot. Maybe you can strike through the already disabled ones in your list above |
|
I would fix the following warnings in this pullrequest because theses checks are already active in clang tidy 10. But after this checks fixed i would prefer to disable the other new ones temporarly. Merge this request so no more regressions can come in because of clang tidy not running. Make a new issue for reactivating/disable and fixing the new ones. |
|
That would be great! Could you also fix |
|
@Flamefire How can i commit the changes on the submodules without forking all of them? |
You can't. You'd need to fork, commit, push and PR them as usual. If you want you can attach the patch here and I'll do that. Run |
e4cb128 to
ec41919
Compare
|
@Flamefire Everything is fixed. Only two modernize-type-traits errors are left but i have not idea how to fix this or if it is a false positive of clang-tidy. Can you have a look at it? Afterwards the pullrequest for the other repos can merged and we can adjust the externals here for final testing. |
bdcc707 to
a7eee69
Compare
Yes it's a bug which seems to be fixed in at least clang-tidy trunk: https://godbolt.org/z/dco63azYW
Can you link them in the description? Usual is something like: GitHub then automatically shows/updates the merge state |
|
What about the libutil PR? BTW: If you rebase this could you change the commit message of e.g. "Deactivate clang-tidy modernize-type-traits due to bug in clang-tidy" to something like "suppress false positive of clang-tidy modernize-type-traits due to bug in clang-tidy"? Currently it sounds like it disabled the test for everything which might be misleading later. |
I missed some place to fix in libutil so i need a new PR. Thanks for merging. Yes sure i can change the commit message. |
|
There was an unrelated issue in libutil I added a (hopefully) fix. So just update the submodule here |
a42ea27 to
afb4f13
Compare
Didn't work had to revert it. We need to wait for #1778 |
…bility-function-cognitive-complexity
…nize-use-auto,performance-inefficient-vector-operation,performance-move-const-arg,readability-container-size-empty,readability-redundant-member-init,performance-noexcept-swap,readability-redundant-inline-specifier,readability-container-data-pointer,readability-simplify-boolean-expr,modernize-type-traits,misc-unused-alias-decls
…mber-init] as error but changing it according to the fix options produces a compiler error
afb4f13 to
c176314
Compare
|
Everything should be fine now :) |
|
Thanks for your efforts! |
The ci uses clang and clang tidy packages version 18 but the scripts call the old clangtidy version 10. The clang tidy step succeds but the checks are never executed because clang tidy is not found.
Requires: