From bb44438fc691b00bdbb876ea2bf573cd15ac4eec Mon Sep 17 00:00:00 2001 From: Will Bainbridge Date: Tue, 19 Jun 2018 14:19:39 +0100 Subject: [PATCH] bin/tools/pre-commit-hook: Added banner check for case files Also fixed the formatting of the banners in the tutorials --- bin/tools/HookFunctions | 19 ++++++++++++++++++- .../combustion/coldEngineFoam/freePiston/0/U | 2 +- .../combustion/coldEngineFoam/freePiston/0/k | 2 +- .../combustion/coldEngineFoam/freePiston/0/p | 2 +- .../system/blockMeshDict | 2 +- .../combustion/reactingFoam/RAS/DLR_A_LTS/0/G | 2 +- .../reactingFoam/RAS/SandiaD_LTS/0/G | 2 +- .../RAS/SandiaD_LTS/system/sampleDict | 2 +- .../membrane/constant/combustionProperties | 2 +- .../rhoSimpleFoam/aerofoilNACA0012/0/U | 2 +- .../periodicCubeArgon/system/potentialDict | 2 +- .../constant/heater/thermophysicalProperties | 2 +- .../refineFieldDirs/system/blockMeshDict | 7 +++++++ .../constant/turbulenceProperties | 2 +- 14 files changed, 37 insertions(+), 13 deletions(-) diff --git a/bin/tools/HookFunctions b/bin/tools/HookFunctions index f71b2df153..0cc068ff8c 100755 --- a/bin/tools/HookFunctions +++ b/bin/tools/HookFunctions @@ -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 ) diff --git a/tutorials/combustion/coldEngineFoam/freePiston/0/U b/tutorials/combustion/coldEngineFoam/freePiston/0/U index 81c314be05..aacf8faa01 100644 --- a/tutorials/combustion/coldEngineFoam/freePiston/0/U +++ b/tutorials/combustion/coldEngineFoam/freePiston/0/U @@ -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 | | diff --git a/tutorials/combustion/coldEngineFoam/freePiston/0/k b/tutorials/combustion/coldEngineFoam/freePiston/0/k index b428f1080b..19b0e569fe 100644 --- a/tutorials/combustion/coldEngineFoam/freePiston/0/k +++ b/tutorials/combustion/coldEngineFoam/freePiston/0/k @@ -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 | | diff --git a/tutorials/combustion/coldEngineFoam/freePiston/0/p b/tutorials/combustion/coldEngineFoam/freePiston/0/p index 6676f4e209..4d9e2401f0 100644 --- a/tutorials/combustion/coldEngineFoam/freePiston/0/p +++ b/tutorials/combustion/coldEngineFoam/freePiston/0/p @@ -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 | | diff --git a/tutorials/combustion/fireFoam/LES/flameSpreadWaterSuppressionPanel/system/blockMeshDict b/tutorials/combustion/fireFoam/LES/flameSpreadWaterSuppressionPanel/system/blockMeshDict index b4802459ae..a5c7490d83 100644 --- a/tutorials/combustion/fireFoam/LES/flameSpreadWaterSuppressionPanel/system/blockMeshDict +++ b/tutorials/combustion/fireFoam/LES/flameSpreadWaterSuppressionPanel/system/blockMeshDict @@ -1,4 +1,4 @@ -/*-----------------------------*-C++-*---------------------------------------*\ +/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: dev | diff --git a/tutorials/combustion/reactingFoam/RAS/DLR_A_LTS/0/G b/tutorials/combustion/reactingFoam/RAS/DLR_A_LTS/0/G index f54721ebf5..6da92f734f 100644 --- a/tutorials/combustion/reactingFoam/RAS/DLR_A_LTS/0/G +++ b/tutorials/combustion/reactingFoam/RAS/DLR_A_LTS/0/G @@ -1,4 +1,4 @@ -/*--------------------------------*- C++ -*----------------------------------* \ +/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: dev | diff --git a/tutorials/combustion/reactingFoam/RAS/SandiaD_LTS/0/G b/tutorials/combustion/reactingFoam/RAS/SandiaD_LTS/0/G index 7df3bfdcd0..6fbf18161e 100644 --- a/tutorials/combustion/reactingFoam/RAS/SandiaD_LTS/0/G +++ b/tutorials/combustion/reactingFoam/RAS/SandiaD_LTS/0/G @@ -1,4 +1,4 @@ -/*--------------------------------*- C++ -*----------------------------------* \ +/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: dev | diff --git a/tutorials/combustion/reactingFoam/RAS/SandiaD_LTS/system/sampleDict b/tutorials/combustion/reactingFoam/RAS/SandiaD_LTS/system/sampleDict index 282f0db8bc..732a5a694f 100644 --- a/tutorials/combustion/reactingFoam/RAS/SandiaD_LTS/system/sampleDict +++ b/tutorials/combustion/reactingFoam/RAS/SandiaD_LTS/system/sampleDict @@ -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 | | \*---------------------------------------------------------------------------*/ diff --git a/tutorials/combustion/reactingFoam/RAS/membrane/constant/combustionProperties b/tutorials/combustion/reactingFoam/RAS/membrane/constant/combustionProperties index d756b00a58..f165fbe751 100644 --- a/tutorials/combustion/reactingFoam/RAS/membrane/constant/combustionProperties +++ b/tutorials/combustion/reactingFoam/RAS/membrane/constant/combustionProperties @@ -1,4 +1,4 @@ -/*-----------------m---------------*- C++ -*----------------------------------*\ +/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: dev | diff --git a/tutorials/compressible/rhoSimpleFoam/aerofoilNACA0012/0/U b/tutorials/compressible/rhoSimpleFoam/aerofoilNACA0012/0/U index 5ba2d4133f..a76b985c13 100644 --- a/tutorials/compressible/rhoSimpleFoam/aerofoilNACA0012/0/U +++ b/tutorials/compressible/rhoSimpleFoam/aerofoilNACA0012/0/U @@ -1,4 +1,4 @@ -/*--------------------------------*- C++ -*----------------------------------* \ +/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: dev | diff --git a/tutorials/discreteMethods/molecularDynamics/mdEquilibrationFoam/periodicCubeArgon/system/potentialDict b/tutorials/discreteMethods/molecularDynamics/mdEquilibrationFoam/periodicCubeArgon/system/potentialDict index 4f408f3b7c..161de5cc14 100644 --- a/tutorials/discreteMethods/molecularDynamics/mdEquilibrationFoam/periodicCubeArgon/system/potentialDict +++ b/tutorials/discreteMethods/molecularDynamics/mdEquilibrationFoam/periodicCubeArgon/system/potentialDict @@ -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 { diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeaterRadiation/constant/heater/thermophysicalProperties b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeaterRadiation/constant/heater/thermophysicalProperties index e6e7b76fec..3569242da5 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeaterRadiation/constant/heater/thermophysicalProperties +++ b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeaterRadiation/constant/heater/thermophysicalProperties @@ -1,4 +1,4 @@ -/*--------------------------------*- C++ -*----------------------------------* \ +/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: dev | diff --git a/tutorials/mesh/refineMesh/refineFieldDirs/system/blockMeshDict b/tutorials/mesh/refineMesh/refineFieldDirs/system/blockMeshDict index cf3f3d5bdf..ddd2d4a6b2 100644 --- a/tutorials/mesh/refineMesh/refineFieldDirs/system/blockMeshDict +++ b/tutorials/mesh/refineMesh/refineFieldDirs/system/blockMeshDict @@ -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; diff --git a/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/constant/turbulenceProperties b/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/constant/turbulenceProperties index b51662ccfd..8f01328f79 100644 --- a/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/constant/turbulenceProperties +++ b/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/constant/turbulenceProperties @@ -1,4 +1,4 @@ -/*--------------------------------*- C++ -*----------------------------------* \ +/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: dev |