diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 7eb5799002d6bf8eed308ad6e3a8b8f2c6481461..c31d062c3b98dcf879bb27fba7ef5e2dd180802d 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -12,8 +12,8 @@ stages:
         - main
         - merge_requests
     variables:
-        SRC_DIR: $CI_PROJECT_DIR                # Where the sources are
-        WORK_DIR: "/home/gitlab-runner/CI_$CI_PIPELINE_ID"    # Where we will work, so that it's not erased
+        SRC_DIR: $CI_PROJECT_DIR                            # Where the sources are
+        WORK_DIR: "/home/gitlab-runner/CI_$CI_PIPELINE_ID"  # Where we will work, so that it's not erased
 
 .breaking_tests: &breaking_tests
     allow_failure: true
@@ -29,16 +29,24 @@ env_sanitize:
     <<: *main_tests
     stage: initialization
     script:
+        - cd $CI_PROJECT_DIR
         - export # For debug purpose
         - scripts/validate.bash --build=gcc --step=prepare
         - scripts/validate.bash --build=clang --step=prepare
         - echo "Env is intialized"
 
+style_verification:
+    <<: *main_tests
+    stage: initialization
+    script:
+        - cd $CI_PROJECT_DIR
+        - scripts/validate.bash --step=format
+
 env_finalize:
     <<: *main_tests
     stage: finalization
     allow_failure: true
-    when: on_success
+    when: always
     script: rm -rf $WORK_DIR
 
 #################################################
diff --git a/scripts/astyle.bash b/scripts/astyle.bash
index 6b170988d9f704bfb5ac6e4441c2e81e893d4198..22a8bd734db3dee27b6eb93def3b6b51b3e10375 100755
--- a/scripts/astyle.bash
+++ b/scripts/astyle.bash
@@ -1,26 +1,29 @@
-#!/bin/sh
+#!/bin/bash
 
 OPTIONS='
-  --style=linux -s4
-  --pad-oper --pad-header --pad-comma
-  --align-pointer=name --align-reference=name
-  --break-one-line-headers
-  --remove-braces
-  --break-return-type
-  --convert-tabs
-  --close-templates
-  --max-code-length=101
-  --mode=c
-  --lineend=linux
-  --attach-inlines
-  --indent-labels
-  --indent-col1-comments
-  --indent-preproc-block
-  --quiet'
+    --style=linux -s4
+    --pad-oper --pad-header --pad-comma
+    --align-pointer=name --align-reference=name
+    --break-one-line-headers
+    --remove-braces
+    --break-return-type
+    --convert-tabs
+    --close-templates
+    --max-code-length=101
+    --mode=c
+    --lineend=linux
+    --attach-inlines
+    --indent-labels
+    --indent-col1-comments
+    --indent-preproc-block'
 
+if [ $# -gt 0 ] && [ "$1" = "--check" ] ; then
+    astyle $OPTIONS --dry-run -R ./*.c | grep Formatted
+    [ $? -eq 1 ] && exit 0 || exit 1
+fi
 
-find . -iname '*.c'     -exec astyle $OPTIONS {} \;
-find . -iname '*.h'     -exec astyle $OPTIONS {} \;
-find . -iname '*.hpp'   -exec astyle $OPTIONS {} \;
-find . -iname '*.cpp'   -exec astyle $OPTIONS {} \;
-find . -iname '*.orig'  -exec rm {} \;
+find . -name '*.c'     -exec astyle $OPTIONS --quiet {} \;
+find . -name '*.h'     -exec astyle $OPTIONS --quiet {} \;
+find . -name '*.hpp'   -exec astyle $OPTIONS --quiet {} \;
+find . -name '*.cpp'   -exec astyle $OPTIONS --quiet {} \;
+find . -name '*.orig'  -exec rm {} \;
diff --git a/scripts/validate.bash b/scripts/validate.bash
index 1517ac0be340cc656968514e30e9b9e9d67e5bc6..89eddcc40d598542abab5604eb964b7f95dab70e 100755
--- a/scripts/validate.bash
+++ b/scripts/validate.bash
@@ -25,7 +25,7 @@ LKT_BUILD=""                # Build folder of lektor
 
 function test_simple ()
 {
-    check_cd $LKT_INSTALL
+    check_cd $LKT_INSTALL/bin/
     ./lektord &
     local _child_pid=$!
     ./lkt pwd=hashire adm kil
@@ -33,7 +33,7 @@ function test_simple ()
     kill $_child_pid
     wait $_child_pid
     local _child_sta=$?
-    [ _child_sta -ne 0 ] && die "The lektord process exited with $_child_sta"
+    [ $_child_sta -ne 0 ] && die "The lektord process exited with $_child_sta"
 }
 
 ### Utility functions ########################################################
@@ -72,7 +72,8 @@ Usage validate.bash --build=* --step=* [option]
     --help, -h      Prints this help message.
     --build=comp    Specify the compiler.
     --step=AA,BB,.. Specify the steps to do. The list may contains the
-                    following items: configure, launch, build.
+                    following items: prepare, configure, launch, build,
+                    cleanup, format.
 
 Step configure options:
     --debug             Perform a debug build.
@@ -135,19 +136,24 @@ function do_steps ()
     local _build=""
     local _configure=""
     local _launch=""
+    local _cleanup=""
+    local _format=""
     for step in $LKT_STEP ; do
         case "$step" in
             build)      _build="yes";;
             configure)  _configure="yes";;
             launch)     _launch="yes";;
             prepare)    _prepare="yes";;
+            format)     _format="yes";;
         esac
     done
 
+    [ "x$_format"    = "xyes" ] && do_format
     [ "x$_prepare"   = "xyes" ] && do_prepare
     [ "x$_configure" = "xyes" ] && do_configure
     [ "x$_build"     = "xyes" ] && do_build
     [ "x$_launch"    = "xyes" ] && do_launch
+    [ "x$_cleanup"   = "xyes" ] && do_cleanup
 }
 
 ### PERFORM THE TESTS ########################################################
@@ -164,6 +170,22 @@ function do_launch ()
     done
 }
 
+### PERFORM THE FORMAT CHECK #################################################
+function do_format ()
+{
+    ./scripts/astyle.bash --check
+    ! [ $? -eq 0 ] && die "Format is incorrect, use 'scripts/astyle.bash'"
+}
+
+### CLEANUP THE BUILD AND INSTALL FOLDERS ####################################
+# Globals:                                                                   #
+# - LKT_WORK                The folder in which everything is compiled and   #
+#                           installed with tests and others                  #
+function do_cleanup ()
+{
+    rm -rf $LKT_WORK || die "Failed to clean directory $LKT_WORK"
+}
+
 ### PROCESS ARGS #############################################################
 # Globals:                                                                   #
 # - LKT_DEBUG               Whether or not to build in debug mode            #