Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,20 @@ repos:
- id: ruff
args: [ --fix ]
- id: ruff-format

# The docs site renders docstrings through mkdocstrings with the Google
# parser, which treats them as Markdown, so Sphinx/RST markup leaks through
# verbatim onto the published API pages. Scoped to src/ because test
# docstrings are never rendered.
- repo: local
hooks:
- id: no-rst-roles
name: No Sphinx/RST roles or directives in docstrings (docs render as Markdown)
language: pygrep
entry: ':(class|meth|func|mod|attr|data|exc|obj|ref):`|^\s*\.\. [a-z-]+::'
files: ^packages/[^/]+/src/.*\.py$
- id: no-rst-literal-blocks
name: No RST literal-block markers in docstrings (use a fenced code block)
language: pygrep
entry: '::$'
files: ^packages/[^/]+/src/.*\.py$
Loading