blob: 5da86aa27759c353e51d43551ab9493af0ed5f0f [file] [log] [blame]
ncteisen365ea632018-01-12 15:16:41 -08001#!/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
ncteisen479067b2018-01-17 07:55:07 -080016echo "NOTE: to automagically apply fixes, invoke with --fix"
17
ncteisen365ea632018-01-12 15:16:41 -080018set -ex
19
20# change to root directory
21cd $(dirname $0)/../..
22REPO_ROOT=$(pwd)
23
24if [ "$CLANG_TIDY_SKIP_DOCKER" == "" ]
25then
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
ncteisen1adad722018-01-12 15:26:30 -080030 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 "$@"
ncteisen365ea632018-01-12 15:16:41 -080031else
ncteisen479067b2018-01-17 07:55:07 -080032 CLANG_TIDY_ROOT="${REPO_ROOT}" tools/dockerfile/grpc_clang_tidy/clang_tidy_all_the_things.sh "$@"
ncteisen365ea632018-01-12 15:16:41 -080033fi