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