-
Notifications
You must be signed in to change notification settings - Fork 59
Add clang-tidy CI workflow #859
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
Draft
giacomofiorin
wants to merge
18
commits into
master
Choose a base branch
from
clang-tidy
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
51e3b20
test: save build commands suitable for run-clang-tidy
giacomofiorin 89edfe9
Add clang-tidy CI job
giacomofiorin 94fc750
fix: add use_all enum to rotation_derivative_dldq
HanatoK fcba32b
fix: fix the uninitialized variable m_height in colvarbias_opes::kernel
HanatoK d25d765
fix: fix the uninitialized variables in ArithmeticPathBase
HanatoK 0868ddc
fix: use valid default values for std::ios::fmtflags
giacomofiorin b539931
fix: Call virtual functions consistently from constructor
giacomofiorin 41d9041
fix: Tell Clang that Parse_Mode is a flag enum
giacomofiorin cf07727
test: Write clang-tidy output directly, to be retrieved later
giacomofiorin 6eb426a
test: simplify the running of clang-tidy
HanatoK a23bfd1
test: fix the typo in test-library.yml
HanatoK 0a77a7a
test: rename the github actions
HanatoK ea3811c
test: use clang-tidy-20 in ubuntu
HanatoK 139865d
test: Add option to run CMake helper script only to configure targets
giacomofiorin 03e3ef1
fix: Manually add combined value to silence clang-tidy
giacomofiorin 0e6766e
fix: Run clang-tidy on headers as well (and in parallel)
giacomofiorin 5cf856d
fix: use C++11 compatible construct
giacomofiorin ae99b67
Print clang-tidy errors to screen
giacomofiorin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/bash | ||
|
||
# Get the top Colvars repo directory | ||
TOPDIR=$(git rev-parse --show-toplevel) | ||
if [ ! -d ${TOPDIR} ] ; then | ||
echo "Error: cannot identify top project directory." >& 2 | ||
exit 1 | ||
fi | ||
|
||
# Get the build directory | ||
COLVARS_BUILD_DIR="$(pwd)" | ||
|
||
# Get the clang-tidy binary | ||
if [[ -v CLANG_TIDY ]]; then | ||
CLANG_TIDY_BINARY=$CLANG_TIDY | ||
echo "Using $CLANG_TIDY_BINARY as clang-tidy" | ||
else | ||
CLANG_TIDY_BINARY="clang-tidy" | ||
fi | ||
|
||
# Get the Colvars source directory | ||
COLVARS_SOURCE_DIR="$TOPDIR/src" | ||
# Find all source files that are required to build the run_colvars_test | ||
COLVARS_STUB_SOURCE_DIR="$TOPDIR/misc_interfaces/stubs" | ||
COLVARS_TEST_SOURCE_DIR="$TOPDIR/tests/functional/" | ||
COLVARS_SOURCE_FILES=($(find $COLVARS_STUB_SOURCE_DIR $COLVARS_TEST_SOURCE_DIR $COLVARS_SOURCE_DIR -name "*.cpp")) | ||
|
||
printf '%s\n' ${COLVARS_SOURCE_FILES[@]} | \ | ||
xargs -I{} -P $(nproc) \ | ||
bash -c "$CLANG_TIDY_BINARY -p=$COLVARS_BUILD_DIR -header-filter=.* --warnings-as-errors='*' '{}' > '{}'.log" | ||
|
||
retcode=$? | ||
|
||
if [ $retcode != 0 ] ; then | ||
cat "${COLVARS_SOURCE_FILES[@]/%/.log}" | ||
exit $retcode | ||
fi | ||
|
||
exit 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.