diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index cc817da97662480b0ed961cd14aae327c22f9708..d90f7fd0557c6a4ea8598619b3a952699ea80632 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -85,8 +85,6 @@ Check style:
     - |
       # pre-commit run --all-files
       pre-commit run --color=always --all-files || {
-        printf "${RED}The source code does not meet the style requirements:\n
-        ${CI_PROJECT_URL}/-/blob/${CI_DEFAULT_BRANCH}/CONTRIBUTING.md#coding-style.\n${DEFAULT}"
         git diff --ignore-submodules --patch-with-raw > "${STYLE_PATCH}"
         test -s "${STYLE_PATCH}" && {
           printf "${RED}At least some of the issues can be resolved with the patch (see artifacts):\n
@@ -95,6 +93,8 @@ Check style:
           printf "${RED}The issues cannot be resolved with a patch.\n${DEFAULT}"
           rm -rf "${STYLE_PATCH}"
         }
+        printf "${RED}You can reproduce this check locally with \`pre-commit run --all-files\`.
+      See also ${CI_PROJECT_URL}/-/blob/${CI_DEFAULT_BRANCH}/CONTRIBUTING.md#coding-style.\n${DEFAULT}"
         exit 1
       }
   artifacts: