Skip to content

Commit fd53de3

Browse files
committed
Correct issues in Copyright Check.
1 parent f295508 commit fd53de3

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

jenkins.check_copyright.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
exit(1)
3131

3232
with open(file_name, 'r') as sourcefile:
33-
for x in range(0,4):
33+
for x in range(0,len(copyright_lines)):
3434
# TODO add a check for empty files (dummy.js etc), as they cause the script to crash here
3535
line = next(sourcefile)
3636
line = line.rstrip()

jenkins.check_copyright.sh

+5-2
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,12 @@ if [ $? -ne 0 ]; then
1212
PATH=/bin:/usr/bin:$PATH
1313
fi
1414

15-
ERRFILE=jenkins.check_eol.sh.err
15+
ERRFILE=jenkins.check_copyright.sh.err
16+
ERRFILETEMP=$ERRFILE.0
1617
rm -f $ERRFILE
18+
rm -f $ERRFILETEMP
1719

20+
echo "Check Copyright > Begin Checking..."
1821
git diff --name-only `git merge-base origin/master HEAD` HEAD |
1922
grep -v -E '\.git.*' |
2023
grep -v -E '\.xml$' |
@@ -29,7 +32,7 @@ git diff --name-only `git merge-base origin/master HEAD` HEAD |
2932
grep -v -E '\.def$' |
3033
grep -v -E '\.inc$' |
3134
grep -v -E 'test/benchmarks/.*\.js$' |
32-
xargs -I % sh -c "echo Checking %; python jenkins.check_copyright.py % >> $ERRFILE"
35+
xargs -I % sh -c "echo 'Check Copyright > Checking %'; python jenkins.check_copyright.py % > $ERRFILETEMP; if [ \$? -ne 0 ]; then cat $ERRFILETEMP >> $ERRFILE; fi"
3336

3437
if [ -e $ERRFILE ]; then # if error file exists then there were errors
3538
>&2 echo "--------------" # leading >&2 means echo to stderr

0 commit comments

Comments
 (0)