From a6676ea0b089c6207164adf63f078e9f88022fbf Mon Sep 17 00:00:00 2001
From: Erwan Rouchet <rouchet@teklia.com>
Date: Fri, 13 Sep 2024 15:02:56 +0200
Subject: [PATCH] Move hook to tools/pre-commit-hooks

---
 .pre-commit-config.yaml | 9 +++------
 ci/long-test-files.sh   | 2 --
 2 files changed, 3 insertions(+), 8 deletions(-)
 delete mode 100755 ci/long-test-files.sh

diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index c483214c1d..2048df6649 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -34,13 +34,10 @@ repos:
   - repo: meta
     hooks:
       - id: check-useless-excludes
-  - repo: local
+  - repo: https://gitlab.teklia.com/tools/pre-commit-hooks
+    rev: 0.1.0
     hooks:
       - id: long-test-files
-        name: Warn about long unit test files
-        language: script
-        entry: ci/long-test-files.sh
+        args: ['1000']
         # Only run on Arkindex unit test files
         files: '^arkindex\/[^\/]*\/tests\/(.*\/)?test_.*\.py'
-        # Always show output, even when the hook passes, since the hook only warns and doesn't fail
-        verbose: true
diff --git a/ci/long-test-files.sh b/ci/long-test-files.sh
deleted file mode 100755
index 0eac44393b..0000000000
--- a/ci/long-test-files.sh
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh
-wc -l "$@" | awk '$2 != "total" && $1 > 1000 { OFS=""; print $2, " is too long (", $1, " lines)" }'
-- 
GitLab