Skip to content

Repository files navigation

dochooks

Some pre-commit hooks for docs.

PyPI - Python VersionpypiPyPI - DownloadsLICENSE
uvruffGitmoji

Usage

.pre-commit-config.yaml

repos:
- repo: https://github.com/PFCCLab/dochooksrev: v0.6.0hooks:
- id: check-whitespace-between-cn-and-en-charfiles: \.md$|\.rst$
- id: insert-whitespace-between-cn-and-en-charfiles: \.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-conflictargs: ['--error-message="错误:检测到大小写冲突!\n{conflicts}"']

Pragma

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

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

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages