Skip to content

如何贡献

欢迎参与贡献!以下是入门指南。

快速开始

bash
git clone https://github.com/Totoro-jam/battle-tested-patterns.git
cd battle-tested-patterns
pnpm install
pnpm dev        # 启动文档站开发服务器
pnpm test       # 运行所有测试(exercises + docs 组件)

贡献类型

添加新模式

  1. 开一个 Issue 提议该模式
  2. 遵循 SOP 01: 新增模式
  3. 提交 PR 并填写完整的 checklist

添加语言实现

修复失效链接

改进文档

  • 修正拼写、澄清说明、改进图示
  • 使用 commit 类型 docs:

质量标准

每个模式必须满足以下最低要求:

  • ≥ 2 个生产验证,附带精确到行号的 GitHub 链接
  • TypeScript 实现 + ≥ 1 种其他语言(Rust/Go/Python)
  • 4 种语言的练习文件(TS、Rust、Go、Python)+ 答案文件
  • 中文翻译且代码块一致
  • 所有测试通过(pnpm test · cargo test · go test ./... · pytest),无 lint 错误

完整检查清单见 PR 模板

提交规范

使用 Conventional Commits

text
feat: add cooperative-scheduling pattern
fix: update broken Linux source link in bitmask
docs: improve Core Idea diagram for double-buffering
test: add advanced exercise for min-heap
ci: add Go test step to CI workflow
chore: update dependencies

基于 MIT 许可证发布。