2014-08-25 05:55:08 -07:00
|
|
|
#!/bin/bash
|
|
|
|
|
2014-11-18 07:13:19 -07:00
|
|
|
missing-authors() {
|
2014-12-08 06:04:49 -07:00
|
|
|
for email in $(git log --format=%ae HEAD | sort | uniq) ; do
|
2014-11-16 13:13:20 -07:00
|
|
|
grep -q "$email" AUTHORS || echo $email
|
2014-08-25 05:55:08 -07:00
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
no-docs-typos() {
|
|
|
|
# Commits that are known to not change code
|
2014-09-27 05:44:15 -07:00
|
|
|
grep -v 63bd0136fb40a91efaa279cb4b4159d82e8e6904 |\
|
|
|
|
grep -v 4e2feb6fbc791bb8a2daf0ab8efb10775d66343e |\
|
2014-08-25 05:55:08 -07:00
|
|
|
grep -v f2459ef3319b2f060dbcdacd0c35a1788a94b8bd |\
|
|
|
|
grep -v b61f418bf2d1f7d5a9d7088a20a2a448e5e66801 |\
|
|
|
|
grep -v f0621207e3953711f9ab86d99724f1d0faac45b1 |\
|
2014-12-08 07:41:08 -07:00
|
|
|
grep -v f1120d7aa936c0658429edef0037792520b46334 |\
|
|
|
|
grep -v a9339d0627fff439879d157c75077f02c9fac61b |\
|
2014-12-23 02:23:36 -07:00
|
|
|
grep -v 254c63763a3ad42fd82259f1767db526cff94a14 |\
|
2015-01-19 11:18:28 -07:00
|
|
|
grep -v 4b76ec40c07078beaa2c5e250ed7d9bd6276a718 |\
|
2015-04-29 08:09:30 -07:00
|
|
|
grep -v ffc39dfbcb34eacc3ea12327a02b6e7741a2c207 |\
|
2015-05-08 11:32:02 -07:00
|
|
|
grep -v 32a76901a91ff0f663db6f0830e0aedec946e4d0 |\
|
2015-06-03 10:24:30 -07:00
|
|
|
grep -v af3288043a49bcc28f8ae3060852a09de552fe5f |\
|
|
|
|
grep -v 3626003f680bad3e63677982576d3a05421e88e9
|
2014-08-25 05:55:08 -07:00
|
|
|
}
|
|
|
|
|
2014-11-18 07:13:19 -07:00
|
|
|
print-missing-authors() {
|
|
|
|
for email in $(missing-authors) ; do
|
2014-09-03 23:31:38 -07:00
|
|
|
git log --author="$email" --format="%H %ae %s" | no-docs-typos
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
print-missing-copyright() {
|
2015-05-21 12:42:46 -07:00
|
|
|
find . -name \*.go | xargs egrep -L 'Copyright|automatically generated' | grep -v Godeps | grep -v internal/auto/
|
2014-09-03 23:31:38 -07:00
|
|
|
}
|
|
|
|
|
2014-12-08 05:59:34 -07:00
|
|
|
authors=$(print-missing-authors)
|
|
|
|
if [[ ! -z $authors ]] ; then
|
2014-12-08 07:41:08 -07:00
|
|
|
echo '***'
|
2014-12-08 05:59:34 -07:00
|
|
|
echo Author emails not in AUTHORS:
|
|
|
|
echo $authors
|
2014-12-08 07:41:08 -07:00
|
|
|
echo '***'
|
2014-12-08 05:59:34 -07:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
copy=$(print-missing-copyright)
|
|
|
|
if [[ ! -z $copy ]] ; then
|
2014-12-08 06:04:49 -07:00
|
|
|
echo ***
|
2014-12-08 05:59:34 -07:00
|
|
|
echo Files missing copyright notice:
|
|
|
|
echo $copy
|
2014-12-08 06:04:49 -07:00
|
|
|
echo ***
|
2014-12-08 05:59:34 -07:00
|
|
|
exit 1
|
|
|
|
fi
|
2014-08-25 05:55:08 -07:00
|
|
|
|