Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What's changed?
Incorporated the static analyzer "clang-tidy" into our project to improve code quality.
tidy
to perform tidy checks on the entire project. The compilation databasecompile_commands.json
is not required for this target as the Makefile already contains the necessary commands.GITHUB_BASE_REF
) and HEAD. We utilize Bear to generate the compilation database.Additionally, a script is added for CI execution. This script is not intended for local user execution due to the following reasons:
clang-tidy-diff
supports exit with a failure code when there are errors from version 17 or 18 onward. (The exact version is uncertain. For more details, please refer to clang-tidy-diff.py should exit with a failure code when there are errors llvm/llvm-project#65000.)bear
has different command line interfaces between version <= 2.4.x and onward. (For more details, please refer to Bear's documentation.)The script may not function properly if any of these issues arise. In the CI environment, we ensure that the versions of these dependencies are up-to-date. Specifically, the version of
clang-tidy-diff
is specified as18
, and the version of Bear on Ubuntu 22.04 is 3.0.x.How to test?
I pushed a testing commit which violates the naming rule to fail the CI, and it did fail as expected.
Resolves: #71