Skip to content

Commit 0fea943

Browse files
committed
Copyright header check: Allow other authors
1 parent 74352d2 commit 0fea943

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

test.sh

+3-1
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@ then
88
exit 1
99
fi
1010
HEADERSIZE=$(wc -l < copyrightheader)
11+
# filter out the line that contains year, author name(s) and at least one email adress enclosed in <>
12+
IGNORE_AUTHOR_LINE_REGEXP='^ \* Copyright \(C\) 20[0-9]{2}.*<.*@.*>.*$'
1113
ERRORS=0
1214
for f in $(find src -name '*.java')
1315
do
14-
if ! cat $f|head -n $HEADERSIZE|diff - copyrightheader > /dev/null
16+
if ! diff <(cat $f | head -n $HEADERSIZE | egrep -v "$IGNORE_AUTHOR_LINE_REGEXP") <(cat copyrightheader | egrep -v "$IGNORE_AUTHOR_LINE_REGEXP")
1517
then
1618
echo "Copyright header mismatch on $f"
1719
ERRORS=1

0 commit comments

Comments
 (0)