Skip to content

bug: comment lines not highlighted as error directly after subject #80

@eamonburns

Description

@eamonburns

The following "body" line is correctly highlighted as an error:

feat: description
body

But this is not:

feat: description
# comment
body

Even though the resulting commit message is this (because comment lines are completely removed, not just treated as blank, by Git's commit message parser):

feat: description
body

Unfortunately, I realize this is not as simple as just highlighting any line directly after the subject line, regardless of whether they are comments, as errors, because often a commit message would look like this:

feat: description
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# On branch main
# Changes to be committed:
#	modified:   some_file.txt
#
# ------------------------ >8 ------------------------
# Do not modify or remove the line above.
# Everything below it will be ignored.
diff --git a/some_file.txt b/some_file.txt
index 8b13789..d4d70e9 100644
--- a/some_file.txt
+++ b/some_file.txt
@@ -1 +1,2 @@
 
+file content

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions