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模板。 它们可能不会提供您想要的信息,但是您至少可以向正确的方向轻推它们!