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
feat(version): add flag to include changelog commit author, close #248 #253
Merged
ghiscoding
merged 11 commits into
main
from
feat/conventional-commits-author-to-changelog
Jul 20, 2022
Merged
feat(version): add flag to include changelog commit author, close #248 #253
ghiscoding
merged 11 commits into
main
from
feat/conventional-commits-author-to-changelog
Jul 20, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov Report
@@ Coverage Diff @@
## main #253 +/- ##
==========================================
+ Coverage 93.79% 93.80% +0.02%
==========================================
Files 142 142
Lines 4071 4079 +8
Branches 905 833 -72
==========================================
+ Hits 3818 3826 +8
Misses 253 253
Continue to review full report at Codecov.
|
ghiscoding
changed the title
Feat/conventional commits author to changelog
feat(version): add flag to include changelog commit author, close #248
Jul 13, 2022
3 tasks
9 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Add a flag
--changelog-include-commit-author
to optionally include every commit author name in the changelog when usingconventional-commits
, this in terms is allowing us to see all PR contributors.Supersede previous PR #249 to fix issue #248
Motivation and Context
new feature related to the issue #248, please note that this implementation is not exactly pretty code but at this time
conventional-changelog
lib doesn't provide any easy way to add the commit's author name directly (as requested in this issue), this PR will do that (even if it's a bit hacky). The hacky part is thatconventional-changelog
lib does provide theformat
argument (which is supposed togit log
pretty format) but it then calls its own template parser which interfere with the git log format and that plays with the actual string output, basically any of theformat
argument(s) provided will end up being part of the commit url because of that said template parser, so we then have to pull any extra string argument (like the author that we add in the format) and move them outside of the commit url to avoid breaking the commit url.Let's take this code example, the commit url in changelog will end up looking like this (with defined tokens or our own)
[e123b32](http://github/..../e123b32<<author=Reno Bot>>))
we will then extract the author and move it outside the commit url, then transform it into something readable like this:
[e123b32](http://github/..../e123b32)) (@Reno-Bot)
For a final live example, executing a new
version
of Lerna-Lite in dry-run mode, we get the following with/without commits authorswithout commit's author (before new feature or when new flag isn't provided)
with commit's author (enabled opt-in feature
--changelog-include-commit-author
)scroll to the right to see the difference -->>
How Has This Been Tested?
unit tests were added for the new feature
Types of changes
Checklist: