-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Marco Lampacrescia <[email protected]>
- Loading branch information
1 parent
2ba9b75
commit f3aa433
Showing
3 changed files
with
45 additions
and
23 deletions.
There are no files selected for viewing
This file contains 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 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,19 @@ | ||
#!/bin/bash | ||
|
||
# Get the path to the directory of script | ||
CODE_ROOT=$(dirname $(dirname $(realpath "${BASH_SOURCE[0]}"))) | ||
# Move to the root of the project | ||
pushd $CODE_ROOT > /dev/null || exit | ||
# Apply clang-format to all source files | ||
|
||
clang-tidy --config-file=.clang-tidy --warnings-as-errors=* -p=build src/**/*.cpp include/**/*.hpp **/*.cpp && \ | ||
clang-format --style=file src/**/*.cpp include/**/*.hpp test/*.cpp --dry-run --Werror | ||
|
||
if [ $? -ne 0 ]; then | ||
echo "Error: clang-tidy or clang-format failed" | ||
popd > /dev/null | ||
exit 1 | ||
fi | ||
# Return to the original directory | ||
popd > /dev/null | ||
exit |
This file contains 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