2020-05-21 13:14:40 +00:00
|
|
|
#!/usr/bin/env bash
|
2019-05-17 14:49:09 +00:00
|
|
|
|
2023-08-27 12:54:22 +00:00
|
|
|
# You can customize the clang-format path by setting the CLANG_FORMAT environment variable
|
|
|
|
CLANG_FORMAT=${CLANG_FORMAT:-clang-format}
|
|
|
|
|
2024-01-30 01:57:58 +00:00
|
|
|
# Check if clang-format version is 17 to avoid inconsistent formatting
|
2023-08-27 12:54:22 +00:00
|
|
|
$CLANG_FORMAT --version
|
2024-01-30 01:57:58 +00:00
|
|
|
if [[ ! $($CLANG_FORMAT --version) =~ "version 17" ]]; then
|
|
|
|
echo "Error: clang-format version must be 17"
|
2023-08-27 12:54:22 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2021-05-28 01:52:34 +00:00
|
|
|
find lib orm_lib nosql_lib examples drogon_ctl -name *.h -o -name *.cc -exec dos2unix {} \;
|
2023-08-27 12:54:22 +00:00
|
|
|
find lib orm_lib nosql_lib examples drogon_ctl -name *.h -o -name *.cc|xargs $CLANG_FORMAT -i -style=file
|