Files
ios-client/CONTRIBUTING.md
2026-09-14 21:10:44 +08:00

1.0 KiB
Raw Permalink Blame History

贡献指南

架构约束(提交前必须遵守)

  • 依赖单向:App → feature → core,禁止反向 import。
  • Repository 协议只在 CoreDomain,实现在 CoreRepository。
  • DTO 与领域 Model 分离(CoreNetwork / CoreModel)。
  • 禁止命名模块 CoreData(与苹果框架撞名,统一为 CoreRepository)。

代码规范

  • 跨模块符号 public + /// 文档注释。
  • 领域模型标记 Sendable。
  • ViewModel:@MainActor @Observable,UiState 用 enum。
  • 引入任何第三方依赖前,需在 PR 说明必要性(项目默认零第三方框架)。

提交流程

  1. 从 main 新建分支:feat/xxx、fix/xxx。
  2. 本地跑通:
    swiftlint lint
    xcodebuild -project ios-client.xcodeproj -scheme ios-client \
      -destination 'generic/platform=iOS Simulator' \
      CODE_SIGNING_ALLOWED=NO build
    
  3. 发起 PR,至少一位 reviewer 通过后合并。

Commit 规范

采用 Conventional Commits:feat: / fix: / refactor: / docs: / chore:。