Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
ff37232f
Commit
ff37232f
authored
Jul 29, 2011
by
mattijs
Browse files
ENH: commit-hook: added copyright check
parent
1bcecbf7
Changes
1
Hide whitespace changes
Inline
Side-by-side
bin/tools/pre-commit-hook
View file @
ff37232f
...
...
@@ -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
#------------------------------------------------------------------------------
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment