Skip to content

Commit

Permalink
Clang tidy quality of life (#2348)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rot127 authored May 8, 2024
1 parent 9378216 commit 0002f10
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion run-clang-tidy.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
#!/bin/sh -x
#!/bin/sh

if [ $# -ne 1 ] || [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
echo "$0 <build-path>"
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
Expand Down Expand Up @@ -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."

Expand Down

0 comments on commit 0002f10

Please sign in to comment.