Conversation
Also remove gcc nested functione example
…ce-clang-tidy-setup
|
This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #834 +/- ##
==========================================
+ Coverage 91.50% 91.53% +0.03%
==========================================
Files 235 235
Lines 28686 28686
==========================================
+ Hits 26248 26259 +11
+ Misses 2438 2427 -11 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This PR introduces a clang-tidy setup for the project.
I know we previously introduced the GCC static analyzer, but was already testing clang-tidy in the background. A key benefit of clang-tidy is its compatibility with both Clang and GCC. Additionally, you do not need to perform a full compilation first, though clang-tidy does require the CMake-generated
compile_commands.jsonfile.I have enabled most check groups but disabled individual checks that currently report issues. I expect we can enable almost all checks over time (if desired), though some will require further discussion.
Potentially Problematic Checks:
extern "C"directives with//NOLINTBEGIN(cppcoreguidelines-*)and//NOLINTEND(cppcoreguidelines-*).readability-identifier-namingflags certain variable names as too short (e.g.,bnd).CI/CD Integration
To run clang-tidy, I added a separate workflow. While it is possible to append a clang-tidy scan to an existing build job, doing so would extend the total execution time. Since clang-tidy only requires a CMake configuration, running it as a parallel job avoids increasing the overall build duration.
For local development, the
ENABLE_CLANG_TIDYbuild option can be used to integrate the scan into the build process. While this is also possible on CI, I believe a single dedicated scan is sufficient.The scan uses the
clang-tidy-sariftool to convert the output into a SARIF report. GitHub supports this format, though I am still confirming exactly how these results integrate into our specific GitHub environment (e.g., the Security tab).Final Notes:
cert-dcl59-cppcheck so that there is are least some findings to report for testing purposes.cargo-bins/cargo-binstallaction is restricted in our organization, soclang-tidy-sarifis currently "installed" viacurl. I have kept the action usage in comments for now. If we agree that clang-tidy is the right path forward and thecurlapproach is acceptable, I will remove the commented-out code.