From e3ca2ba3893d7fd727a31c178148e334a8402039 Mon Sep 17 00:00:00 2001
From: Wallun <wallun@disroot.org>
Date: Fri, 10 Nov 2023 14:38:38 +0100
Subject: [PATCH] ci(gitlab): run pre-commit in test stage

---
 .ci/gitlab-ci.yaml      | 20 ++++++++++++++++++++
 .pre-commit-config.yaml | 12 +++---------
 2 files changed, 23 insertions(+), 9 deletions(-)
 create mode 100644 .ci/gitlab-ci.yaml

diff --git a/.ci/gitlab-ci.yaml b/.ci/gitlab-ci.yaml
new file mode 100644
index 0000000..4897fe4
--- /dev/null
+++ b/.ci/gitlab-ci.yaml
@@ -0,0 +1,20 @@
+---
+variables:
+  container_registry: docker.io
+  image_name: archlinux
+  image_version: latest
+
+stages:
+  - test
+  - doc
+
+pre-commit:
+  stage: test
+  image: ${container_registry}/${image_name}:${image_version}
+  before_script:
+    - pacman -Syu --noconfirm
+    - pacman -S git --noconfirm
+    - pacman -S pre-commit --noconfirm
+  script:
+    - pre-commit install -t pre-commit
+    - pre-commit run --all --verbose
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index abee963..6defc94 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -3,26 +3,20 @@ default_stages: [ commit, manual ]
 
 repos:
   - repo: https://github.com/pre-commit/pre-commit-hooks
-    rev: v4.4.0
+    rev: v4.5.0
     hooks:
       - id: no-commit-to-branch
         args: [ --branch, main ]
 
   - repo: https://github.com/pre-commit/pre-commit-hooks
-    rev: v4.4.0
+    rev: v4.5.0
     hooks:
       - id: trailing-whitespace
       - id: end-of-file-fixer
       - id: fix-byte-order-marker
 
   - repo: https://github.com/ansible-community/ansible-lint.git
-    rev: v6.14.0a0
+    rev: v6.22.0
     hooks:
       - name: Run ansible-lint
         id: ansible-lint
-
-  - repo: https://github.com/jorisroovers/gitlint
-    rev: v0.19.0dev
-    hooks:
-      - name: Run gitlint
-        id: gitlint
-- 
GitLab