This website requires JavaScript.
0
Issues
Pull Requests
Milestones
Explore
0
Create…
New Repository
New Migration
New Organization
public
Signed in as
public
Profile
Starred
Subscriptions
Settings
Help
Sign Out
yws
/
lc-mcp
Watch
1
Star
0
Fork
0
Code
Issues
Pull Requests
Actions
Packages
Projects
Releases
Wiki
Activity
Files
lc-mcp
/
tests
/
or
Cancel
Edit File
Preview
Preview Changes
Spaces
Tabs
2
4
8
Wrap
No wrap
# -*- coding: utf-8 -*- """文档里引用的脚本/文件必须真实存在。 文档漂移是最难发现的一类问题: README 说"跑 install_xxx.ps1",而那个脚本早改名了 —— 读到的人会直接卡住, 而代码测试全绿。这个仓库的 README 就曾经写着 "每 5 分钟的会话看门狗 + 每天 05:30 一轮", 而实际早改成了 1 分钟 + 每 N 小时一轮。 这里只做机械检查: 文档中形如 scripts/xxx 或 docs/xxx.md 的路径必须存在。 判断"描述是否过时"做不到, 但"引用的东西还在不在"是能查的。 """ import re import unittest from pathlib import Path ROOT = Path(__file__).resolve().parents[1] DOCS = ['README.md', 'docs/WATCH.md'] # 只认仓库内的 scripts/ 与 docs/ 路径。 # 不要收 lc_mcp/ —— 文档里的 ~/lc_mcp/modules/convert.log 之类是**运行期产物**, # 在用户主目录下, 本来就不该出现在仓库里(第一版这么写导致误报)。 PATH_RE = re.compile(r'\b((?:scripts|docs)/[A-Za-z0-9_./-]+\.\w+)\b') class DocReferenceTest(unittest.TestCase): def refs(self, path): text = (ROOT / path).read_text(encoding='utf-8') return sorted(set(PATH_RE.findall(text))) def test_docs_exist(self): for d in DOCS: self.assertTrue((ROOT / d).exists(), '%s 不见了' % d) def test_referenced_files_exist(self): missing = [] for d in DOCS: for ref in self.refs(d): if not (ROOT / ref).exists(): missing.append('%s -> %s' % (d, ref)) self.assertFalse(missing, '文档引用了不存在的文件:\n ' + '\n '.join(missing)) def test_readme_points_at_the_watch_guide(self): """值守手册必须能从入口找到, 否则写了等于没写。""" text = (ROOT / 'README.md').read_text(encoding='utf-8') self.assertIn('docs/WATCH.md', text) def test_watch_guide_mentions_both_tasks(self): text = (ROOT / 'docs/WATCH.md').read_text(encoding='utf-8') for name in ('LcMCPConvertModules', 'LcKeepDisplay', 'LcMCPServer', 'LcMCPDailyCycle'): self.assertIn(name, text, '值守手册没提到 %s' % name) if __name__ == '__main__': unittest.main()
Commit Changes
Add a Signed-off-by trailer by the committer at the end of the commit log message.
Commit directly to the
codex/feedback-unattended-setup-20261004
branch.
Create a
new branch
for this commit and start a pull request.
Commit Changes
Cancel