make-repo-contribution

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Contribution guidelines

贡献指南

Most every project has a set of contribution guidelines everyone needs to follow when creating issues, pull requests (PR), or otherwise contributing code. These may include, but are not limited to:
  • Creating an issue before creating a PR, or creating the two in conjunction
  • Templates for issues or PRs that must be used depending on the change request being made
  • Guidelines on what needs to be documented in those issues and PRs
  • Tests, linters, and other prerequisites that need to be run before pushing any changes
Always remember, you are a guest in someone else's repository. As such, you need to follow the rules and guidelines set forth by the repository owner when contributing code.
几乎每个项目都有一套贡献指南,所有人在创建问题、拉取请求(PR)或以其他方式贡献代码时都需要遵循这些指南。这些指南可能包括但不限于:
  • 在创建PR之前先创建问题,或者同时创建两者
  • 根据所提出的变更请求,必须使用的问题或PR模板
  • 关于这些问题和PR中需要记录哪些内容的指南
  • 在推送任何变更之前需要运行的测试、代码检查工具(linters)以及其他前置要求
请始终记住,你是在他人的仓库中贡献代码。因此,在贡献时你需要遵循仓库所有者制定的规则和指南。

Using existing guidelines

使用现有指南

Before creating a PR or any of the steps leading up to it, explore the project to determine if there's any guidance. Places to explore include, but are not limited to:
  • README.md
  • CONTRIBUTING.md
  • Project documentation
  • Issue templates
  • Pull request or PR templates
If any of those exist or you discover documentation elsewhere in the repo, read through what you find, consider it, and follow the guidance to the best of your ability. If you have any questions or confusion, ask the user for input on how best to proceed. DO NOT create a PR until you're certain you've followed the practices.
在创建PR或进行任何相关准备步骤之前,请先探索项目以确定是否有相关指南。可以探索的地方包括但不限于:
  • README.md
  • CONTRIBUTING.md
  • 项目文档
  • 问题模板
  • 拉取请求(PR)模板
如果存在上述任何文档,或者你在仓库的其他地方发现了相关文档,请仔细阅读并尽可能遵循其中的指南。如果你有任何疑问或困惑,请向用户询问最佳的后续步骤。在确认已遵循所有规范之前,请勿创建PR。

No guidelines found

未找到指南

If no guidance is found, or doesn't provide guidance on certain topics, then use the following as a foundation for creating a quality contribution. ALWAYS defer to the guidance provided in the repository.
如果未找到指南,或者指南未涵盖某些主题,则可以以下列内容作为基础来创建高质量的贡献。请始终优先遵循仓库中提供的指南

Tasks

任务

Many repository owners will have guidance on prerequisite steps which need to be completed before a PR is to be created. This can include, but is not limited to:
  • building the project or generating assets
  • running linters and ensuring any issues are resolved
  • naming guidelines and other patterns
  • unit tests, end to end tests, or other tests which need to be created and pass
    • related, there may be required coverage percentages
Look through all guidance you find, and ensure any prerequisites have been satisfied.
许多仓库所有者会提供创建PR之前需要完成的前置步骤指南。这些步骤可能包括但不限于:
  • 构建项目或生成资源文件
  • 运行代码检查工具并确保所有问题都已解决
  • 命名规范和其他模式
  • 需要创建并通过的单元测试、端到端测试或其他测试
    • 相关地,可能会有要求的测试覆盖率百分比
请仔细查看你找到的所有指南,并确保满足所有前置要求。

Issue

问题

Always start by looking to see if an issue exists that's related to the task at hand. This may have already been created by the user, or someone else. If you discover one, prompt the user to ensure they want to use that issue, or which one they may wish to use.
If no issue is discovered, look through the guidance to see if creating an issue is a requirement. If it is, use the template provided in the repository. If there are multiple, choose the one that most aligns with the work being done. If there are any questions, ask the user which one to use.
If the requirement is to file an issue, but no issue template is provided, use this issue template as a guide on what to file.
始终先查看是否存在与当前任务相关的问题。这个问题可能是用户或其他人已经创建的。如果你找到了相关问题,请提示用户确认他们是否要使用该问题,或者他们希望使用哪个问题。
如果未找到相关问题,请查看指南以确定创建问题是否是一项要求。如果是,请使用仓库中提供的模板。如果有多个模板,请选择与当前工作最匹配的一个。如有任何疑问,请询问用户应使用哪个模板。
如果要求提交问题,但未提供问题模板,请参考此问题模板来提交问题。

Branch

分支

Before performing any commits, ensure a branch has been created for the work. Follow whatever guidance is provided by the repository's documentation. If prefixes are defined, like
feature
or
chore
, or if the requirement is to use the username of the person making the PR, then use that. This branch must never be
main
, or the default branch, but should be a branch created specifically for the changes taking place. If no branch is already created, create a new one with a good name based on the changes being made and the guidance.
在进行任何提交之前,请确保已为当前工作创建了分支。请遵循仓库文档中提供的任何指南。如果定义了前缀(如
feature
chore
),或者要求使用创建PR的用户的用户名作为前缀,请遵循这些要求。此分支绝不能是
main
分支或默认分支,而应该是专门为当前变更创建的分支。如果尚未创建分支,请根据变更内容和指南创建一个合适名称的新分支。

Commits

提交记录

When committing changes:
  1. Review all changes
  2. Logically group the changes together
  3. Create short commit messages for each group, following any guidance in the repository
  4. Commit the grouped code to the branch.
在提交变更时:
  1. 检查所有变更内容
  2. 将变更进行逻辑分组
  3. 为每个分组创建简短的提交信息,并遵循仓库中的任何指南
  4. 将分组后的代码提交到分支

Merging

合并

NEVER merge to main unless explicitly instructed to do so by the user
除非用户明确指示,否则绝不要合并到main分支

Pull request

拉取请求

When creating a pull request, use existing templates in the repository if any exist, following the guidance you discovered.
If no template is provided, use the this PR template. It contains a collection of headers to use, each with guidance of what to place in the particular sections.
If an issue was created or is being used, ensure that issue is referenced in the PR. Use the
Closes #NUMBER
syntax to enable auto-closing of the issue.
在创建拉取请求时,如果仓库中存在现有模板,请使用这些模板并遵循你找到的指南。
如果未提供模板,请使用此PR模板。该模板包含一系列标题,每个标题都有关于该部分应填写内容的指南。
如果已创建或正在使用某个问题,请确保在PR中引用该问题。使用
Closes #NUMBER
语法以启用问题的自动关闭。