Skip to content

Commit 872c68e

Browse files
authored
chore(dev-tools): only check specific files when checking for markdown in docs/source (#1068)
1 parent 279c943 commit 872c68e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

.pre-commit-config.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,11 @@ repos:
3333
- id: no-markdown-in-docs-source
3434
name: Prevent markdown files in docs/source directories
3535
entry: bash -c
36-
args: ['if find . -path "*/docs/source/*.md" -not -path "./docs/README.md" | grep -q .; then echo "ERROR: Markdown files found in docs/source/ directories. Use reST (.rst) instead."; exit 1; fi']
36+
args:
37+
- 'for file in "$@"; do >&2 echo "error: markdown file "$file" found in a docs/source directory. Only reST (.rst) is allowed"; done && exit 1'
38+
- "_" # fake script name, because bash considers $0 (the first argument) to be the script name
3739
language: system
38-
pass_filenames: false
39-
always_run: true
40+
files: '^.*/docs/source/.*\.md$'
4041

4142
# Standard hooks
4243
- repo: https://github.com/pre-commit/pre-commit-hooks

0 commit comments

Comments
 (0)