#!/bin/bash

mapfile -t ignore <.licignore

ret=0

while read -r -d ''; do
	if ! grep -q SPDX-License-Identifier "$REPLY"; then
		ret=1
		echo "'$REPLY' has no SPDX-License-Identifier"
	fi
done < <(git ls-files -z "${ignore[@]/#/:!:}")

exit "$ret"