You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is it possible to get commitlint to ignore commented lines? For example this commit message:
ops: update CommitLint allowed types
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# On branch DAY-36-enforce-git-hygeine
# Your branch is up to date with 'origin/DAY-36-enforce-git-hygeine'.
#
# Changes to be committed:
# modified: .commitlint.yml
#
will fail because there's not an empty line after ops: update CommitLint allowed types but given the rest of the lines are all commented out, I think it should pass? I'm also finding the same thing if e.g. some of the commented lines are longer than the rules (this often happens if the path to a modified file is long)
This would shift the burden of maintaining the filtering of comments and diff's (in case of git commit -v) to git itself, instead of trying to emulate that (configurable) behavior. 🤔
Unfortunately there seems to be no postprocess-commit-msg hook in the Committing-Workflow Hooks that we could use.
Activity
danbernier commentedon Sep 20, 2022
I'd add to @eyefodder's point that anything that
git commit -vignores, so should commitlint.gumbo2k commentedon Jun 27, 2024
Yes, it would be lovely to have the
git commit's cleanup of comments and verbose diff happen before commitlint sees the message.This would shift the burden of maintaining the filtering of comments and diff's (in case of
git commit -v) to git itself, instead of trying to emulate that (configurable) behavior. 🤔Unfortunately there seems to be no
postprocess-commit-msghook in the Committing-Workflow Hooks that we could use.gumbo2k commentedon Jun 27, 2024
BTW: The conventional-changelog 's commit-lint also seems to do this job only half way ... ignoring comments by hardcoding the comment character as
#but failing on the diffs that agit commit --verbosewill put in the commit message.feat: Add cleanup step before parsing
feat: Add cleanup step before parsing
feat: Add cleanup step before parsing (#18)