-
Notifications
You must be signed in to change notification settings - Fork 915
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check for signed-off-by doesn't ignore comments #1809
Comments
Would you mind posting a full example message? Thanks |
The commit I'm making looks like this (not done through -m):
Which then gives the correct output in the console as:
However, it gives the error: When looking deeper into the code, I logged out what the value of
And it gives the value as:
So, the value of commitlint/@commitlint/cli/src/cli.js Line 175 in 0e0c68d
The output in the console then shows all the comments as well. But, it doesn't use this parsed result when checking the last line for a Signed-off-by string.
|
If the Thanks for reporting! |
The
Which seems to be ignored by other rules but not for |
Oh I see. Thanks for the clarification! |
I opened a pull request to fix this issue, can you @escapedcat please review? See #2098 |
Expected Behavior
When using the rule
"signed-off-by": [2, "always", "Signed-off-by:"]
, it doesn't seem to use the parsed commit message when reading in the lines. I would expect the values oflines
to be['subject', 'body', 'Signed-off-by: User [email protected]']
.Current Behavior
The current behaviour includes the comments that are part of
.git/COMMIT_EDIT_MSG
so it is checking for a 'Signed-off-by' line on the last comment rather than the last actual line of the message, causing it to always fail the check.Affected packages
Possible Solution
Use the correctly parsed input?
Steps to Reproduce (for bugs)
Make a commit using
git commit -s
with the setting"signed-off-by": [1, "always", "Signed-off-by:"]
.Context
I'm trying to enforce signed commits in our repo.
Your Environment
commitlint --version
git --version
node --version
The text was updated successfully, but these errors were encountered: