scope(conventional-commits-parser) git diff showing in body/footer
See original GitHub issueWhen doing a git commit --verbose
, conventional-commits-parser should strip out the git diff message in the bottom.
I noticed when working on this PR for https://github.com/marionebl/commitlint/pull/436, that the validation of {body,footer}-max-line-length was validating the git diff of the commit.
After reporting the bug to marionebl/commitlint, the author suggested the fix to be made on this package since commitlint delegates the parsing to that module.
I don’t know if you are already stripping out the comments from the message:
type(scope): header message
body
footer
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# Date: <date>
#
# On branch <branch>
# Your branch is up to date with '<remote/branch>'.
#
# Changes to be committed:
# <typeOfChange>[]: file-changed
#
# ------------------------ >8 ------------------------
# Do not modify or remove the line above.
# Everything below it will be ignored.
If yes I would recommend before removing to remove everything after:
# ------------------------ >8 ------------------------
# Do not modify or remove the line above.
# Everything below it will be ignored.
If not then maybe diff --git a/
If any of my solutions I proposed are valid and ok, I can try to contribute with those changes on this repo.
Related issue: https://github.com/marionebl/commitlint/issues/437
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (3 by maintainers)
Hi 👋@byCedric, not on my end, I was waiting for some feedback from the collaborators of this repo but I didn’t get any feedback and is blocking my other PR
I just checked with conventional-commits-parser@3.0.8 and running
commitlint --verbose -f origin/master
gave me a warning (I configured body length to be warnings for now) for this commit message:I assume that this commit message has the same pattern as the problem described here.
Result:
Checking back on it some more the warning is though also issued when running without the
--verbose
flag. So this might be a different issue.EDIT: Coming back to this after some time I realize the last line of above commit message is not recognized as a footer because it does not use a correct token format. It would be nice if such url references could be recognized as special footers because it is quite common they break the max-line-length limit but that’s an unrelated request.