[iwyu] fix IWYU public header checker (#12132)

This commit fixes the issue failing to catch headers would cause
iwyu to exit with errors.
This commit is contained in:
Yakun Xu
2025-11-12 09:19:43 +01:00
committed by GitHub
parent f2462b7401
commit 372fe4fbf1
+6 -4
View File
@@ -35,10 +35,12 @@ set -euxo pipefail
main()
{
find include -name '*.h' -exec iwyu -I include {} \; 2>&1 \
| fix_include -n --nosafe_headers \
| tee >(cat 1>&2) \
| grep 'IWYU edited 0 files on your behalf.'
find include -name '*.h' | while read -r header; do
echo "checking ${header}.."
iwyu -I include "${header}" 2>&1 | tee iwyu.out
fix_include -n --nosafe_headers <iwyu.out 2>&1 | tee iwyu.fix
grep 'IWYU edited 0 files on your behalf.' iwyu.fix
done
}
main "$@"