按照常规提交规范,在提交消息标题中包括问题代码。

huangapple go评论46阅读模式
英文:

Including issue code in the commit message header according to Conventional Commits

问题

我正在遵循传统提交规范 v1.0.0来管理我的项目,并且我有一个关于在提交消息标题中包含问题代码的问题。假设我有一个代码为 "SPAN-500" 的问题。尽管规范没有明确提到问题代码,但我在网上看到了两种方式:

  1. 问题代码作为范围(scope)
feat(SPAN-500): 添加功能 X 来改进 Y
  1. 问题代码作为后缀
feat: 添加功能 X 来改进 Y [#SPAN-500]

我应该如何正确地将问题代码添加到提交消息标题中?

我希望确保我的提交消息遵循推荐的规范并保持一致性。非常感谢任何指导或示例。

谢谢!

英文:

I am following the Conventional Commits guidelines v1.0.0 for my project and I have a question about including the issue code in the commit message header. Let's say I have an issue with code "SPAN-500". Although the specification does not mention issue codes explicitly, I have seen online both:

  1. Issue code as scope
feat(SPAN-500): add feat X to improve Y
  1. Issue code as suffix
feat: add feat X to improve Y [#SPAN-500]

How should I properly add the issue code to the commit message header?

I want to ensure that my commit messages follow the recommended conventions and maintain consistency. Any guidance or examples would be greatly appreciated.

Thank you!

答案1

得分: 2

你应该不要将问题代码放在标题中。请遵循示例网站上给出的方式:添加一个额外的页脚,如Refs: #SPAN-500

使用“scope”字段来放置问题代码不是一个选项,因为

作用域必须由括号括起来描述代码库中的一部分的名词组成。

SPAN-500不是代码库的一部分,而是问题的代码。

英文:

> How should I properly add the issue code to the commit message header?

You should not put the issue code in the header. Follow the example given on the website: Add an additional footer like Refs: #SPAN-500.

Using the "scope" field to put the issue code is not an option because
> A scope MUST consist of a noun describing a section of the codebase surrounded by parenthesis.

and SPAN-500 is not a section of the codebase but the code of an issue.

huangapple
  • 本文由 发表于 2023年7月18日 05:37:09
  • 转载请务必保留本文链接:https://go.coder-hub.com/76708228.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定