mirror of https://github.com/oxen-io/lokinet
Bump clang-format to 14
parent
02108f0504
commit
d011f8fb4a
@ -1,6 +1,9 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
test "x$IGNORE" != "x" && exit 0
|
test "x$IGNORE" != "x" && exit 0
|
||||||
|
|
||||||
|
. $(dirname $0)/../format-version.sh
|
||||||
|
|
||||||
repo=$(readlink -e $(dirname $0)/../../)
|
repo=$(readlink -e $(dirname $0)/../../)
|
||||||
clang-format-11 -i $(find $repo/jni $repo/daemon $repo/llarp $repo/include $repo/pybind | grep -E '\.[hc](pp)?$')
|
$CLANG_FORMAT -i $(find $repo/jni $repo/daemon $repo/llarp $repo/include $repo/pybind | grep -E '\.[hc](pp)?$')
|
||||||
jsonnetfmt -i $repo/.drone.jsonnet
|
jsonnetfmt -i $repo/.drone.jsonnet
|
||||||
git --no-pager diff --exit-code --color || (echo -ne '\n\n\e[31;1mLint check failed; please run ./contrib/format.sh\e[0m\n\n' ; exit 1)
|
git --no-pager diff --exit-code --color || (echo -ne '\n\n\e[31;1mLint check failed; please run ./contrib/format.sh\e[0m\n\n' ; exit 1)
|
||||||
|
@ -0,0 +1,19 @@
|
|||||||
|
|
||||||
|
CLANG_FORMAT_DESIRED_VERSION=14
|
||||||
|
|
||||||
|
CLANG_FORMAT=$(command -v clang-format-$CLANG_FORMAT_DESIRED_VERSION 2>/dev/null)
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
CLANG_FORMAT=$(command -v clang-format-mp-$CLANG_FORMAT_DESIRED_VERSION 2>/dev/null)
|
||||||
|
fi
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
CLANG_FORMAT=$(command -v clang-format 2>/dev/null)
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo "Please install clang-format version $CLANG_FORMAT_DESIRED_VERSION and re-run this script."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
version=$(clang-format --version)
|
||||||
|
if [[ ! $version == *"clang-format version $CLANG_FORMAT_DESIRED_VERSION"* ]]; then
|
||||||
|
echo "Please install clang-format version $CLANG_FORMAT_DESIRED_VERSION and re-run this script."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
Loading…
Reference in New Issue