Skip to content

Commit 100b30c

Browse files
committed
add warning limit and failure condition for the clang-tidy job. Update the warning limit for iwyu
1 parent 90e8fb2 commit 100b30c

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

.github/workflows/clang-tidy.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,4 +97,13 @@ jobs:
9797
run: |
9898
COUNT=$(grep -c "warning:" clang-tidy.log)
9999
echo "clang-tidy reported ${COUNT} warning(s)"
100+
readonly WARNING_LIMIT=216
101+
# FAIL the build if COUNT > WARNING_LIMIT
102+
if [ $COUNT -gt $WARNING_LIMIT ] ; then
103+
echo "clang-tidy reported ${COUNT} warning(s) exceeding the existing warning limit of ${WARNING_LIMIT}"
104+
exit 1
105+
# WARN in annotations if COUNT > 0
106+
elif [ $COUNT -gt 0 ] ; then
107+
echo "clang-tidy reported ${COUNT} warning(s)"
108+
fi
100109

.github/workflows/iwyu.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ jobs:
9696
readonly WARNING_COUNT=`grep -c "include-what-you-use reported diagnostics:" iwyu.log`
9797
echo "include-what-you-use reported ${WARNING_COUNT} warning(s)"
9898
# Acceptable limit, to decrease over time down to 0
99-
readonly WARNING_LIMIT=0
99+
readonly WARNING_LIMIT=48
100100
# FAIL the build if WARNING_COUNT > WARNING_LIMIT
101101
if [ $WARNING_COUNT -gt $WARNING_LIMIT ] ; then
102102
exit 1

0 commit comments

Comments
 (0)