Commit 90add4d4 authored by Administrator's avatar Administrator
Browse files

Check if text files have correct file ending

Correct two files which were incorrect.
parent b0268d0a
......@@ -81,6 +81,24 @@ FileFormatCheck:
- git fetch upstream
- ci_scripts/check-file-format.sh upstream
FileEndCheck:
stage: checkFormat
image: alpine
tags:
- docker
only:
refs:
- merge_requests
variables:
- $CI_MERGE_REQUEST_PROJECT_PATH == "CbmSoft/cbmroot_geometry" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"
script:
# Get the upstream repository manually. I did not find any other way to have it for
# comparison
- apk update && apk add git bash file
- ci_scripts/connect_upstream_repo.sh $CI_MERGE_REQUEST_PROJECT_URL
- git fetch upstream
- ci_scripts/check-file-ending.sh upstream
FileMediaCheck:
stage: checkFormat
image: alpine
......
......@@ -31,4 +31,4 @@
/pipe/ @e.clerkin
#setups
/setup/ @e.clerkin
\ No newline at end of file
/setup/ @e.clerkin
#!/bin/bash
# Copyright (C) 2021 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
# SPDX-License-Identifier: GPL-3.0-only
# First commited by Florian Uhlig
if [[ $# -eq 1 ]]; then
UPSTREAM=$1
else
if [ -z $UPSTREAM ]; then
UPSTREAM=$(git remote -v | grep git.cbm.gsi.de[:/]CbmSoft/cbmroot_geometry | cut -f1 | uniq)
if [ -z $UPSTREAM ]; then
echo "Error: Name of upstream repository not provided and not found by automatic means"
echo 'Please provide if by checking your remotes with "git remote -v" and exporting UPSTREAM'
echo "or passing as an argument"
exit -1
fi
fi
fi
echo "Upstream name is :" $UPSTREAM
# If one wants to find all files in the CbmRoot and not only the changed ones
# uncomment the follwing line and comment the next two
#CHANGED_FILES=$(find . -type f -not \( -path "./.git/*" -o -path "./geometry/*" -o -path "./input/*" -o -path "./external/*" -o -path "./parameters/*" -prune \))
BASE_COMMIT=$UPSTREAM/master
CHANGED_FILES=$(git diff --name-only $BASE_COMMIT)
for file in $CHANGED_FILES; do
# First check for text files and only do the further test on line endings
# for text files
result=$(file $file | grep -v text)
if [[ -z $result ]]; then
if [[ $(tail -c 1 $file) ]]; then
echo "File $file does not finish with end of line"
okay=false
fi
fi
done
if [[ "$okay" = "false" ]]; then
echo ""
echo "Not all files have the correct file ending"
echo "Test failed"
echo ""
exit 1
else
exit 0
fi
Cylindrical RICH geometry SIS100 rich_v17a_1e – standard SIS100 (gdml, root) geometry with all mirror tiles. rich_v17a_1e_nobpmt – SIS100 (gdml, root) geometry without 4 most inner mirror tiles close to the beam pipe. Not for the common use. SIS300 rich_v17a_3e (gdml, root) – standard SIS300 geometry without 4 most inner mirror tiles close to the beam pipe. rich_v17a_3e_full_mirror (gdml, root) – SIS300 geometry with all mirror tiles. Not for the common use.
\ No newline at end of file
Cylindrical RICH geometry
SIS100
rich_v17a_1e – standard SIS100 (gdml, root) geometry with all mirror tiles.
rich_v17a_1e_nobpmt – SIS100 (gdml, root) geometry without 4 most inner mirror tiles close to the beam pipe. Not for the common use.
SIS300
rich_v17a_3e (gdml, root) – standard SIS300 geometry without 4 most inner mirror tiles close to the beam pipe.
rich_v17a_3e_full_mirror (gdml, root) – SIS300 geometry with all mirror tiles. Not for the common use.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment