git-cliff icon indicating copy to clipboard operation
git-cliff copied to clipboard

feat: add changelog modifier callback to run function

Open weichweich opened this issue 1 year ago • 1 comments

Description

I added a call back function to manipulate the Changelog before it's written or the context is printed (depending how git-cliff is started).

Motivation and Context

This change is really handy to add custom logic to query information from GitLab etc. I would love to have something similar to plug-ins, but adding this call back is trivial and allows to build custom git-cliff versions that execute use-case specific, custom logic.

How Has This Been Tested?

This should be trivial. What could possibly break!? :sweat_smile:

Screenshots / Logs (if applicable)

Types of Changes

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [x] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to change)
  • [ ] Documentation (no code change)
  • [ ] Refactor (refactoring production code)
  • [ ] Other

Checklist:

  • [x] My code follows the code style of this project.
  • [x] I have updated the documentation accordingly.
  • [x] I have formatted the code with rustfmt.
  • [x] I checked the lints with clippy.
  • [x] I have added tests to cover my changes.
  • [x] All new and existing tests passed.

weichweich avatar Oct 17 '24 13:10 weichweich

Codecov Report

Attention: Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.

Project coverage is 42.12%. Comparing base (bbb805d) to head (030de7b).

Files with missing lines Patch % Lines
git-cliff/src/lib.rs 0.00% 4 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #922      +/-   ##
==========================================
- Coverage   42.70%   42.12%   -0.57%     
==========================================
  Files          21       21              
  Lines        1745     1769      +24     
==========================================
  Hits          745      745              
- Misses       1000     1024      +24     
Flag Coverage Δ
unit-tests 42.12% <0.00%> (-0.57%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar Oct 17 '24 13:10 codecov-commenter

Hey, really interesting change! I'm down to add it, but maybe add some documentation or examples on how to use this from the API side. Thanks for the PR!

orhun avatar Nov 19 '24 16:11 orhun