mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: commit-hook: added copyright check
This commit is contained in:
@ -263,6 +263,26 @@ checkLineLengthNonDirective()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# check that OpenCFD copyright is currents
|
||||||
|
#
|
||||||
|
checkCopyright()
|
||||||
|
{
|
||||||
|
year=$(date +%Y)
|
||||||
|
echo "$hookName: check copyright ..." 1>&2
|
||||||
|
|
||||||
|
for f in $fileList
|
||||||
|
do
|
||||||
|
sYear=`grep "Copyright.*OpenCFD" $f | sed 's/[^0-9]//g' | cut -c 5-9`
|
||||||
|
if [ "$year" != "" ] && [ "$year" != "$sYear" ]; then
|
||||||
|
echo "Updated copyright for: $f"
|
||||||
|
sed -i "s/$sYear OpenCFD/$year OpenCFD/g" $f
|
||||||
|
fi
|
||||||
|
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Main code : do all checks
|
# Main code : do all checks
|
||||||
#
|
#
|
||||||
@ -276,6 +296,7 @@ checkIllegalCode
|
|||||||
# ensure code conforms to 80 columns max
|
# ensure code conforms to 80 columns max
|
||||||
checkLineLengthNonDirective
|
checkLineLengthNonDirective
|
||||||
|
|
||||||
|
checkCopyright
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user