2

我在我的项目中使用 TDD。
我写了一个测试,看着它失败,写代码让它变绿,然后用 Git 提交。
我已阅读有关提交优先开发的信息,但我不明白如何使用此工作流程进行操作。
如果我正在测试应用程序的一个层(如服务或存储库),我应该在提交中写什么样的评论,以便对其他人看起来不错?
我应该写测试的名称吗?你是如何处理这个问题的?

4

1 回答 1

0

TDD 更改的提交应该与任何其他更改没有什么不同。因此,您对提交消息应用相同的规则。

这是tpope 的一个例子

Capitalized, short (50 chars or less) summary

More detailed explanatory text, if necessary. Wrap it to about 72 characters or so. In some contexts, the first line is treated as the subject of an email and the rest of the text as the body. The blank line separating the summary from the body is critical (unless you omit the body entirely); tools like rebase can get confused if you run the two together.

Write your commit message in the imperative: "Fix bug" and not "Fixed bug" or "Fixes bug." This convention matches up with commit messages generated by commands like git merge and git revert.

Further paragraphs come after blank lines.

- Bullet points are okay, too

- Typically a hyphen or asterisk is used for the bullet, preceded by a single space, with blank lines in between, but conventions vary here

- Use a hanging indent

于 2013-09-26T22:44:24.883 回答