Skip to content

Instantly share code, notes, and snippets.

@metebalci
Last active November 19, 2023 06:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save metebalci/e97f2f1119c0bbd71f5dd8baa714fd36 to your computer and use it in GitHub Desktop.
Save metebalci/e97f2f1119c0bbd71f5dd8baa714fd36 to your computer and use it in GitHub Desktop.
pre-commit hook to check licenses
#!/bin/sh
for fname in *.c *.h *.ld *.py Makefile README.md
do
grep -L "SPDX-License-Identifier: Apache-2.0" $fname
if [ $? -ne 0 ]
then
echo "LICENSE in $fname is not NOK. Run 'make fixlicenses'."
exit 1
fi
done
echo "LICENSE headers OK."
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment