From 5bce0f0535c396832d6be539789b96daa0772e89 Mon Sep 17 00:00:00 2001
From: Paul Dechamps <paul.dechamps@uliege.be>
Date: Tue, 29 Oct 2024 15:05:22 +0100
Subject: [PATCH] (fix) Modified format to exclude modules + changed validation
 cases output status in pipeline

---
 .gitlab-ci.yml   | 11 +++++++----
 format/format.py |  6 +++++-
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 658d295..57968f5 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -78,11 +78,14 @@ cvalidation:
     stage: validation
     script:
         - set +e
-        - python3 run.py blast/validation/raeValidation.py -v
-        - python3 run.py blast/validation/oneraValidation.py -v
-        - python3 run.py blast/validation/lannValidation.py -v
+        - python3 run.py blast/validation/raeValidation.py -v; RAE_STATUS=$?
+        - python3 run.py blast/validation/oneraValidation.py -v; ONERA_STATUS=$?
+        - python3 run.py blast/validation/lannValidation.py -v; LANN_STATUS=$?
         - set -e
-        - if [ $? -ne 0 ]; then exit 1; fi
+        - echo "RAE Validation Status: $RAE_STATUS"
+        - echo "ONERA Validation Status: $ONERA_STATUS"
+        - echo "LANN Validation Status: $LANN_STATUS"
+        - if [ $RAE_STATUS -ne 0 ] || [ $ONERA_STATUS -ne 0 ] || [ $LANN_STATUS -ne 0 ]; then exit 1; fi
     dependencies:
         - build
     when: manual
diff --git a/format/format.py b/format/format.py
index 49016bb..6696f99 100755
--- a/format/format.py
+++ b/format/format.py
@@ -21,6 +21,8 @@ def all_files(root,
     patterns = patterns.split(';')
     skips = skips.split(';')
     for path, subdirs, files in os.walk(root):
+        if 'modules' in path.split(os.sep):
+            continue
         if yield_folders:
             files.extend(subdirs)
         files.sort()
@@ -44,12 +46,14 @@ def main():
     # loop over all files and format them
     encs = {}
     for f in all_files(os.getcwd(), patterns='*.cpp;*.c;*.h;*.hpp'):
+        print('Checking file', 'blaster'+f.split('blaster', 1)[-1], end='...')
         # print(f)
-        cmd = ['clang-format-10', "-style=file", "-i", f]
+        cmd = ['clang-format-11', "-style=file", "-i", f]
         retcode = subprocess.call(cmd)
         if retcode != 0:
             print(f'ERROR: retcode = {retcode}')
             break
+        print('done.')
 
 
 if __name__ == "__main__":
-- 
GitLab