-
Notifications
You must be signed in to change notification settings - Fork 0
Contributing
github-actions[bot] edited this page Jul 16, 2026
·
4 revisions
为 wknet 贡献代码或文档时遵守以下约定。产品方向与命名见 内部边界。
- C++17,符合
/kernel:无异常、无 RTTI - 可用
namespace、类、RAII、轻量模板 - 避免直接
new/delete(除非 lib 内重载);优先堆封装或 API Release - lib 内禁止栈缓冲,用堆;高频缓冲常驻 Workspace
- 函数
noexcept;SAL 注解(_In_、_Out_、_Must_inspect_result_等) - Debug/Release 均视警告为错误、最高警告等级;新增代码零警告
- 新功能必须补齐分级 Trace(Error / Warning / Info / Verbose|Max + 准确组件)
- 使用
pwsh,不要用powershell - 写完代码必须跑测试与 Debug 构建;禁止「冒烟走过场」
- 发现实现缺失时补全,不要忽视或降级
- 禁止把兜底 / 临时回退当作正式架构
Conventional Commits:
feat: 新功能
fix: 缺陷
docs: 文档
style: 格式
refactor: 重构
test: 测试
chore: 构建/工具
docsite 提交:
- docsite 变更与代码变更分两次提交
- docsite 提交 message 以
docsite:开头(触发 Wiki 单向同步) - 计划文档(
docs/plans/*)仅在用户明确要求时提交
Fork → 功能分支 → 提交 → Push → Pull Request。要求:风格一致、必要测试、相关文档、测试通过。
- 公开文档以
docsite/为准;能力分类以 能力边界 为准 - 字段与签名以
include/wknet为准,勿从过时 markdown 抄结构体 - 中英同批对等;勿留英文占位 stub
Follow these conventions when contributing code or docs. Product direction and naming: Internals.
- C++17 under
/kernel: no exceptions, no RTTI -
namespace, classes, RAII, and light templates are fine - Avoid raw
new/delete(unless overloaded in the lib); prefer heap wrappers or API Release - No stack buffers in the lib — use the heap; keep hot buffers resident in Workspace
- Functions are
noexcept; use SAL (_In_,_Out_,_Must_inspect_result_, …) - Debug/Release treat warnings as errors at the highest level; new code is warning-free
- New features must add tiered Trace (Error / Warning / Info / Verbose|Max + accurate component)
- Use
pwsh, notpowershell - After code changes, run tests and a Debug build — no token smoke passes
- If an implementation is missing, complete it; do not skip or downgrade
- Do not treat fallbacks or temporary shims as architecture
Conventional Commits:
feat: feature
fix: bug fix
docs: documentation
style: formatting
refactor: refactor
test: tests
chore: build/tooling
docsite commits:
- Split docsite changes from code changes into two commits
- Prefix docsite commits with
docsite:(triggers one-way Wiki sync) - Plan docs under
docs/plans/*are committed only when the user asks
Fork → feature branch → commit → push → PR. Requirements: style match, necessary tests, related docs, green tests.
- Public docs live under
docsite/; capability classification is in the capability matrix - Fields and signatures follow
include/wknet; do not copy structs from stale markdown - Ship Chinese and English together; no English placeholder stubs
- Ship Chinese and English together; no English stubs
-
开始使用 / Get Started
-
概念与行为 / Concepts
-
协议指南 / Protocols
-
API 参考 / API Reference
-
贡献与项目 / Contribute