diff --git a/run-clang-tidy.sh b/run-clang-tidy.sh index 3abd4f469b..662ef949d0 100755 --- a/run-clang-tidy.sh +++ b/run-clang-tidy.sh @@ -1,10 +1,16 @@ -#!/bin/sh -x +#!/bin/sh if [ $# -ne 1 ] || [ "$1" = "-h" ] || [ "$1" = "--help" ]; then echo "$0 " + echo "Set env var 'base_sha' to upstream/next hash and 'head_sha' and your current HEAD hash." exit 1 fi +if [ -z $base_sha ] || [ -z $head_sha ]; then + echo "Set env var 'base_sha' to upstream/next hash and 'head_sha' and your current HEAD hash." + exit 0 +fi + BUILD_PATH="$1" clang-tidy $(find ./arch ./*.c -type f -iregex ".*\.[c]") -p "$BUILD_PATH" -checks=clang-analyzer-*,-clang-analyzer-cplusplus* > ct-warnings.txt @@ -46,6 +52,8 @@ if [ -z $needs_fixes ]; then exit 0 fi +cat ct-warnings.txt + echo -e "\n\nclang-tidy warnings for: $faulty_files\n" echo "Please fix them. Or, if completely unrelated, let us know."