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

Add clang-tidy to CMakeLists.txt files #82

Merged
merged 1 commit into from
Aug 11, 2023
Merged

Conversation

xatier
Copy link
Contributor

@xatier xatier commented Aug 11, 2023

clang-tidy is a great tool to catch bugs at compile time. This commit adds support to execute clang-tidy to our CMake scripts.

This flag is OFF by default, to enable clang-tidy, append -DENABLE_CLANG_TIDY=On to cmake commands.

I picked a few popular ones, and we may want to enable more later.

https://releases.llvm.org/11.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/list.html

`clang-tidy` is a great tool to catch bugs at compile time. This commit
adds support to execute `clang-tidy` to our CMake scripts.

This flag is OFF by default, to enable clang-tidy, append
`-DENABLE_CLANG_TIDY=On` to `cmake` commands.

I picked a few popular ones, and we may want to enable more later.

https://releases.llvm.org/11.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/list.html
@xatier
Copy link
Contributor Author

xatier commented Aug 11, 2023

@lukhnos please kindly take a look. Hopefully, we can spot some bugs or improve our codebase w/ clang-tidy.

This set of check rules found quite a bit of issues, if time permits, I may submit subsequent PRs to fix them.

@lukhnos lukhnos self-requested a review August 11, 2023 01:29
@lukhnos
Copy link
Collaborator

lukhnos commented Aug 11, 2023

Thank you! I really appreciate this effort to make the checks part of the build process.

@lukhnos lukhnos merged commit f9bb1b5 into openvanilla:master Aug 11, 2023
3 checks passed
@xatier
Copy link
Contributor Author

xatier commented Aug 11, 2023

NP! I will find some time to resolve these issues reported by clang-tidy (which is quite a lot!), once we're done cleaning, perhaps we can add a check to GitHub CI, so we don't get regressions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants