Skip to main content

dochooks

Some pre-commit hooks for docs.

PyPI - Python Version pypi PyPI - Downloads LICENSE
uv ruff Gitmoji

Usage

.pre-commit-config.yaml

repos:
   - repo: https://github.com/PFCCLab/dochooks
     rev: v0.6.0
     hooks:
        - id: check-whitespace-between-cn-and-en-char
          files: \.md$|\.rst$
        - id: insert-whitespace-between-cn-and-en-char
          files: \.md$|\.rst$
        - id: check-case-conflict

Hooks

check-whitespace-between-cn-and-en-char

用于检查中英文之间是否有空格

insert-whitespace-between-cn-and-en-char

用于自动在中英文之间添加空格

check-case-conflict

用于检测在大小写不敏感文件系统(如 APFS、NTFS)上可能冲突的文件名例如仓库中已有 file.txt,新建 File.txt 时会发现冲突。

自定义错误信息:

- id: check-case-conflict
  args: ['--error-message="错误:检测到大小写冲突!\n{conflicts}"']

Pragma

dochooks 支持 dochooks: skip-next-line 和 dochooks: skip-line 两种 pragma

<!-- dochooks: skip-next-line -->
这是一段中文and English混合的text
这是一段中文and English混合的text  <!-- dochooks: skip-line -->

Release files for dochooks 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dochooks 0.6.0
File Size Uploaded
dochooks-0.6.0.tar.gz 5.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dochooks 0.6.0
File Interpreter ABI Platform
dochooks-0.6.0-py3-none-any.whl Python 3 none any Details

Total release size: 15.2 kB

Release files / dochooks-0.6.0.tar.gz

Download URL dochooks-0.6.0.tar.gz
Size 5.6 kB
Tags Source
SHA-256 checksum
How to use checksums
28b093e08dccad16288b13cfc73897341973116f0417f231c1760461df171cb7
BLAKE2b-256 checksum
How to use checksums
c899170a69d9f6a36f17c64bf7a549d59ca9e51fedd3eda7d67a71f2ec68a969
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 30, 2025.

Transparency log

Release files / dochooks-0.6.0-py3-none-any.whl

Download URL dochooks-0.6.0-py3-none-any.whl
Size 9.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
65da3ed7f64ff7b8e5bbbb836118794b63b461cd8b6638e4a7ac8cc3858ae69a
BLAKE2b-256 checksum
How to use checksums
b17a1d85c65d867141004001b3d7bb2d025201e2a306860503caec10bc7ad7ab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 30, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

0.6.0 This release

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page