[Tooling] Add RST single-backtick guardrail#7862
[Tooling] Add RST single-backtick guardrail#7862cutetocute wants to merge 6 commits intoPaddlePaddle:developfrom
Conversation
|
感谢你贡献飞桨文档,文档预览构建中,Docs-New 跑完后即可预览,预览链接:http://preview-pr-7862.paddle-docs-preview.paddlepaddle.org.cn/documentation/docs/zh/api/index_cn.html |
…eat/rst-single-backtick-guardrail
There was a problem hiding this comment.
Pull request overview
Adds a pre-commit/prek guardrail to detect and reject “bare” single-backtick interpreted text in .rst files, while allowing common valid RST patterns (roles and link/reference forms).
Changes:
- Introduce
ci_scripts/check_rst_single_backticks.pyto flag invalid single-backtick usage with file/line/column diagnostics. - Register a local pre-commit hook so the checker runs automatically on
.rstfiles.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| ci_scripts/check_rst_single_backticks.py | Implements the RST single-backtick detection and reporting logic. |
| .pre-commit-config.yaml | Wires the checker into pre-commit as a local hook for .rst files. |
You can also share your feedback on Copilot code review. Take the survey.
|
Addressed the current review feedback in aee9255.
Validation:
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
You can also share your feedback on Copilot code review. Take the survey.
|
Addressed the new review feedback in this update.
Validation:
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
You can also share your feedback on Copilot code review. Take the survey.
| continue | ||
| if indent > pending_indent: | ||
| in_literal_block = True | ||
| block_indent = pending_indent |
| if in_literal_block: | ||
| if not stripped: | ||
| continue | ||
| if indent > block_indent: |
|
Addressed the latest literal-block indent review in this update.
Validation:
|
|
Extra validation note on the latest indent change:
So this update does not change current findings, but keeps literal-block handling semantically safer for edge-case indentation patterns. |
|
no plan |
Summary
...and reference or link forms such astext_ andtext <url>_Validation
...andtext <url>_ passprek run --files ci_scripts/check_rst_single_backticks.py .pre-commit-config.yamlNotes