kernel-dev/docs/contribution.md

34 lines
1.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 向Metaverse内核贡献代码
通过如下方式向内核增加你的代码:
* 从[github仓库](https://github.com/metaverse-kernel/kernel-dev)或[Random World Studio内部仓库](http://git.suthby.org:2024/metaverse/kernel-dev)创建一个分支
* 在你的分支中增加代码
* 测试你增加的代码的正确性,并尽量确保对原有代码没有影响
* 无需在注释中加入代码更改日志git可以做到
* 在文档的适当的位置增加对新特性的描述
* 完成编码和文档的工作后向主仓库发送PR
* 等待审核代码
若你的代码通过审核将会把你的PR合并到主分支中。
## 开发引导
## vscode
vscode下的`rust-analyzer`插件会在`src/lib.rs`中误报`can't find crate for test`,实际上在`Cargo.toml`中已经增加了`test = false`选项。
解决方法是在`.vscode/settings.json`中增加两项:
```json
"rust-analyzer.cargo.allTargets": false,
"rust-analyzer.cargo.extraArgs": [
"--target",
"开发的目标平台的unknown-none类型目标如x86_64-unknown-none"
]
```
## 需要注意的问题
* 在任何情况下不要使用Rust的panic。