diff --git a/tools/codestyle/cpplint_pre_commit.hook b/tools/codestyle/cpplint_pre_commit.hook index c90bf29ecb794bde52df7468d7626211397b0391..cef11ab1351b71a2b62b78d0eefc4e158dd86ea1 100755 --- a/tools/codestyle/cpplint_pre_commit.hook +++ b/tools/codestyle/cpplint_pre_commit.hook @@ -1,10 +1,15 @@ #!/bin/bash TOTAL_ERRORS=0 + +readonly VERSION="1.6.0" + +version=$(cpplint --version) + if [[ ! $TRAVIS_BRANCH ]]; then # install cpplint on local machine. - if [[ ! $(which cpplint) ]]; then - pip install cpplint + if ! [[ $version == *"$VERSION"* ]]; then + pip install cpplint==1.6.0 fi # diff files on local machine. files=$(git diff --cached --name-status | awk '$1 != "D" {print $2}') diff --git a/tools/codestyle/pylint_pre_commit.hook b/tools/codestyle/pylint_pre_commit.hook index f0d2f0a22d79ead1fc12c7425e1c55f7e2c3fc40..1c81f4b45633964577cbaeec40e694b29cb8ae66 100755 --- a/tools/codestyle/pylint_pre_commit.hook +++ b/tools/codestyle/pylint_pre_commit.hook @@ -10,7 +10,7 @@ readonly VERSION="2.12.0" version=$(pylint --version | grep 'pylint') if ! [[ $version == *"$VERSION"* ]]; then - pip install pylint==2.12.0 1>nul + pip install pylint==2.12.0 fi # The trick to remove deleted files: https://stackoverflow.com/a/2413151