Skip to content

Commit f386286

Browse files
Copilotleofang
andcommitted
Phase 4: Add pre-commit hook to prevent new markdown files in docs/source/
Co-authored-by: leofang <5534781+leofang@users.noreply.github.com>
1 parent 547eea2 commit f386286

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

.pre-commit-config.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@ repos:
3030
language: python
3131
additional_dependencies:
3232
- https://files.pythonhosted.org/packages/cc/20/ff623b09d963f88bfde16306a54e12ee5ea43e9b597108672ff3a408aad6/pathspec-0.12.1-py3-none-any.whl
33+
34+
- id: no-markdown-in-docs-source
35+
name: Prevent markdown files in docs/source directories
36+
entry: bash -c
37+
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 reStructuredText (.rst) instead."; exit 1; fi']
38+
language: system
39+
pass_filenames: false
40+
always_run: true
3341

3442
- repo: https://github.com/PyCQA/bandit
3543
rev: 2d0b675b04c80ae42277e10500db06a0a37bae17 # frozen: 1.8.6

0 commit comments

Comments
 (0)