Solved clang-tidy usage in Kodi codebase
#1
Hi,

this is a question for active Kodi developers.

Background
clang-tidy is a tool for code analysis. It finds typical programming mistakes and can also modernize the codebase. I use it on all of my C++ projects and it has helped me find quite a few bugs even if just minor ones.

Question
Is clang-tidy used anywhere in Kodi's codebase, i.e. is it part of Kodi's Jenkins builds?
I find a few pull requests that fix some issues found with clang-tidy (see https://github.com/xbmc/xbmc/pulls?utf8=...clang-tidy ) but nothing else.

If nobody has a strong opinion about this then I'd like to fix some issues reported by it from time to time. Fixing small issues helps me understand the code better and let's me dig deeper into the project.
It may be worth to add it to Kodi's build process in the (far) future as well if it isn't part of it, yet. :-)


Regards,
Andre
Reply
#2
A clang format that applies the current code guidelines file is part of Kodi build see https://github.com/Rechi/xbmc/blob/master/.clang-format
The application of that to the code they add is upto the developer.
Reply
#3
(2019-08-30, 09:41)DaveBlake Wrote: A clang format that applies the current code guidelines file is part of Kodi build see https://github.com/Rechi/xbmc/blob/master/.clang-format
The application of that to the code they add is upto the developer.

Hi,
thanks. I know of that .clang-format file but clang-tidy has a different purpose, though. It is not intended for formatting but for finding bugs or old-style C++ code.
https://clang.llvm.org/extra/clang-tidy/...ssion.html is a good example of what kind of checks can be used. Smile

From https://clang.llvm.org/extra/clang-tidy/index.html :
Quote:clang-tidy is a clang-based C++ “linter” tool. Its purpose is to provide an extensible framework for diagnosing and fixing typical programming errors, like style violations, interface misuse, or bugs that can be deduced via static analysis. clang-tidy is modular and provides a convenient interface for writing new checks.

Regards,
Andre
Reply
#4
Pullrequests that improve the codebase are always welcome.
Afaik clang-tidy is not part of the buildpipeline atm, but as you already found, some people are using it to identify issues and modernize the code.
Reply
#5
(2019-09-01, 19:48)a1rwulf Wrote: Pullrequests that improve the codebase are always welcome.
Afaik clang-tidy is not part of the buildpipeline atm, but as you already found, some people are using it to identify issues and modernize the code.

Thanks. Smile
Reply

Logout Mark Read Team Forum Stats Members Help
clang-tidy usage in Kodi codebase0