diff --git a/bob/devtools/scripts/ci.py b/bob/devtools/scripts/ci.py
index 6eaa9a0b4c2335f8b7e71352dfe14f787accd967..6d51c233f517d0f1a28d6293d9f18f0d36c90933 100644
--- a/bob/devtools/scripts/ci.py
+++ b/bob/devtools/scripts/ci.py
@@ -1013,3 +1013,11 @@ def check(root):
             "pyproject.toml file not found in the root folder of the package. "
             "See https://gitlab.idiap.ch/bob/bob/-/wikis/ci-checks#pyprojecttoml"
         )
+
+    # if there is a pre-commit file, run the tests
+    path = os.path.join(root, ".pre-commit-config.yaml")
+    if os.path.isfile(path):
+        from ..bootstrap import run_cmdline
+
+        run_cmdline(["pip", "install", "pre-commit"])
+        run_cmdline(["pre-commit", "run", "--all-files"])