Skip to content

Commit message with a hash sign at the start is not detected #499

Description

@syyyr

Hi,

gitlint is not able to detect a commit message that starts with a hash sign. A commit message can begin with a hash sign (for example, by using the -m option for git commit). A usecase for this might be tagging an issue number.

$ git show
commit 0821db153d21cc08755082e83fa247c932490e2c (HEAD -> main)
Author: Václav Kubernát <sir.venceslas@gmail.com>
Date:   Mon May 29 10:21:16 2023 +0200

    #123 Fix bug
$ gitlint --commits 0821db153d21cc08755082e83fa247c932490e2c
1: T8 Title is too short (0<5)
3: B6 Body message is missing

Can I configure gitlint to not ignore the hashes? I understand that ignoring the hashes is useful for integration with code (commit message) editors (because git commit ignores them if you use the editor), but if I'm linting on our CI pipeline, I'd like to keep the hash signs.

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementUser-facing feature enhancements

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions