mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-09 14:50:56 +00:00
Script to fail build on missing authors and copyrights
This commit is contained in:
parent
6e83d11d5f
commit
12490eafff
@ -23,22 +23,20 @@ print-missing-authors() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
print-missing-copyright() {
|
print-missing-copyright() {
|
||||||
find . -name \*.go | xargs grep -L 'Copyright (C)' | grep -v Godeps
|
find . -name \*.go | xargs egrep -L 'Copyright \(C\)|automatically generated' | grep -v Godeps | grep -v internal/auto/
|
||||||
}
|
}
|
||||||
|
|
||||||
print-line-blame() {
|
authors=$(print-missing-authors)
|
||||||
for f in $(find . -name \*.go | grep -v Godep) gui/app.js gui/index.html ; do
|
if [[ ! -z $authors ]] ; then
|
||||||
git blame --line-porcelain $f | grep author-mail
|
echo Author emails not in AUTHORS:
|
||||||
done | sort | uniq -c | sort -n
|
echo $authors
|
||||||
}
|
exit 1
|
||||||
echo Author emails missing in AUTHORS file:
|
fi
|
||||||
print-missing-authors
|
|
||||||
echo
|
|
||||||
|
|
||||||
echo Files missing copyright notice:
|
copy=$(print-missing-copyright)
|
||||||
print-missing-copyright
|
if [[ ! -z $copy ]] ; then
|
||||||
echo
|
echo Files missing copyright notice:
|
||||||
|
echo $copy
|
||||||
echo Blame lines per author:
|
exit 1
|
||||||
print-line-blame
|
fi
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user