-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add and Test Clang-tidy #1710
base: master
Are you sure you want to change the base?
Add and Test Clang-tidy #1710
Conversation
I think |
@TheJJ kevin needs |
@haytham918 You should add |
@heinezen Thank you for the notice. I have updated it accordingly. |
@TheJJ Did you add |
@haytham918 Happy new year! I'm still waiting for @TheJJ to add |
It's in the image now :) |
This is what I am seeing from the build output, not sure what exactly is going wrong with the configuration? I don't think I have ever modified the CMake files. |
Kevin is now able to run clang-tidy, but produces many errors. |
Now clang-tidy seems to be working and generating warnings? |
I think the compile command database needs to be added like this: https://stackoverflow.com/questions/63944447/how-to-specify-compilation-database-for-clang-tidy#71826250
-p <build-path> is used to read a compile command database.
For example, it can be a CMake build directory in which a file named
compile_commands.json exists (use -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
CMake option to get this output). When no build path is specified,
a search for compile_commands.json will be attempted through all
parent paths of the first input file . See:
https://clang.llvm.org/docs/HowToSetupToolingForLLVM.html for an
example of setting up Clang Tooling on a source tree. |
we have the compile command export already. but we need to make clang-tidy to use it, i.e. by integrating it in the buildsystem. it can't run without cmake running before it. the warnings it currently generates are not helpful since they fail at things like unknown includes, but once it's integrated into the real compile environment, real output is generated :) |
Fyi cmake natively supports running clang tidy as part of the normal build. See https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_CLANG_TIDY.html |
Thx, indeed. And now I remember: We actually added this already: Line 416 in 6597b09
Line 152 in 6597b09
https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_CLANG_TIDY.html https://cmake.org/cmake/help/latest/prop_tgt/LANG_CLANG_TIDY.html |
Addressing the issue in #1060. Added clang-tidy check on files inside "libopenage" directory, focusing on "clang-analyzer", "bugprone", "concurrency", and "performance" issues. @heinezen