Skip to content

[0054] gf fmt 添加基于文件系统的缓存机制#802

Merged
da-liii merged 3 commits into
mainfrom
da/0054/fmt_cache
May 20, 2026
Merged

[0054] gf fmt 添加基于文件系统的缓存机制#802
da-liii merged 3 commits into
mainfrom
da/0054/fmt_cache

Conversation

@da-liii
Copy link
Copy Markdown
Contributor

@da-liii da-liii commented May 20, 2026

Summary

  • gf fmt 添加文件系统缓存,跳过已格式化过的文件,提升批量格式化效率
  • 缓存路径:~/.cache/goldfish/fmt/{version}/{sha256前2字符}/{sha256剩余62字符}
  • 版本号体现在目录结构中,升级后旧缓存自动失效
  • format-file 新增 use-cache? 参数,单元测试时可关闭缓存

Test plan

  • bin/gf fmt tools/fmt/liii/goldfmt.scm 第一次格式化并缓存
  • bin/gf fmt tools/fmt/liii/goldfmt.scm 第二次命中缓存,显示 Cached
  • bin/gf fmt goldfish/liii/ 目录模式缓存正常工作
  • bin/gf fmt --changed-since=HEAD 模式缓存正常工作
  • bin/gf test tools/fmt 全部 24 个测试通过
  • bin/gf test hashlib 全部 7 个测试通过

🤖 Generated with Claude Code

da-liii and others added 3 commits May 20, 2026 22:13
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@da-liii da-liii merged commit f3d0112 into main May 20, 2026
4 checks passed
@da-liii da-liii deleted the da/0054/fmt_cache branch May 20, 2026 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant