diff --git a/tools/pre-commit.hooks/.clang-tidy.hook b/tools/pre-commit.hooks/.clang-tidy.hook index 367462daaf4de375b4e7e71799efe0ed09d2d3f8..3b0445e20f333712647f62495a623fcd4d60615d 100755 --- a/tools/pre-commit.hooks/.clang-tidy.hook +++ b/tools/pre-commit.hooks/.clang-tidy.hook @@ -6,8 +6,7 @@ TOTAL_ERRORS=0 # The trick to remove deleted files: https://stackoverflow.com/a/2413151 for file in $(git diff --cached --name-status | awk '$1 != "D" {print $2}' | grep -v "third-party/" | grep -v ".pb."); do - python ./tools/pre-commit.hooks/run-clang-tidy.py $file; - echo "python ./tools/pre-commit.hooks/run-clang-tidy.py $file" + bash -c "python ./tools/pre-commit.hooks/run-clang-tidy.py $file -fix"; TOTAL_ERRORS=$(expr $TOTAL_ERRORS + $?); done