Skip to content
Snippets Groups Projects
Commit ff37232f authored by mattijs's avatar mattijs
Browse files

ENH: commit-hook: added copyright check

parent 1bcecbf7
Branches
Tags
No related merge requests found
......@@ -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
#
......@@ -276,6 +296,7 @@ checkIllegalCode
# ensure code conforms to 80 columns max
checkLineLengthNonDirective
checkCopyright
exit 0
#------------------------------------------------------------------------------
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment