10.7 向Sway贡献 (Contributing To Sway)
Thanks for your interest in contributing to Sway! This document outlines the process for installing and setting up the Sway toolchain for development, as well as some conventions on contributing to Sway.
感谢您有兴趣为 Sway 做出贡献!本文档概述了安装和设置 Sway 工具链以进行开发的过程,以及一些为 Sway 做出贡献的约定。
If you run into any difficulties getting started, you can always ask questions on our Discourse.
如果您在入门时遇到任何困难,可以随时在我们的Discourse 上提问。
构建和设置开发工作区 (Building and setting up a development workspace)
See the introduction section for instructions on installing and setting up the Sway toolchain.
有关安装和设置 Sway 工具链的说明,请参阅简介部分。
获取存储库 (Getting the repository)
Visit the Sway repo and fork the project. 访问 Sway 存储库并分叉该项目。
Then clone your forked copy to your local machine and get to work. 然后将您的分叉副本克隆到本地计算机并开始工作。
构建和测试 (Building and testing)
The following steps will run the sway test suite and ensure that everything is set up correctly.
以下步骤将运行 sway 测试套件并确保一切设置正确。
First, open a new terminal and start fuel-core
with:
首先,打开一个新终端并启动fuel-core
:
Then open a second terminal, cd into the sway
repo and run:
然后打开第二个终端,进入sway
存储库并运行:
After the test suite runs, you should see:
测试套件运行后,您应该看到:
Congratulations! You've now got everything setup and are ready to start making contributions.
恭喜!现在您已完成所有设置并准备好开始做出贡献。
寻找一些可以做的事情 (Finding something to work on)
There are many ways in which you may contribute to the Sway project, some of which involve coding knowledge and some which do not. A few examples include:
您可以通过多种方式为 Sway 项目做出贡献,其中一些涉及编码知识,另一些则不需要。一些例子包括:
Reporting bugs 报告错误
Adding documentation to the Sway book 向 Sway 书中添加文档
Adding new features or bugfixes for which there is already an open issue 添加已存在未决问题的新功能或错误修复
Making feature requests 提出功能请求
Check out our Help Wanted, Sway Book or Good First Issue issues to find a suitable task.
查看我们的 需要帮助 Help Wanted, Sway手册 Sway Book or 好的初次问题 Good First Issue问题,找到合适的任务。
If you are planning something big, for example, related to multiple components or changes current behaviors, make sure to open an issue to discuss with us before starting on the implementation.
如果您正在计划一些大的事情,例如与多个组件相关或更改当前行为,请务必在开始实施之前提出问题与我们讨论。
贡献流程 (Contribution flow)
This is a rough outline of what a contributor's workflow looks like:
这是贡献者工作流程的粗略轮廓:
Make sure what you want to contribute is already tracked as an issue.
We may discuss the problem and solution in the issue.
确保您想要贡献的内容已作为问题进行跟踪。
我们可以讨论问题中的问题和解决方案。
Create a Git branch from where you want to base your work. This is usually master.
从您想要作为工作基础的位置创建一个 Git 分支。这通常是大师。
Write code, add test cases, and commit your work.
编写代码、添加测试用例并提交您的工作。
Run tests and make sure all tests pass.
运行测试并确保所有测试都通过。
If the PR contains any breaking changes, add the breaking label to your PR.
如果 PR 包含任何重大更改,请将重大更改标签添加到您的 PR 中。
Push your changes to a branch in your fork of the repository and submit a pull request.
Make sure mention the issue, which is created at step 1, in the commit message.
将您的更改推送到存储库分支中的分支并提交pull请求。
确保在提交消息中提及在步骤 1 中创建的问题。
Your PR will be reviewed and some changes may be requested.
Once you've made changes, your PR must be re-reviewed and approved.
If the PR becomes out of date, you can use GitHub's 'update branch' button.
If there are conflicts, you can merge and resolve them locally. Then push to your PR branch. Any changes to the branch will require a re-review.
您的 PR 将被审核,并且可能会要求进行一些更改。
一旦您做出更改,您的 PR 必须重新审核并获得批准。
如果 PR 过时,您可以使用 GitHub 的“更新分支”按钮。
如果有冲突,可以在本地合并并解决。然后推送到您的 PR 分支。对分支机构的任何更改都需要重新审查。
Our CI system (Github Actions) automatically tests all authorized pull requests.
我们的 CI 系统(Github Actions)自动测试所有授权的pull请求。
Use Github to merge the PR once approved.
获得批准后,使用 Github 合并 PR。
Thanks for your contributions! 感谢您的贡献!
链接问题 (Linking issues)
Pull requests should be linked to at least one issue in the same repo.
pull请求应链接到同一存储库中的至少一个问题。
If the pull request resolves the relevant issues, and you want GitHub to close these issues automatically after it merged into the default branch, you can use the syntax (KEYWORD #ISSUE-NUMBER
) like this:
如果pull请求解决了相关问题,并且您希望 GitHub 在合并到默认分支后自动关闭这些问题,您可以使用如下语法 (KEYWORD #ISSUE-NUMBER
):
If the pull request links an issue but does not close it, you can use the keyword ref
like this:
如果pull请求链接了一个问题但没有关闭它,您可以使用关键字ref
,如下所示:
Multiple issues should use full syntax for each issue and separate by a comma, like:
多个问题应该对每个问题使用完整的语法并用逗号分隔,例如:
Last updated