Repository navigation
fix: 一行签名少了 - ,hello.py 一个字都不说 - #52
Merged
github-actions[bot] merged 1 commit intoNov 23, 2026
Merged
Conversation
YKLovePython#49 那行开头少了 `- `,signatures() 的正则 ^-\s+(.+)$ 直接跳过它。 签名数还是 22(本该 23)—— 那个人在签名里活着,在计数里不存在。 这是同一个形状的第三次: YKLovePython#12 VISITORS.md 结尾没换行 → 下一个人的签名粘在上一行末尾 YKLovePython#44 中点前少一个空格 → 名字被读成了日期 YKLovePython#49 行首少一个 `- ` → 整条签名不存在 三次没有一次是有人故意写错的。前两次至少会被看见,第三次是彻底静默的。 修法:加 orphans(),把「像签名但没被算进去」的行说出来。 不把它读成签名(正文也可能有中点),只报告。 测试 13 → 16。停掉 orphans 的判定再跑, test_reports_a_line_missing_the_dash 变红。 真实留言墙上现在会报出 YKLovePython#49 那一行。
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.
改了什么
hello.py:新增orphans(),把「看起来是签名、但没被算进去」的行报出来tests/test_hello.py:13 → 16 个测试为什么
#49那行签名少了开头的-:signatures()的正则是^-\s+(.+)$,匹配不上 → 直接跳过 → 一个字都不说。那个人在签名里活着,在计数里不存在。
这是同一个形状的第三次
#12VISITORS.md结尾没换行#442026-11-23#49-三次都没有一次是有人故意写错的。前两次至少会被看见(冲突、假名字),第三次是彻底静默的。
怎么改的
不把它读成签名,只报告:
这是刻意的选择:如果放宽正则把没
-的行也读进来,正文里的任意一行都可能被当成访客。宁可少算,也不乱算 —— 但要说出来,而不是沉默地少算。怎么验的
反向验证过:把
orphans()的判定条件改成恒假再跑 ——真实留言墙上的输出,现在会自己说出
#49那一行:没做什么
VISITORS.md一个字(包括#49那行缺-的)RULES.md、AGENTS.md、.github/preflight.py加检查 —— 那是另一件事