bin/tools/pre-commit-hook: Added banner check for case files

Also fixed the formatting of the banners in the tutorials
This commit is contained in:
Will Bainbridge
2018-06-19 14:19:39 +01:00
parent 241b4a60fc
commit bb44438fc6
14 changed files with 37 additions and 13 deletions

View File

@ -91,6 +91,15 @@ scriptBanner="(\
)*?
#------------------------------------------------------------------------------"
dictBanner="\
/\*--------------------------------\*- C\+\+ -\*----------------------------------\*\\\\
\| ========= \| \|
\| \\\\\\\\ / F ield \| OpenFOAM: The Open Source CFD Toolbox \|
\| \\\\\\\\ / O peration \| Version: dev \|
\| \\\\\\\\ / A nd \| Web: www\.OpenFOAM\.org \|
\| \\\\\\\\/ M anipulation \| \|
\\\\\*---------------------------------------------------------------------------\*/"
#-----------------------------------------------------------------------------
@ -385,11 +394,11 @@ checkBanner()
badFiles=$(
for f in $fileList
do
# Source files
if git grep -q -e "Copyright (C) [0-9-]\+ OpenFOAM Foundation" $scopeGrep"$f"
then
case "$f" in
(*.c|*.C|*.Cver|*.cxx|*.dox|*.H|*.h)
# C++ Source
if ! git show $scopeShow"$f" | pcregrep -q -M "$sourceBanner"
then
echo $f
@ -407,6 +416,14 @@ checkBanner()
fi
;;
esac
# Case files
elif git grep -q -e "^FoamFile" $scopeGrep"$f"
then
if ! git show $scopeShow"$f" | pcregrep -q -M "$dictBanner"
then
echo $f
fi
fi
done
)

View File

@ -1,6 +1,6 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM:.Uhe Open Source CFD Toolbox |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |

View File

@ -1,6 +1,6 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM:.khe Open Source CFD Toolbox |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |

View File

@ -1,6 +1,6 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM:.phe Open Source CFD Toolbox |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |

View File

@ -1,4 +1,4 @@
/*-----------------------------*-C++-*---------------------------------------*\
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |

View File

@ -1,4 +1,4 @@
/*--------------------------------*- C++ -*----------------------------------* \
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |

View File

@ -1,4 +1,4 @@
/*--------------------------------*- C++ -*----------------------------------* \
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |

View File

@ -2,7 +2,7 @@
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,4 +1,4 @@
/*-----------------m---------------*- C++ -*----------------------------------*\
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |

View File

@ -1,4 +1,4 @@
/*--------------------------------*- C++ -*----------------------------------* \
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |

View File

@ -3,7 +3,7 @@
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
n| \\/ M anipulation | |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{

View File

@ -1,4 +1,4 @@
/*--------------------------------*- C++ -*----------------------------------* \
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |

View File

@ -1,3 +1,10 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;

View File

@ -1,4 +1,4 @@
/*--------------------------------*- C++ -*----------------------------------* \
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |