Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
openfoam
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Development
openfoam
Commits
ff37232f
Commit
ff37232f
authored
13 years ago
by
mattijs
Browse files
Options
Downloads
Patches
Plain Diff
ENH: commit-hook: added copyright check
parent
1bcecbf7
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bin/tools/pre-commit-hook
+21
-0
21 additions, 0 deletions
bin/tools/pre-commit-hook
with
21 additions
and
0 deletions
bin/tools/pre-commit-hook
+
21
−
0
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
#------------------------------------------------------------------------------
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment