Mike Klein | 1688507 | 2018-12-11 09:54:31 -0500 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # |
| 3 | # Copyright 2018 Google Inc. All rights reserved. |
| 4 | # Use of this source code is governed by a BSD-style license that can be |
| 5 | # found in the LICENSE file. |
| 6 | |
| 7 | set -e |
| 8 | |
| 9 | args="" |
| 10 | src="" |
| 11 | |
| 12 | while [ "$1" ]; do |
| 13 | arg=$1 |
| 14 | |
| 15 | args="$args $1" |
| 16 | shift |
| 17 | |
| 18 | if [ "$arg" == "-c" ]; then |
| 19 | src=$1 |
| 20 | |
| 21 | args="$args $1" |
| 22 | shift |
| 23 | fi |
| 24 | done |
| 25 | |
| 26 | if [ "$src" ]; then |
Mike Klein | ad64873 | 2018-12-12 09:40:40 -0500 | [diff] [blame] | 27 | clang-tidy -quiet -header-filter='.*' -warnings-as-errors='*' $src -- $args |
Mike Klein | 1688507 | 2018-12-11 09:54:31 -0500 | [diff] [blame] | 28 | fi |
| 29 | exec clang++ $args |
| 30 | |