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

Add whitespace handling (trim) for commit messages #3199

Closed
rojvv opened this issue May 26, 2022 · 7 comments
Closed

Add whitespace handling (trim) for commit messages #3199

rojvv opened this issue May 26, 2022 · 7 comments

Comments

@rojvv
Copy link

rojvv commented May 26, 2022

image

@escapedcat
Copy link
Member

You mean if it's intended not to trim inputs? tbh I don't know. What would you expect? Is this blocking you in a way?
Would be nice if you could add some more context to your issue.

Creating a commit message I usually use -m "[MESSAGE]" and I don't have any spaces in there. Don't think it's commitlint's task to take care of this. But maybe this could be improved.

@rojvv
Copy link
Author

rojvv commented May 27, 2022

I expect it to not count leading whitespaces. Yes, it is super blocking in case of mistakes.

@escapedcat escapedcat changed the title Is this intended? Add whitespace handling (trim) for commit messages May 27, 2022
@escapedcat
Copy link
Member

Do you have time and motivation to look into this?

@adanilev
Copy link

adanilev commented Sep 9, 2022

So you want to allow leading whitespace? IMO, that's an invalid commit message and is being linted correctly - albeit with a misleading error message.

The purpose of commitlint is to throw errors when you make mistakes - so blocking is the correct behaviour. No?

@escapedcat
Copy link
Member

The purpose of commitlint is to throw errors when you make mistakes

True, I can understand this as well

@jbnjohnathan
Copy link

Currently when having a leading space, the error message says that the subject is empty.
I suggest that the error message instead says that there is leading whitespace.
This is due to identifying extra unwanted leading whitespace is hard in a commit message.

@escapedcat
Copy link
Member

Thanks @marcalexiei
https://github.com/conventional-changelog/commitlint/releases/tag/v18.6.0

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

No branches or pull requests

4 participants