Skip to content

Question: suggested process for handling accidental leading or trailing whitespace in subject #4589

@ddeepwell

Description

@ddeepwell

I find that I accidentally add trailing whitespace in the subject of commit messages. I am appreciative that commitlint catches this before the commit is made, but wish that commitlint could fix this simple case before completely rejecting the commit which is often annoying and disrupts my train of thought.

I understand that commitlint is largely designed to check and not adjust commit messages, but other linters often have a --fix option to solve the simplest of issues. While adding a fix option might not be on the roadmap, what are the suggested workarounds for this scenario? I'm curious to hear what other members of the community do about this.

Currently, in this scenario I copy the content of the rejected commit message from .git/COMMIT_EDITMSG and try again with a fix. But this adds an extra step that slows things down.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions