Skip to content

Ignore comments on the commit message #32

Description

@adrianlzt

I think comments (lines starting with #) should be ignored by the parser.

➜ echo -e "foo: bar\n# comment" > MSG ; python -mpre_commit hook-impl --config=.pre-commit-config.yaml --hook-type=commit-msg --hook-dir /var/tmp/tmp.WtDrdMZqn8/.git/hooks -- MSG
CommitMe - Conventional Commit message validation........................Failed
- hook id: commit-me
- exit code: 1

(node:724770) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
HEAD:1:0: error: Commits MUST be prefixed with a type, which consists of a noun, feat, fix, etc., followed by the OPTIONAL scope, OPTIONAL !, and REQUIRED terminal colon and space.

  1 | foo: bar
# comment
    | ^

HEAD:1:0: error: Commits MUST be prefixed with a type, which consists of a noun, feat, fix, etc., followed by the OPTIONAL scope, OPTIONAL !, and REQUIRED terminal colon and space.

  1 | foo: bar
# comment
    | ^

❌ Found 2 Conventional Commit compliance issues.

Activity

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

Metadata

Metadata

Assignees

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