Skip to content
Snippets Groups Projects
Commit 38b3ebd1 authored by Administrator's avatar Administrator Committed by Florian Uhlig
Browse files

Fix test for files with non ASCII characters

The previous check was to general since it catched also files were non ASCII
characters are allowed (e.g. Latex files).
Now test only for source code files and check for files which are of
non ASCII type.
parent 7343ec13
No related branches found
No related tags found
1 merge request!2056Fix test for files with non ASCII characters
Pipeline #33441 passed
...@@ -20,9 +20,12 @@ fi ...@@ -20,9 +20,12 @@ fi
echo "Upstream name is :" $UPSTREAM echo "Upstream name is :" $UPSTREAM
BASE_COMMIT=$UPSTREAM/master BASE_COMMIT=$UPSTREAM/master
CHANGED_FILES=$(git diff --name-only $BASE_COMMIT) # check only source code files
CHANGED_FILES=$(git diff --name-only $BASE_COMMIT | grep -E '.*\.(h|hpp|c|C|cpp|cxx|tpl)$' | grep -viE '.*LinkDef.h$')
for file in $CHANGED_FILES; do for file in $CHANGED_FILES; do
result=$(file $file | grep UTF-8) # find all source code files which are non ASCII ones
result=$(file $file | grep -v ASCII)
if [[ "$result" != "" ]]; then if [[ "$result" != "" ]]; then
echo " " echo " "
echo "File $file contains non ASCII characters" echo "File $file contains non ASCII characters"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment