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

Run clang-tidy in CI #37

Open
nikosavola opened this issue Apr 17, 2023 · 3 comments
Open

Run clang-tidy in CI #37

nikosavola opened this issue Apr 17, 2023 · 3 comments
Labels
build Related to building ci Related to continuous integration (CI) and/or GitHub Actions enhancement New feature or request

Comments

@nikosavola
Copy link
Contributor

clang-tidy could be run in CI in addition to clang-format for enforcung the style provided in .clang-tidy.

Roughly the following could work:

mkdir build && cd build
cmake .. -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
run-clang-tid
@nikosavola nikosavola added the enhancement New feature or request label Apr 17, 2023
@sebastiangrimberg sebastiangrimberg added build Related to building ci Related to continuous integration (CI) and/or GitHub Actions labels Apr 21, 2023
@sebastiangrimberg
Copy link
Contributor

Hi @nikosavola, yes this is indeed possible and made even easier so by just configuring using -DANALYZE_SOURCES_CLANG_TIDY=ON (or -DANALYZE_SOURCES_CPPCHECK=ON to do static analysis using cppcheck).

The reason why these are not enforced via the CI currently is that the .clang-tidy configuration is rather experimental. It is useful as a developer tool, but I am not yet certain that it is worth enforcing over the entire codebase. There was a relatively recent PR which may be of interest to you which looked at the changes required to satisfy the various clang-tidy noise, though it was closed since it was deemed this was not a very high priority item at the time. Hope this is helpful!

@sebastiangrimberg
Copy link
Contributor

Hi @nikosavola, just following up here. Does my response seem reasonable? If you're interested in making a contribution to run clang-tidy checks in the CI that would be great and I would be happy to help in any discussions of source code changes or config file settings in order to get the current main to build cleanly. Otherwise, if we should keep it only as a development tool, I can close this issue.

@nikosavola
Copy link
Contributor Author

Hi @nikosavola, just following up here. Does my response seem reasonable? If you're interested in making a contribution to run clang-tidy checks in the CI that would be great and I would be happy to help in any discussions of source code changes or config file settings in order to get the current main to build cleanly. Otherwise, if we should keep it only as a development tool, I can close this issue.

Hi, I think I can make a contribution at some point in the near future, so no need to close yet 😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Related to building ci Related to continuous integration (CI) and/or GitHub Actions enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants