Przeglądaj źródła

HUE-9049 [ci] Convert check for non ASCII to check for non UTF

Not 100% complete as should fail only on invalid sequences, so
set to not blocking for now.
Romain 6 lat temu
rodzic
commit
26af50e510
2 zmienionych plików z 5 dodań i 4 usunięć
  1. 1 1
      .circleci/config.yml
  2. 4 3
      tools/ci/check_for_invalid_characters.sh

+ 1 - 1
.circleci/config.yml

@@ -86,7 +86,7 @@ jobs:
           command: |
             cd ~/repo
 
-            ./tools/ci/check_non_ascii_characters.sh
+            ./tools/ci/check_for_invalid_characters.sh
 
       - run:
           name: run js lint

+ 4 - 3
tools/ci/check_non_ascii_characters.sh → tools/ci/check_for_invalid_characters.sh

@@ -21,12 +21,13 @@ FOUND_ISSUE=0
 
 for f in `git diff --name-only origin/master --diff-filter=b`
 do
- grep --color='auto' -P -n "[^\x00-\x7F]" --binary-files=without-match $f
+ grep --color='auto' -P -n "[\x80-\xFF]" --binary-files=without-match $f
  if [ "$?" -eq "0" ]
   then
-    echo "Non ASCII characters found in $f"
+    echo "Invalid characters found in $f"
     FOUND_ISSUE=-1
   fi
 done
 
-exit $FOUND_ISSUE
+#exit $FOUND_ISSUE
+echo $FOUND_ISSUE