Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Prevent or warn when commit header is > 50 characters #42

Open
ghostsquad opened this issue Mar 14, 2020 · 1 comment
Open

Comments

@ghostsquad
Copy link

I found that the combination of commit type (fix, feat, etc) + scope + commit header can easily reach the < 50 character limit that's recommended not only when viewing a commit in Github, but also here:

https://chris.beams.io/posts/git-commit/

This is a request to prevent or warn the user when their commit title is > 50 characters.

@vivaxy
Copy link
Owner

vivaxy commented Mar 15, 2020

Hi, @ghostsquad . Thanks for your suggestions.

I think there are two ways:

1. Prevent it when git commit.

gacp has implemented the commitlint rules about max-lengths since 2.6.1. If a user inputs a commit section (one of header, body, or footer) longer than the commitlint config requires, the commit message will be trimmed when performing git commit.

You can try to add a commitlint config to trim the commit message.

2. Prevent or warn when a user is typing.

I think this is better than 1.

Maybe we can look into the terminal prompt API to see whether it works that way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants