compilerla / conventional-pre-commit

A pre-commit hook that checks commit messages for Conventional Commits formatting
Apache License 2.0
335 stars 55 forks source link

fix: Handle comments by stripping #87

Closed nikolaik closed 8 months ago

nikolaik commented 8 months ago

This is an attempt at solving failed validation of commit texts with trailing comment lines which are usually added when writing the commit message in an editor, f.ex:

EDITOR=vim git commit -a

which on some systems gives you a templated commit message similar to this:

# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# On branch nikolaik/editor-comments
# Your branch is up to date with 'origin/nikolaik/editor-comments'.
#
# Changes to be committed:
#   new file:   yolo

Reported in #80