clang-tidy.sh 475 B

123456789101112131415161718192021222324252627282930
  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. set -e
  7. args=""
  8. src=""
  9. while [ "$1" ]; do
  10. arg=$1
  11. args="$args $1"
  12. shift
  13. if [ "$arg" == "-c" ]; then
  14. src=$1
  15. args="$args $1"
  16. shift
  17. fi
  18. done
  19. if [ "$src" ]; then
  20. clang-tidy -quiet -header-filter='.*' -warnings-as-errors='*' $src -- $args
  21. fi
  22. exec clang++ $args