From dc2f77ccbd607e629a12260fedaebb91c67e353b Mon Sep 17 00:00:00 2001 From: paschal533 Date: Thu, 8 May 2025 21:40:18 +0100 Subject: [PATCH] Fix check-rst-files hook to work cross-platform --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7200e46b..1712b7f1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -55,7 +55,7 @@ repos: hooks: - id: check-rst-files name: Check for .rst files in the top-level directory - entry: sh -c 'ls *.rst 1>/dev/null 2>&1 && { echo "found .rst file in top-level folder"; exit 1; } || exit 0' + entry: python -c "import glob, sys; rst_files = glob.glob('*.rst'); sys.exit(1) if rst_files else sys.exit(0)" language: system always_run: true pass_filenames: false