Repository navigation
fix(pr-body): 识别 CommonMark 合法 H2 写法 (#334) - #1
Closed
Casper-Mars wants to merge 1 commit into
Closed
Casper-Mars wants to merge 1 commit into
Casper-Mars wants to merge 1 commit into
Conversation
原因:HEADING 正则不接受 0–3 前导空格、也不剥离 ATX 闭合井号,
`## Summary ##` 被解析成 `summary ##`、` ## Summary` 完全不匹配,
四章齐全的正文被判缺章,create-pr 无法创建/更新 PR。
改动:
- HEADING 改为 `^ {0,3}##[ \t]+(.+?)[ \t]*$`
- 新增 normalize_heading:仅在「空白 + 行尾 #」时剥离闭合井号,`## C#` 仍是 `c#`
- fence / HTML 注释屏蔽逻辑未改
- 测试补 3 正 3 负,另加 1 条闭合井号不误剥
验证:python3 -m unittest discover -s .github/aicodingflow-tests → 533 tests OK
Owner
Author
|
已改为向上游 Terry-Mao/AICodingFlow 提跨仓 PR(Terry-Mao#339),此处关闭避免重复评审。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes Terry-Mao#334
Summary
validate_pr_body.py的二级标题正则只接受^##[ \t]+…$,既不接受 CommonMark 允许的 0–3 前导空格,也不剥离 ATX 闭合井号。四章齐全但写成## Summary ##/## Summary的 PR 正文因此被判缺章,create-pr无法创建或更新 PR。HEADING改为^ {0,3}##[ \t]+(.+?)[ \t]*$;normalize_heading():仅在「空白 + 一个或多个#位于行尾」时剥离闭合井号,## C#仍是c#,## Summary ## 补充仍是summary ## 补充;## Summary、## Summary ##、## Summary)与 3 个负向守卫(4 空格缩进、### Summary、##Summary),另加 1 条闭合井号边界用例;既有 9 个用例全部保留。Testing
环境:
python:3.12-slim(Python 3.12.16,与 CIpython-version: '3.12'一致)。既有校验入口端到端(
## Summary ##四章正文):即 Terry-Mao#334 的复现条件在旧脚本 exit 1、新脚本 exit 0。
Risk
#」限定并用## C#用例锁定;How to revert
Revert 本 PR 的 merge commit;无需数据或配置迁移。