conventionalcommits.org icon indicating copy to clipboard operation
conventionalcommits.org copied to clipboard

Title length

Open rnc opened this issue 4 years ago • 3 comments

In

<type>[optional scope]: <description>

[optional body]

[optional footer(s)]

does the first line have a maximum length? I can't see it anywhere in the specification.

rnc avatar Mar 12 '20 08:03 rnc

It doesn't have a min length since it is up to the project owner to set a limit. Most of the toolings have a restriction tho.

Do you think it'd bring benefit adding a max length?

damianopetrungaro avatar Mar 15 '20 20:03 damianopetrungaro

Depending upon how the change log is generated it might. But equally I think the specification should be clearer and explicitly state whether there is a maximum length :-)

rnc avatar Mar 18 '20 11:03 rnc

I think a recommendation would be nice/enough. There are several recommendations already written, for example about revert commits. Adding a recommended value or range would give devs the idea of what are the optimal limits are. I read somewhere that the title should be max 50 chars and body max 75. And I'm writing this because I thought that there is a limit on the website, but it is not even mentioned.

In my experience, 50 chars for the title is mostly enough (depends on how you describe the changes), and sometimes it isn't. I think 60 is ok. I recently started using CC, and the type(scope): eats "a lot of" precious chars, although this part is not useless and does contain useful information. But this is about 7 chars on the type(): and 5 or more on the scope, which I assume can have multiple words (since multiple words can be considered a "phrase"). In the end, we are left with 32–38 chars to describe what exactly was committed. So a +10 "recommended" limit would ease the process of composing the title.

We all know how we hate naming things (because it is hard to balance readability and conciseness), writing commit messages is kind of the same thing (write an informative title with a limited length).

Andrew15-5 avatar Oct 29 '23 17:10 Andrew15-5