创建GitHub Pull Request和Issue模板

There's nothing more frustrating than getting an incomplete bug report.  I've often seen bug reports containing a useless "{x} feature doesn't work"; no steps to reproduce, no URL, no browser or device information, just a hopelessly vague message.  Similar is receiving a pull request or patch which doesn't state its intent and doesn't provide steps to test (and what about unit tests?).  Now that many projects are public, most on GitHub, I've seen a massive rise in these types of sparsely documented issues and pull requests.

没有比不完整的错误报告更令人沮丧的了。 我经常看到错误报告包含无效的“ {x}功能不起作用”; 没有重现步骤,没有URL,没有浏览器或设备信息,只是一条毫无希望的模糊信息。 类似的是接收到一个拉取请求或补丁,该请求未声明其意图且未提供测试步骤(单元测试又如何?)。 现在,许多项目都是公开的,大部分在GitHub上,我已经看到这类稀疏记录的问题和请求请求的数量大大增加。

I recently found out you an create pull request and issues templates so that when the user goes to file a pull request or issue, your template displays within the description textarea.  Let's have a look at how we can do that!

最近,我发现您创建了一个创建请求请求并发出了模板,因此当用户去提交请求请求或发出时,您的模板将显示在描述文本区域中。 让我们看看我们如何做到这一点!

创建模板文件 (Creating Template Files)

Creating and putting in place the template files is easy:

创建和放置模板文件很容易:

  • The proper place to put the template files is in a .github directory at the root of your repository

    放置模板文件的适当位置在存储库根目录的.github目录中

  • The templates are to be created in markdown format

    模板将以降价格式创建
  • The issues template text goes in a ISSUE_TEMPLATE.md file

    问题模板文本位于ISSUE_TEMPLATE.md文件中

  • The pull requests template text goes in a PULL_REQUEST_TEMPLATE.md file

    拉取请求模板文本放在PULL_REQUEST_TEMPLATE.md文件中

A great example of template usage can be seen in the A-Frame repository.  The issue template looks as follows:

A-Frame存储库中可以看到模板用法的一个很好的例子。 问题模板如下所示:


**Description:**

- A-Frame Version:
- Platform / Device:
- Reproducible Code Snippet or URL:

<!-- If you have a support question, please ask at https://stackoverflow.com/questions/ask/?tags=aframe rather than filing an issue. -->


If your community repositories suffer from lack of information in issues and pull requests, or you simply want to prevent the problem, create GitHub templates for developers.  They may not provide the information you'd like, but you can at least nudge them in the proper direction!

如果您的社区存储库因问题信息不足而无法发送请求,或者您只是想防止问题发生,请为开发人员创建GitHub模板。 它们可能不会提供您想要的信息,但是您至少可以向正确的方向轻推它们!

翻译自: https://davidwalsh.name/github-templates

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值