A baseline lets a project adopt a level today and becomes a place to hide the moment it is allowed to grow.
before=$(git show origin/main:phpstan-baseline.neon | wc -l)
after=$(wc -l < phpstan-baseline.neon)
if [ "$after" -gt "$before" ]; then
echo "baseline grew by $(( after - before )) lines" >&2
exit 1
fi
Regenerating the baseline to make a build pass is indistinguishable from a legitimate regeneration unless the count is checked, which is the entire reason for this. Plotting the number over time turns the debt into something visible in a review, and reviewing baseline changes in a pull request is the other half — a diff that adds entries deserves a question every time.