Skip to content

Commit dc2f77c

Browse files
paschal533pacrob
authored andcommitted
Fix check-rst-files hook to work cross-platform
1 parent 6064c96 commit dc2f77c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ repos:
5555
hooks:
5656
- id: check-rst-files
5757
name: Check for .rst files in the top-level directory
58-
entry: sh -c 'ls *.rst 1>/dev/null 2>&1 && { echo "found .rst file in top-level folder"; exit 1; } || exit 0'
58+
entry: python -c "import glob, sys; rst_files = glob.glob('*.rst'); sys.exit(1) if rst_files else sys.exit(0)"
5959
language: system
6060
always_run: true
6161
pass_filenames: false

0 commit comments

Comments
 (0)