From b6406e412d09dfe2a5db51782227816824e0ed28 Mon Sep 17 00:00:00 2001
From: "orestis.malaspin" <orestis.malaspinas@hesge.ch>
Date: Tue, 8 Aug 2023 10:35:07 +0200
Subject: [PATCH] Checks format in CI

---
 .gitlab-ci.yml     | 1 +
 codes/run_tests.sh | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index d30a252..5576da4 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -7,6 +7,7 @@ before_script:
   - mkdir -p $HOME/.cargo/bin
   - curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.31/mdbook-v0.4.31-x86_64-unknown-linux-musl.tar.gz | tar -xz --directory=$HOME/.cargo/bin
   - export PATH=$PATH:$HOME/.cargo/bin
+  - rustup component add rustfmt
   ##
   ## Install ssh-agent if not already installed, it is required by Docker.
   ##
diff --git a/codes/run_tests.sh b/codes/run_tests.sh
index 8c2e74c..0042431 100755
--- a/codes/run_tests.sh
+++ b/codes/run_tests.sh
@@ -14,4 +14,6 @@ for d in *; do
     cargo test --manifest-path $d/Cargo.toml --workspace --verbose
     echo ==================== Running cargo doc for $d  ====================
     cargo doc --manifest-path $d/Cargo.toml
+    echo ==================== Running cargo fmt for $d  ====================
+    cargo fmt --all --manifest-path $d/Cargo.toml -- --check
 done
-- 
GitLab