Skip to content

Commit

Permalink
keep same version of clang-format with paddle (PaddlePaddle#9286)
Browse files Browse the repository at this point in the history
* support min_area_rect crop

* add check_install

* fix requirement.txt

* fix check_install

* add lanms-neo for drrg

* fix

* fix doc

* fix

* support set gpu_id when inference

* fix PaddlePaddle#8855

* fix PaddlePaddle#8855

* opt slim doc

* fix doc bug

* fix east postprocess

* keep same version of clang-format with paddle
  • Loading branch information
LDOUBLEV authored Mar 3, 2023
1 parent a27bb18 commit a0c7e63
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions .clang_format.hook
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
#!/bin/bash
set -e

readonly VERSION="3.8"
readonly VERSION="13.0.0"

version=$(clang-format -version)

if ! [[ $(python -V 2>&1 | awk '{print $2}' | awk -F '.' '{print $1$2}') -ge 36 ]]; then
echo "clang-format installation by pip need python version great equal 3.6,
please change the default python to higher version."
exit 1
fi

if ! [[ $version == *"$VERSION"* ]]; then
echo "clang-format version check failed."
echo "a version contains '$VERSION' is needed, but get '$version'"
echo "you can install the right version, and make an soft-link to '\$PATH' env"
exit -1
# low version of pip may not have the source of clang-format whl
pip install --upgrade pip
pip install clang-format==13.0.0
fi

clang-format $@

0 comments on commit a0c7e63

Please sign in to comment.