Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ commit 50-character line length reminder

When committing a change on the IntelliJ platform, is there a way to have it check that the first line of the commit message does not exceed the 50-character length limit?

Right now, I'm usually checking this manually, with the position indicator in the lower right corner of the main IDE window (the one that is formatted as line:character). However that indicator is sometimes hidden by other tool windows, and requires me to have the cursor at the end of the first line. Is there some setting I can enable or some plugin I can install to have the IDE check this for me?

like image 794
gandreadis Avatar asked Dec 31 '16 11:12

gandreadis


People also ask

How many characters is a commit message?

Body line length limited to 80 characters The line length for the body text of a commit message should be constrained to 80 characters. Regardless of if you manually wrap the body line length to 80 characters or not, the body text will appear as wrapped as 80 characters in the GitHub UI.


2 Answers

For anyone still interested in this: I've come across a new setting which does allow what I initially wanted, in a settings group called 'Commit Dialog'.

Commit dialog limit

You can now have it warn you about a long subject line right in the dialog, without needing the visual aid of a delimiter!

like image 169
gandreadis Avatar answered Sep 21 '22 12:09

gandreadis


For newer IntelliJ versions (at least 2017 and above) read the (self-)answer of @gandreadis.


In older IntelliJ version you can set Right margin for commit messages to 50 characters in Settings/Version Control.

enter image description here

Then the commit message input should look like this:

enter image description here

like image 22
Bohuslav Burghardt Avatar answered Sep 22 '22 12:09

Bohuslav Burghardt