mirror of
https://github.com/XRPLF/clio.git
synced 2025-11-28 07:35:52 +00:00
@@ -4,7 +4,21 @@ exec 1>&2
|
||||
|
||||
# paths to check and re-format
|
||||
sources="src unittests"
|
||||
formatter="clang-format-11 -i"
|
||||
formatter="clang-format -i"
|
||||
version=$($formatter --version | awk -F'[[:space:]]' '{print $4}')
|
||||
|
||||
if [[ "16.0.0" > "$version" ]]; then
|
||||
cat <<\EOF
|
||||
|
||||
ERROR
|
||||
-----------------------------------------------------------------------------
|
||||
A minimum of version 16 of `clang-format` is required.
|
||||
Please fix paths and run again.
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
EOF
|
||||
exit 2
|
||||
fi
|
||||
|
||||
first=$(git diff $sources)
|
||||
find $sources -type f \( -name '*.cpp' -o -name '*.h' -o -name '*.ipp' \) -print0 | xargs -0 $formatter
|
||||
|
||||
Reference in New Issue
Block a user