ncteisen | 365ea63 | 2018-01-12 15:16:41 -0800 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # Copyright 2015 gRPC authors. |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | |
ncteisen | 479067b | 2018-01-17 07:55:07 -0800 | [diff] [blame] | 16 | echo "NOTE: to automagically apply fixes, invoke with --fix" |
| 17 | |
ncteisen | 365ea63 | 2018-01-12 15:16:41 -0800 | [diff] [blame] | 18 | set -ex |
| 19 | |
| 20 | # change to root directory |
| 21 | cd $(dirname $0)/../.. |
| 22 | REPO_ROOT=$(pwd) |
| 23 | |
| 24 | if [ "$CLANG_TIDY_SKIP_DOCKER" == "" ] |
| 25 | then |
| 26 | # build clang-tidy docker image |
| 27 | docker build -t grpc_clang_tidy tools/dockerfile/grpc_clang_tidy |
| 28 | |
| 29 | # run clang-tidy against the checked out codebase |
ncteisen | 1adad72 | 2018-01-12 15:26:30 -0800 | [diff] [blame] | 30 | docker run -e TEST=$TEST -e CHANGED_FILES="$CHANGED_FILES" -e CLANG_TIDY_ROOT="/local-code" --rm=true -v "${REPO_ROOT}":/local-code -t grpc_clang_tidy /clang_tidy_all_the_things.sh "$@" |
ncteisen | 365ea63 | 2018-01-12 15:16:41 -0800 | [diff] [blame] | 31 | else |
ncteisen | 479067b | 2018-01-17 07:55:07 -0800 | [diff] [blame] | 32 | CLANG_TIDY_ROOT="${REPO_ROOT}" tools/dockerfile/grpc_clang_tidy/clang_tidy_all_the_things.sh "$@" |
ncteisen | 365ea63 | 2018-01-12 15:16:41 -0800 | [diff] [blame] | 33 | fi |